LWJGL Forum

Programming => General Java Game Development => Topic started by: duckbob on February 18, 2006, 21:27:22

Title: In Place Vector Operations?
Post by: duckbob on February 18, 2006, 21:27:22
Is there really no built in way to do
Vector3f A = ...;
Vector3f B = ...;
A += B;

?

Where A is the same A it was with different values.

That being said, what is nessicary to compile the java side of LWJGL.  While there should be a differentation between mutation and creation of a independant result, mutation is critical for convience if nothing else.  Otherwise I will always have to call You.GetThisVector() which is just a pain.
Title: hmmmmmm...
Post by: Fool Running on February 21, 2006, 14:18:46
QuoteIs there really no built in way to do
Vector3f A = ...;
Vector3f B = ...;
A += B;

?
Can you not just do Vector3f.add(A, B, A)? That should give you what you want. (I assume you know that you can't overload operators in Java so you weren't asking for that. :D )