@@ -25,6 +25,44 @@ void addVector2F(pybind11::module& m) {
2525 py::arg (" x" ) = 0 .0f , py::arg (" y" ) = 0 .0f )
2626 .def_readwrite (" x" , &Vector2F::x)
2727 .def_readwrite (" y" , &Vector2F::y)
28+ .def (" setZero" , &Vector2F::setZero)
29+ .def (" normalize" , &Vector2F::normalize)
30+ .def (" dot" ,
31+ [](const Vector2F& instance, py::object other) {
32+ return instance.dot (objectToVector2F (other));
33+ })
34+ .def (" cross" ,
35+ [](const Vector2F& instance, py::object other) {
36+ return instance.cross (objectToVector2F (other));
37+ })
38+ .def (" sum" , &Vector2F::sum)
39+ .def (" avg" , &Vector2F::avg)
40+ .def (" min" , &Vector2F::min)
41+ .def (" max" , &Vector2F::max)
42+ .def (" absmin" , &Vector2F::absmin)
43+ .def (" absmax" , &Vector2F::absmax)
44+ .def (" dominantAxis" , &Vector2F::dominantAxis)
45+ .def (" subminantAxis" , &Vector2F::subminantAxis)
46+ .def (" normalized" , &Vector2F::normalized)
47+ .def (" length" , &Vector2F::length)
48+ .def (" lengthSquared" , &Vector2F::lengthSquared)
49+ .def (" distanceTo" ,
50+ [](const Vector2F& instance, py::object other) {
51+ return instance.distanceTo (objectToVector2F (other));
52+ })
53+ .def (" distanceSquaredTo" ,
54+ [](const Vector2F& instance, py::object other) {
55+ return instance.distanceSquaredTo (objectToVector2F (other));
56+ })
57+ .def (" reflected" ,
58+ [](const Vector2F& instance, py::object other) {
59+ return instance.reflected (objectToVector2F (other));
60+ })
61+ .def (" projected" ,
62+ [](const Vector2F& instance, py::object other) {
63+ return instance.projected (objectToVector2F (other));
64+ })
65+ .def (" tangential" , &Vector2F::tangential)
2866 .def (" __getitem__" , [](const Vector2F& instance,
2967 size_t i) -> float { return instance[i]; })
3068 .def (" __setitem__" ,
@@ -97,6 +135,44 @@ void addVector2D(pybind11::module& m) {
97135 py::arg (" x" ) = 0.0 , py::arg (" y" ) = 0.0 )
98136 .def_readwrite (" x" , &Vector2D::x)
99137 .def_readwrite (" y" , &Vector2D::y)
138+ .def (" setZero" , &Vector2D::setZero)
139+ .def (" normalize" , &Vector2D::normalize)
140+ .def (" dot" ,
141+ [](const Vector2D& instance, py::object other) {
142+ return instance.dot (objectToVector2D (other));
143+ })
144+ .def (" cross" ,
145+ [](const Vector2D& instance, py::object other) {
146+ return instance.cross (objectToVector2D (other));
147+ })
148+ .def (" sum" , &Vector2D::sum)
149+ .def (" avg" , &Vector2D::avg)
150+ .def (" min" , &Vector2D::min)
151+ .def (" max" , &Vector2D::max)
152+ .def (" absmin" , &Vector2D::absmin)
153+ .def (" absmax" , &Vector2D::absmax)
154+ .def (" dominantAxis" , &Vector2D::dominantAxis)
155+ .def (" subminantAxis" , &Vector2D::subminantAxis)
156+ .def (" normalized" , &Vector2D::normalized)
157+ .def (" length" , &Vector2D::length)
158+ .def (" lengthSquared" , &Vector2D::lengthSquared)
159+ .def (" distanceTo" ,
160+ [](const Vector2D& instance, py::object other) {
161+ return instance.distanceTo (objectToVector2D (other));
162+ })
163+ .def (" distanceSquaredTo" ,
164+ [](const Vector2D& instance, py::object other) {
165+ return instance.distanceSquaredTo (objectToVector2D (other));
166+ })
167+ .def (" reflected" ,
168+ [](const Vector2D& instance, py::object other) {
169+ return instance.reflected (objectToVector2D (other));
170+ })
171+ .def (" projected" ,
172+ [](const Vector2D& instance, py::object other) {
173+ return instance.projected (objectToVector2D (other));
174+ })
175+ .def (" tangential" , &Vector2D::tangential)
100176 .def (" __getitem__" , [](const Vector2D& instance,
101177 size_t i) -> double { return instance[i]; })
102178 .def (" __setitem__" , [](Vector2D& instance, size_t i,
@@ -169,6 +245,44 @@ void addVector3F(pybind11::module& m) {
169245 .def_readwrite (" x" , &Vector3F::x)
170246 .def_readwrite (" y" , &Vector3F::y)
171247 .def_readwrite (" z" , &Vector3F::z)
248+ .def (" setZero" , &Vector3F::setZero)
249+ .def (" normalize" , &Vector3F::normalize)
250+ .def (" dot" ,
251+ [](const Vector3F& instance, py::object other) {
252+ return instance.dot (objectToVector3F (other));
253+ })
254+ .def (" cross" ,
255+ [](const Vector3F& instance, py::object other) {
256+ return instance.cross (objectToVector3F (other));
257+ })
258+ .def (" sum" , &Vector3F::sum)
259+ .def (" avg" , &Vector3F::avg)
260+ .def (" min" , &Vector3F::min)
261+ .def (" max" , &Vector3F::max)
262+ .def (" absmin" , &Vector3F::absmin)
263+ .def (" absmax" , &Vector3F::absmax)
264+ .def (" dominantAxis" , &Vector3F::dominantAxis)
265+ .def (" subminantAxis" , &Vector3F::subminantAxis)
266+ .def (" normalized" , &Vector3F::normalized)
267+ .def (" length" , &Vector3F::length)
268+ .def (" lengthSquared" , &Vector3F::lengthSquared)
269+ .def (" distanceTo" ,
270+ [](const Vector3F& instance, py::object other) {
271+ return instance.distanceTo (objectToVector3F (other));
272+ })
273+ .def (" distanceSquaredTo" ,
274+ [](const Vector3F& instance, py::object other) {
275+ return instance.distanceSquaredTo (objectToVector3F (other));
276+ })
277+ .def (" reflected" ,
278+ [](const Vector3F& instance, py::object other) {
279+ return instance.reflected (objectToVector3F (other));
280+ })
281+ .def (" projected" ,
282+ [](const Vector3F& instance, py::object other) {
283+ return instance.projected (objectToVector3F (other));
284+ })
285+ .def (" tangential" , &Vector3F::tangential)
172286 .def (" __getitem__" , [](const Vector3F& instance,
173287 size_t i) -> float { return instance[i]; })
174288 .def (" __setitem__" ,
@@ -242,6 +356,44 @@ void addVector3D(pybind11::module& m) {
242356 .def_readwrite (" x" , &Vector3D::x)
243357 .def_readwrite (" y" , &Vector3D::y)
244358 .def_readwrite (" z" , &Vector3D::z)
359+ .def (" setZero" , &Vector3D::setZero)
360+ .def (" normalize" , &Vector3D::normalize)
361+ .def (" dot" ,
362+ [](const Vector3D& instance, py::object other) {
363+ return instance.dot (objectToVector3D (other));
364+ })
365+ .def (" cross" ,
366+ [](const Vector3D& instance, py::object other) {
367+ return instance.cross (objectToVector3D (other));
368+ })
369+ .def (" sum" , &Vector3D::sum)
370+ .def (" avg" , &Vector3D::avg)
371+ .def (" min" , &Vector3D::min)
372+ .def (" max" , &Vector3D::max)
373+ .def (" absmin" , &Vector3D::absmin)
374+ .def (" absmax" , &Vector3D::absmax)
375+ .def (" dominantAxis" , &Vector3D::dominantAxis)
376+ .def (" subminantAxis" , &Vector3D::subminantAxis)
377+ .def (" normalized" , &Vector3D::normalized)
378+ .def (" length" , &Vector3D::length)
379+ .def (" lengthSquared" , &Vector3D::lengthSquared)
380+ .def (" distanceTo" ,
381+ [](const Vector3D& instance, py::object other) {
382+ return instance.distanceTo (objectToVector3D (other));
383+ })
384+ .def (" distanceSquaredTo" ,
385+ [](const Vector3D& instance, py::object other) {
386+ return instance.distanceSquaredTo (objectToVector3D (other));
387+ })
388+ .def (" reflected" ,
389+ [](const Vector3D& instance, py::object other) {
390+ return instance.reflected (objectToVector3D (other));
391+ })
392+ .def (" projected" ,
393+ [](const Vector3D& instance, py::object other) {
394+ return instance.projected (objectToVector3D (other));
395+ })
396+ .def (" tangential" , &Vector3D::tangential)
245397 .def (" __getitem__" , [](const Vector3D& instance,
246398 size_t i) -> double { return instance[i]; })
247399 .def (" __setitem__" , [](Vector3D& instance, size_t i,
0 commit comments