Skip to content

Commit ce1a8e8

Browse files
committed
fixed python bindings
1 parent d2ad991 commit ce1a8e8

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Qor/bindings/PythonBindings.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,16 @@ namespace Scripting
691691
)
692692
));
693693
}
694+
695+
float vec3_length(glm::vec3& v) { return v.length(); }
696+
void vec3_normalize(glm::vec3& v) { glm::normalize(v); }
694697

695-
float get_x(glm::vec3 v) { return v.x; }
696-
float get_y(glm::vec3 v) { return v.y; }
697-
float get_z(glm::vec3 v) { return v.z; }
698-
void set_x(glm::vec3 v, float x) { v.x = x; }
699-
void set_y(glm::vec3 v, float y) { v.y = y; }
700-
void set_z(glm::vec3 v, float z) { v.z = z; }
698+
float get_x(glm::vec3& v) { return v.x; }
699+
float get_y(glm::vec3& v) { return v.y; }
700+
float get_z(glm::vec3& v) { return v.z; }
701+
void set_x(glm::vec3& v, float x) { v.x = x; }
702+
void set_y(glm::vec3& v, float y) { v.y = y; }
703+
void set_z(glm::vec3& v, float z) { v.z = z; }
701704

702705
//float get_r(Color c) { return c.r; }
703706
//float get_g(Color c) { return c.g; }
@@ -1025,8 +1028,8 @@ namespace Scripting
10251028
.add_property("x", &get_x, &set_x)
10261029
.add_property("y", &get_y, &set_y)
10271030
.add_property("z", &get_z, &set_z)
1028-
.def("length", &glm::length<float>)
1029-
.def("normalize", &glm::normalize<float>)
1031+
.def("length", &vec3_length)
1032+
.def("normalize", &vec3_normalize)
10301033
;
10311034
boost::python::class_<glm::vec4>("vec4")
10321035
.def(boost::python::init<>())
@@ -1040,8 +1043,8 @@ namespace Scripting
10401043
.def(boost::python::self -= boost::python::self)
10411044
.def(boost::python::self *= boost::python::self)
10421045
.def(boost::python::self *= float())
1043-
.def("length", &glm::length<float>)
1044-
.def("normalize", &glm::normalize<float>)
1046+
//.def("length", &glm::length<float>)
1047+
//.def("normalize", &glm::normalize<float>)
10451048
;
10461049

10471050
boost::python::class_<Color>("Color")

0 commit comments

Comments
 (0)