Example #1
0
        internal void Synchronize(BroadPhase broadPhase, Transform transform1, Transform transform2)           //broadphase was pointer
        {
            if (m_proxies.Count() == 0)
            {
                return;
            }

            for (int i = 0; i < m_proxies.Count(); ++i)
            {
                FixtureProxy proxy = m_proxies[i];

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

                proxy.aabb.Combine(aabb1, aab);

                Vec2 displacement = transform2.p - transform1.p;

                broadPhase.MoveProxy(proxy.proxyId, proxy.aabb, displacement);
            }
        }
Example #2
0
        internal void Synchronize(BroadPhase broadPhase, ref Transform transform1, ref Transform transform2)
        {
            if (_proxyCount == 0)
            {
                return;
            }

            for (int i = 0; i < _proxyCount; ++i)
            {
                FixtureProxy proxy = _proxies[i];

                // Compute an AABB that covers the swept Shape (may miss some rotation effect).
                AABB 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);

                Vector2 displacement = transform2.Position - transform1.Position;

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