Universe.Physics.BulletSPlugin.BSConstraint.Dispose C# (CSharp) Méthode

Dispose() public méthode

public Dispose ( ) : void
Résultat void
        public virtual void Dispose()
        {
            if (m_enabled)
            {
                m_enabled = false;
                if (m_constraint.HasPhysicalConstraint)
                {
                    bool success = PhysicsScene.PE.DestroyConstraint(m_world, m_constraint);
                    m_world.physicsScene.DetailLog(
                        "{0},BSConstraint.Dispose,taint,id1={1},body1={2},id2={3},body2={4},success={5}",
                        BSScene.DetailLogZero,
                        m_body1.ID, m_body1.AddrString,
                        m_body2.ID, m_body2.AddrString,
                        success);
                    m_constraint.Clear();
                }
            }
        }

Usage Example

Exemple #1
0
        // The constraint MUST exist in the collection
        // Could be called if the constraint was previously removed.
        // Return 'true' if the constraint was actually removed and disposed.
        public bool RemoveAndDestroyConstraint(BSConstraint constrain)
        {
            bool removed = false;

            lock (m_constraints)
            {
                // remove the constraint from our collection
                removed = m_constraints.Remove(constrain);
            }
            // Dispose() is safe to call multiple times
            constrain.Dispose();
            return(removed);
        }
All Usage Examples Of Universe.Physics.BulletSPlugin.BSConstraint::Dispose