Closed andreasdr closed 4 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.
Do you still need this done?
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.
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.