internal void Dispose()
        {
            if (Body.isInWorld())
            {
                m_parent_scene.removeFromWorld(Body);
            }

            if (m_aMotor.Handle != IntPtr.Zero)
            {
                m_parent_scene.getBulletWorld().removeConstraint(m_aMotor);
            }

            m_aMotor.Dispose(); m_aMotor = null;
            ClosestCastResult.Dispose(); ClosestCastResult = null;
            Body.Dispose(); Body   = null;
            Shell.Dispose(); Shell = null;
            tempQuat1.Dispose();
            tempTrans1.Dispose();
            tempVector1.Dispose();
            tempVector2.Dispose();
            tempVector3.Dispose();
            tempVector4.Dispose();
            tempVector5RayCast.Dispose();
            tempVector6RayCast.Dispose();
        }
Exemplo n.º 2
0
 public override void Dispose()
 {
     disposeAllBodies();
     m_world.Dispose();
     m_broadphase.Dispose();
     ((btDefaultCollisionConfiguration)m_collisionConfiguration).Dispose();
     ((btSequentialImpulseConstraintSolver)m_solver).Dispose();
     worldAabbMax.Dispose();
     worldAabbMin.Dispose();
     VectorZero.Dispose();
     QuatIdentity.Dispose();
     m_gravity.Dispose();
     VectorZero   = null;
     QuatIdentity = null;
 }
Exemplo n.º 3
0
        internal void Dispose()
        {
            m_parent_scene.RemoveAvatarFromList(this);
            if (Body != null)
            {
                if (Body.isInWorld())
                {
                    m_parent_scene.removeFromWorld(this, Body);
                    m_parent_scene.RemoveCollisionObject(Body);
                }
                Body.Dispose();
                Body = null;
            }

            if (m_aMotor != null)
            {
                if (m_aMotor.Handle != IntPtr.Zero)
                {
                    m_parent_scene.getBulletWorld().removeConstraint(m_aMotor);
                }

                m_aMotor.Dispose(); m_aMotor = null;
            }
            if (ClosestCastResult != null)
            {
                ClosestCastResult.Dispose(); ClosestCastResult = null;
            }
            if (Shell != null)
            {
                Shell.Dispose(); Shell = null;
            }
            tempQuat1.Dispose();
            tempTrans1.Dispose();
            tempVector1.Dispose();
            tempVector2.Dispose();
            tempVector3.Dispose();
            tempVector4.Dispose();
            tempVector5RayCast.Dispose();
            tempVector6RayCast.Dispose();
        }