Пример #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();
        }
Пример #2
0
        public void Rotate( ref Quat4f q )
        {
            // if (constraint())
            // constraint()->constrainRotation(q, this);
            
            Rotation *= q;
            Rotation = Rotation.Normalized();

            // TODO: emit modified()
        }