Access to vector operators
This commit is contained in:
@@ -11,15 +11,24 @@
|
||||
#include "Mesh.h"
|
||||
#include "Ball.h"
|
||||
#include "Camera.h"
|
||||
%}
|
||||
%}
|
||||
|
||||
typedef float cfloat;
|
||||
%ignore "cfloat";
|
||||
|
||||
class Vector3 {
|
||||
public:
|
||||
Vector3();
|
||||
cfloat x, y, z;
|
||||
};
|
||||
%extend Vector3 {
|
||||
Vector3 operator+(const Vector3 &o) const {
|
||||
return *$self + o;
|
||||
}
|
||||
Vector3 operator*(const cfloat &o) const {
|
||||
return *$self * o;
|
||||
}
|
||||
}
|
||||
%ignore "Vector3";
|
||||
|
||||
%include "types.h"
|
||||
|
||||
Reference in New Issue
Block a user