Thanks for your advices, here is what i have come up with.
Am i approacing the correct thinking?
public void update(long timer_delta) {
// TODO: take into account the delta time in all calculations
// get the current rotation
m_transformGroup.getTransform(m_transformRotation);
m_transformRotation.get(m_matrixRotation);
// adjust thrust
if (m_thrustForward || m_thrustBack) {
if (m_thrustForward && m_vectorMovement.z < 0.1f) { m_thrust += 0.005f; }
else if (m_thrustBack && m_vectorMovement.z > - 0.05f) { m_thrust -= 0.001f; }
// apply thrust to the m_vectorMovement depending on the rotation
Vector4f thrust4f = new Vector4f(0.0f, 0.0f, m_thrust, 0.0f);
m_transformRotation.transform(thrust4f);
// System.out.println("thrustZ : " + thrust4f.x + " , " + thrust4f.y + " ,
" + thrust4f.z + " , " + thrust4f.w);
// currently everything faces by default the negative z axis, therefore
"forward" is negative
// and we adjust the values in the vector accordingly
Vector3f thrust3f = new Vector3f( - thrust4f.x, - thrust4f.y, - thrust4f.z);
m_vectorMovement.add(thrust3f);
} else { m_thrust = 0.0f; }
// apply the m_vectorMovement to the m_transformMovement
Vector3f translation = new Vector3f();
m_transformMovement.get(translation);
translation.add(m_vectorMovement);
m_transformMovement.set(translation);
// make a new transform from the movement and rotation
Transform3D transform = new Transform3D();
transform.set(m_matrixRotation, translation, 1);
// update the new transform
m_transformGroup.setTransform(transform);
}
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".