Bladeren bron

Adding a few interfaces

Panagiotis Christopoulos Charitos 15 jaren geleden
bovenliggende
commit
c993364e0f

+ 8 - 0
src/Scene/Controllers/Controller.cpp

@@ -2,12 +2,20 @@
 #include "Scene.h"
 #include "App.h"
 
+
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Controller::Controller(Type type_): 
 	type(type_) 
 {
 	app->getScene().registerController(this);
 }
 
+
+//======================================================================================================================
+// Destructor                                                                                                          =
+//======================================================================================================================
 Controller::~Controller()
 {
 	app->getScene().unregisterController(this);

+ 2 - 0
src/Scripting/BoostPythonInterfaces.cpp

@@ -11,7 +11,9 @@ using namespace M;
 
 BOOST_PYTHON_MODULE(Anki)
 {
+	#include "Vec2.bpi.h"
 	#include "Vec3.bpi.h"
+	#include "Vec4.bpi.h"
 	#include "Scene.bpi.h"
 	#include "App.bpi.h"
 }

+ 0 - 0
src/Scripting/Math/Vec2.bpi.h


+ 2 - 0
src/Scripting/Math/Vec3.bpi.h

@@ -21,6 +21,8 @@ class_<Vec3>("Vec3")
 	.def(self / self) // /
 	.def(self /= self) // /=
 	.def(- self) // negative
+	.def(self == self) // ==
+	.def(self != self) // ==
 	// ops with float
 	.def(self + float()) // +
 	.def(self += float()) // +=

+ 36 - 0
src/Scripting/Math/Vec4.bpi.h

@@ -0,0 +1,36 @@
+
+class_<Vec4>("Vec4")
+	.def_readwrite("x", &Vec4::x)
+	.def_readwrite("y", &Vec4::y)
+	.def_readwrite("z", &Vec4::z)
+	.def_readwrite("w", &Vec4::w)
+	// constructors
+	.def(init<>())
+	.def(init<float>())
+	.def(init<float, float, float, float>())
+	.def(init<const Vec2&, float, float>())
+	.def(init<const Vec3&, float>())
+	.def(init<const Vec4&>())
+	.def(init<const Quat&>())
+	// ops with self
+	.def(self + self) // +
+	.def(self += self) // +=
+	.def(self - self) // -
+	.def(self -= self) // -=
+	.def(self * self) // *
+	.def(self *= self) // *=
+	.def(self / self) // /
+	.def(self /= self) // /=
+	.def(- self) // negative
+	.def(self == self) // ==
+	.def(self != self) // ==
+	// ops with float
+	.def(self + float()) // +
+	.def(self += float()) // +=
+	.def(self - float()) // -
+	.def(self -= float()) // -=
+	.def(self * float()) // *
+	.def(self *= float()) // *=
+	.def(self / float()) // /
+	.def(self /= float()) // /=
+;