How do I get the “absolute rotation” after I remove the parent? When I no longer want a parent attached to the mesh, I want to remove the parent attribute but keep the position and rotation its currently at prior to its parent set to null. Cloning the “rotation” attribute doesn’t work correctly. I need the absolute rotation.
this.entity.mesh.parent = box;
// entity moves around randomly at this time.
setTimeout(() => {
const oldPos = this.entity.mesh.getAbsolutePosition().clone();
const oldAngle = this.entity.mesh.rotation.clone();
this.entity.mesh.parent = null;
this.entity.mesh.position = oldPos;
// doesnt work correctly.
this.entity.mesh.rotation = oldAngle;
}, 10000)