When assertions are enabled, whenevery ou use lookAt() in a spatial extending class the came just crashes with a assertion error caused by itself:
Spatial
public void lookAt(Vector3f position, Vector3f upVector) {
if ((refreshFlags & RF_TRANSFORM) != 0){
updateGeometricState();
}
assert TempVars.get().lock();
Vector3f compVecA = TempVars.get().vect1;
compVecA.set(position).subtractLocal(getWorldTranslation());
getLocalRotation().lookAt(compVecA, upVector); //this here has to fail, as quaternion.lookAt tries itself to call lock()
assert TempVars.get().unlock();
setTransformRefresh();
}
public void lookAt(Vector3f direction, Vector3f up ) {
TempVars vars = TempVars.get();
assert vars.lock(); //this here has to fail of course then...
vars.vect3.set( direction ).normalizeLocal();
vars.vect1.set( up ).crossLocal( direction ).normalizeLocal();
vars.vect2.set( direction ).crossLocal( vars.vect1 ).normalizeLocal();
fromAxes( vars.vect1, vars.vect2, vars.vect3 );
assert vars.unlock();
}