Пример #1
0
        public void RotateAroundPoint( ref Quat4f rotation, Vector3f point )
        {
            // TODO: constrained
            // if (constraint())
            //     constraint()->constrainRotation(rotation, this);
            
            Rotation *= rotation;
            Rotation = Rotation.Normalized(); // Prevents numerical drift

            Quat4f q = new Quat4f( InverseTransformOf( rotation.Axis ), rotation.Angle );
            Vector3f trans = point + q.Rotate( Position - point ) - Translation;
  
            // if (constraint())
            // constraint()->constrainTranslation(trans, this);
            
            Translation += trans;
            
            // emit modified();
        }