Access to vector operators

This commit is contained in:
Dane Johnson
2021-01-15 20:33:25 -06:00
parent 7651923ee8
commit 95ccf7af6b
6 changed files with 46 additions and 8 deletions

View File

@@ -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"