I’m working on an arc class, that creates an arc from 3 locations. I tested the math before starting with jme3.
So with jme3 I did this:
- create a Vector3f for each location
- substract the center from startpoint and endpoint
- create a Vector3f(1f, 0, 0) for angle 0
- use center.angleBetween(vector2start) and center.angleBetween(vector2end) - which results in both 0 or both Math.PI
That looked a bit strange to me, so I created a class VectorMath which calculates the angleBetween from 2 given vectors.
With the math I was using before, I got the expected angles.
So I don’t know - is my usage of Vector3f wrong, or does the angleBetween of Vector3f have a bug?