Exemplo n.º 1
0
        public void ApplyHardKeyFrame(IPhysicsObject physObj, Vector3 newPos, Quaternion newRot, float timeStep)
        {
            if (!objectIDs.ContainsKey(physObj))
            {
                return;
            }

            float[] pos = Vector3Helper.ToFloats(ref newPos);
            float[] rot = { newRot.X, newRot.Y, newRot.Z, newRot.W };

            HavokDllBridge.apply_hard_keyframe(objectIDs[physObj], pos, rot, timeStep);
        }
Exemplo n.º 2
0
        public void StopKeyframe(IPhysicsObject physObj)
        {
            if (!objectIDs.ContainsKey(physObj))
            {
                return;
            }

            Vector3    scale, trans;
            Quaternion quat;

            physObj.PhysicsWorldTransform.Decompose(out scale, out quat, out trans);

            float[] pos = Vector3Helper.ToFloats(ref trans);
            float[] rot = { quat.X, quat.Y, quat.Z, quat.W };

            HavokDllBridge.apply_hard_keyframe(objectIDs[physObj], pos, rot, 0.016f);
        }