Das-Kollektiv / tdme2

TDME2 - ThreeDeeMiniEngine2 is a lightweight, multi-platform 3D engine including tools suited for 3D game/application development using C++, Mini(t)Script, GLSL, ...
Other
176 stars 29 forks source link

javacpp-port: operators for tdme/math/* #2

Closed andreasdr closed 4 years ago

andreasdr commented 6 years ago

JAVA does not support operators. C++ does.

Implement operators for tdme/math/*, e.g. Vector3 All the math is in place by inline methods and should even just be called when implementing operators.

andreasdr commented 6 years ago

Examples would for Vector3 would be:

Vector3 a + Vector3 b auto c=a.clone().add(b); return c;

Vector3 a - Vector3 b auto c=a.clone().sub(b); return c;

Vector3 a * float b auto c=a.clone().scale(b); return c;

Vector3 a * Vector3 b auto c=a.clone().scale(b); return c;

Vector3 a / float b auto c=a.clone().scale(1.0f / b); return c;

Vector3 a / Vector3 b vector3 bInverted(1.0f / b[0], 1.0f / b[1], 1.0f / b[2]); auto c=a.clone().scale(bInverted); return c;

+=,-=,*=,/= would be interessting too.

Vector2, Vector4, Quaternion and Matrix are similar, but I can also provide a list if required.

lukeseuff commented 4 years ago

Do you still need this done?

andreasdr commented 4 years ago

Hi thank you very much for asking, a colleague is already working on it. If there is any reason to do so I will come back to you.