Ejemplo n.º 1
0
        public void Reset(int bodyCapacity,
                          int contactCapacity,
                          int jointCapacity,
                          b2ContactListener listener)
        {
            if (m_bodyCapacity < bodyCapacity)
            {
                m_bodies       = new b2Body[bodyCapacity];
                m_bodyCapacity = bodyCapacity;
                m_velocities   = new b2Velocity[m_bodyCapacity];
                m_positions    = new b2Position[m_bodyCapacity];
            }
            if (m_contactCapacity < contactCapacity)
            {
                m_contacts        = new b2Contact[contactCapacity];
                m_contactCapacity = contactCapacity;
            }
            if (m_jointCapacity < jointCapacity)
            {
                m_joints        = new b2Joint[jointCapacity];
                m_jointCapacity = jointCapacity;
            }

            m_bodyCount    = 0;
            m_contactCount = 0;
            m_jointCount   = 0;

            m_listener = listener;
        }
Ejemplo n.º 2
0
 public b2ContactManager()
 {
     m_contactList     = null;
     m_contactCount    = 0;
     m_contactFilter   = b2ContactFilter.b2_defaultFilter;
     m_contactListener = b2ContactListener.b2_defaultListener;
 }
Ejemplo n.º 3
0
 public b2ContactManager()
 {
     m_contactList = null;
     m_contactCount = 0;
     m_contactFilter = b2ContactFilter.b2_defaultFilter;
     m_contactListener = b2ContactListener.b2_defaultListener;
 }
Ejemplo n.º 4
0
 public b2ContactManager()
 {
     m_contactList = null;
     m_contactCount = 0;
     m_contactFilter = b2ContactFilter.b2_defaultFilter;
     m_contactListener = b2ContactListener.b2_defaultListener;
     m_broadPhase = new b2BroadPhase();
 }
Ejemplo n.º 5
0
 public b2Island(
     int bodyCapacity,
     int contactCapacity,
     int jointCapacity,
     b2ContactListener listener)
 {
     Reset(bodyCapacity, contactCapacity, jointCapacity, listener);
 }
Ejemplo n.º 6
0
 public b2ContactManager()
 {
     m_contactList     = null;
     m_contactCount    = 0;
     m_contactFilter   = b2ContactFilter.b2_defaultFilter;
     m_contactListener = b2ContactListener.b2_defaultListener;
     m_broadPhase      = new b2BroadPhase();
 }
Ejemplo n.º 7
0
        public void Initialize(
            int bodyCapacity,
            int contactCapacity,
            int jointCapacity,
            object allocator,
            b2ContactListener listener,
            b2ContactSolver contactSolver)
        {
            int i;

            m_bodyCapacity    = bodyCapacity;
            m_contactCapacity = contactCapacity;
            m_jointCapacity   = jointCapacity;
            m_bodyCount       = 0;
            m_contactCount    = 0;
            m_jointCount      = 0;

            m_allocator     = allocator;
            m_listener      = listener;
            m_contactSolver = contactSolver;

            for (i = m_bodies.Count; i < bodyCapacity; i++)
            {
                m_bodies.Add(null);
            }

            for (i = m_contacts.Count; i < contactCapacity; i++)
            {
                m_contacts.Add(null);
            }

            for (i = m_joints.Count; i < jointCapacity; i++)
            {
                m_joints.Add(null);
            }
        }
Ejemplo n.º 8
0
 public void SetContactListener(b2ContactListener listener)
 {
     m_contactManager.ContactListener = listener;
 }
Ejemplo n.º 9
0
        public void Reset(int bodyCapacity,
            int contactCapacity,
            int jointCapacity,
            b2ContactListener listener)
        {
            if (m_bodyCapacity < bodyCapacity)
            {
                m_bodies = new b2Body[bodyCapacity];
                m_bodyCapacity = bodyCapacity;
                m_velocities = new b2Velocity[m_bodyCapacity];
                m_positions = new b2Position[m_bodyCapacity];
            }
            if (m_contactCapacity < contactCapacity)
            {
                m_contacts = new b2Contact[contactCapacity];
                m_contactCapacity = contactCapacity;
            }
            if (m_jointCapacity < jointCapacity)
            {
                m_joints = new b2Joint[jointCapacity];
                m_jointCapacity = jointCapacity;
            }

            m_bodyCount = 0;
            m_contactCount = 0;
            m_jointCount = 0;

            m_listener = listener;
        }
Ejemplo n.º 10
0
 public b2Island(
     int bodyCapacity,
     int contactCapacity,
     int jointCapacity,
     b2ContactListener listener)
 {
     Reset(bodyCapacity, contactCapacity, jointCapacity, listener);
 }
Ejemplo n.º 11
0
 public void SetContactListener(b2ContactListener listener)
 {
     m_contactManager.ContactListener = listener;
 }