Ejemplo n.º 1
0
        public virtual void Synchronize(b2BroadPhase broadPhase, ref b2Transform transform1, ref b2Transform transform2)
        {
            if (m_proxyCount == 0)
            {
                return;
            }

            for (int i = 0, count = m_proxyCount; i < count; ++i)
            {
                b2FixtureProxy proxy = m_proxies[i];

                // Compute an AABB that covers the swept shape (may miss some rotation effect).
                b2AABB aabb1, aabb2;
                Shape.ComputeAABB(out aabb1, ref transform1, proxy.childIndex);
                Shape.ComputeAABB(out aabb2, ref transform2, proxy.childIndex);

                proxy.aabb.Combine(ref aabb1, ref aabb2);

                b2Vec2 displacement;
                displacement.x = transform2.p.x - transform1.p.x;
                displacement.y = transform2.p.y - transform1.p.y;

                broadPhase.MoveProxy(proxy.proxyId, ref proxy.aabb, ref displacement);
            }
        }
Ejemplo n.º 2
0
        public virtual void Synchronize(b2BroadPhase broadPhase, b2Transform transform1, b2Transform transform2)
        {
            if (m_proxyCount == 0)
            {
                return;
            }

            for (int i = 0; i < m_proxyCount; ++i)
            {
                b2FixtureProxy proxy = m_proxies[i];

                // Compute an AABB that covers the swept shape (may miss some rotation effect).
                b2AABB aabb1, aabb2;
                aabb1 = m_shape.ComputeAABB(transform1, proxy.childIndex);
                aabb2 = m_shape.ComputeAABB(transform2, proxy.childIndex);

                proxy.aabb.Combine(aabb1, aabb2);

                b2Vec2 displacement = transform2.p - transform1.p;

                broadPhase.MoveProxy(proxy.proxyId, proxy.aabb, displacement);
            }
        }
Ejemplo n.º 3
0
        public virtual void Synchronize(b2BroadPhase broadPhase, b2Transform transform1, b2Transform transform2)
        {
            if (m_proxyCount == 0)
            {
                return;
            }

            for (int i = 0; i < m_proxyCount; ++i)
            {
                b2FixtureProxy proxy = m_proxies[i];

                // Compute an AABB that covers the swept shape (may miss some rotation effect).
                b2AABB aabb1, aabb2;
                aabb1 = m_shape.ComputeAABB(transform1, proxy.childIndex);
                aabb2 = m_shape.ComputeAABB(transform2, proxy.childIndex);

                proxy.aabb.Combine(aabb1, aabb2);

                b2Vec2 displacement = transform2.p - transform1.p;

                broadPhase.MoveProxy(proxy.proxyId, proxy.aabb, displacement);
            }
        }
Ejemplo n.º 4
0
        public virtual void Synchronize(b2BroadPhase broadPhase, ref b2Transform transform1, ref b2Transform transform2)
        {
            if (m_proxyCount == 0)
            {
                return;
            }

            for (int i = 0, count = m_proxyCount; i < count; ++i)
            {
                b2FixtureProxy proxy = m_proxies[i];

                // Compute an AABB that covers the swept shape (may miss some rotation effect).
                b2AABB aabb1, aabb2;
                Shape.ComputeAABB(out aabb1, ref transform1, proxy.childIndex);
                Shape.ComputeAABB(out aabb2, ref transform2, proxy.childIndex);

                proxy.aabb.Combine(ref aabb1, ref aabb2);

                b2Vec2 displacement;
                displacement.x = transform2.p.x - transform1.p.x;
                displacement.y = transform2.p.y - transform1.p.y;

                broadPhase.MoveProxy(proxy.proxyId, ref proxy.aabb, ref displacement);
            }
        }