/// <summary> /// Updates the local transformations, required if you change LocalOffset and/or LocalRotation. /// </summary> public void UpdateLocalTransformations() { //cache matrices used to translate the position from and to physics engine / gfx engine PositiveCenterMatrix = Matrix.RotationQuaternion(LocalRotation) * Matrix.Translation(LocalOffset); NegativeCenterMatrix = PositiveCenterMatrix; NegativeCenterMatrix.Invert(); }
/// <summary> /// Updates the local transformations, required if you change LocalOffset and/or LocalRotation. /// </summary> public virtual void UpdateLocalTransformations() { //cache matrices used to translate the position from and to physics engine / gfx engine PositiveCenterMatrix = Matrix.RotationQuaternion(LocalRotation) * (Parent == null ? Matrix.Translation(LocalOffset * CachedScaling) : Matrix.Translation(LocalOffset)); NegativeCenterMatrix = PositiveCenterMatrix; NegativeCenterMatrix.Invert(); }