Ejemplo n.º 1
0
        private void IntegrateVelocity(TFRigidbody b, Fix dt)
        {
            // If the body is static, don't move it.
            if (b.bodyType == TFBodyType.Static)
            {
                return;
            }
            AABB    oldAABB = b.bounds;
            FixVec2 offset  = b.info.velocity * dt;

            b.Position      += offset;
            b.info.rotation += b.info.angularVelocity * dt;
            b.SetRotation(b.info.rotation);
            IntegrateForces(b, dt);

            // Update the dynamic tree (for Broad Phase).
            AABB sweptAABB = AABB.Union(b.bounds, oldAABB);

            MoveProxy(b.ProxyID, sweptAABB, offset);
        }