public void Execute(ref ModifiableBodyPair pair) { Assert.AreNotEqual(pair.BodyIndices.BodyAIndex, pair.BodyIndices.BodyBIndex); Assert.AreEqual(pair.Entities.EntityA, Bodies[pair.BodyIndices.BodyAIndex].Entity); Assert.AreEqual(pair.Entities.EntityB, Bodies[pair.BodyIndices.BodyBIndex].Entity); Assert.AreEqual(pair.Entities.EntityA.Version, 1); Assert.AreEqual(pair.Entities.EntityB.Version, 1); }
public unsafe void Execute(ref ModifiableBodyPair pair) { // Disable the pair if it's dynamic-dynamic bool isDynamicDynamic = pair.BodyIndexA < NumDynamicBodies && pair.BodyIndexB < NumDynamicBodies; if (isDynamicDynamic) { pair.Disable(); } }
public unsafe void Execute(ref ModifiableBodyPair pair) { // Disable the pair if it's dynamic-static bool isDynamicStatic = (pair.BodyIndexA < NumDynamicBodies && pair.BodyIndexB >= NumDynamicBodies) || (pair.BodyIndexB < NumDynamicBodies && pair.BodyIndexA >= NumDynamicBodies); if (isDynamicStatic) { pair.Disable(); } }
public unsafe void Execute(ref ModifiableBodyPair pair) { // Disable the pair if a box collides with a static object int indexA = pair.BodyIndices.BodyAIndex; int indexB = pair.BodyIndices.BodyBIndex; if (DisableGroup.HasComponent(Bodies[indexA].Entity) || DisableGroup.HasComponent(Bodies[indexB].Entity)) { pair.Disable(); } }
public unsafe void Execute(ref ModifiableBodyPair pair) { // Disable the pair if a box collides with a static object int indexA = pair.BodyIndexA; int indexB = pair.BodyIndexB; if ((Bodies[indexA].Collider != null && Bodies[indexA].Collider.Value.Type == ColliderType.Box && indexB >= Motions.Length) || (Bodies[indexB].Collider != null && Bodies[indexB].Collider.Value.Type == ColliderType.Box && indexA >= Motions.Length)) { pair.Disable(); } }
public unsafe void Execute(ref ModifiableBodyPair pair) { Entity entityA = pair.Entities.EntityA; Entity entityB = pair.Entities.EntityB; if (entityA != entityB) { bool isAPassThrough = PassThroughGroup.Exists(entityA); bool isBPassThrough = PassThroughGroup.Exists(entityB); bool disableA = false; bool disableB = false; if (isAPassThrough) { Unity.Physics.RigidBody passThroughRigidBody = Bodies[pair.BodyIndices.BodyAIndex]; Unity.Physics.RigidBody colliderRigidBody = Bodies[pair.BodyIndices.BodyBIndex]; disableA = PassThroughSolid(ref entityA, ref entityB, ref PassThroughGroup, ref passThroughRigidBody, ref colliderRigidBody); } if (isBPassThrough) { Unity.Physics.RigidBody passThroughRigidBody = Bodies[pair.BodyIndices.BodyBIndex]; Unity.Physics.RigidBody colliderRigidBody = Bodies[pair.BodyIndices.BodyAIndex]; disableB = PassThroughSolid(ref entityB, ref entityA, ref PassThroughGroup, ref passThroughRigidBody, ref colliderRigidBody); } if (disableA || disableB) { pair.Disable(); } } }
public void Execute(ref ModifiableBodyPair pair) { Assert.AreNotEqual(pair.BodyIndexA, pair.BodyIndexB); Assert.AreEqual(pair.EntityA, Bodies[pair.BodyIndexA].Entity); Assert.AreEqual(pair.EntityB, Bodies[pair.BodyIndexB].Entity); }