private void ReplaceShape(HkShape shape)
 {
     if (shape.IsZero)
     {
         IsEmpty = true;
     }
     else
     {
         RigidBody.SetShape(shape);
         shape.RemoveReference();
         m_voxelMap.RaisePhysicsChanged();
     }
 }
Esempio n. 2
0
        private void UpdateRigidBodyShape()
        {
            if (!m_needsShapeUpdate)
            {
                return;
            }

            m_needsShapeUpdate = false;

            ProfilerShort.Begin("MyVoxelPhysicsBody.RigidBody.UpdateShape()");
            Debug.Assert(RigidBody != null, "RigidBody in voxel physics is null! This must not happen.");
            //jn: peaks with Render profiling and destruction
            if (RigidBody != null)
            {
                RigidBody.UpdateShape();
            }
            ProfilerShort.End();

            m_voxelMap.RaisePhysicsChanged();
        }