internal void InternalColliderShapeReadd()
        {
            BepuSimulation bs = BepuSimulation.instance;

            // don't worry about switching if we are to be removed (or have been removed)
            if (InternalBody.Handle.Value == -1 || bs.ToBeRemoved.Contains(this))
            {
                return;
            }

            using (bs.simulationLocker.WriteLock())
            {
                // let's check handle again now that we are in the lock, just in case
                if (InternalBody.Handle.Value == -1)
                {
                    return;
                }

                // remove me with the old shape
                bs.internalSimulation.Bodies.Remove(InternalBody.Handle);
                BepuSimulation.RigidMappings.Remove(InternalBody.Handle.Value);

                // add me with the new shape
                bodyDescription.Collidable = ColliderShape.GenerateDescription(bs.internalSimulation, SpeculativeMargin);
                InternalBody.Handle        = bs.internalSimulation.Bodies.Add(bodyDescription);
                BepuSimulation.RigidMappings[InternalBody.Handle.Value] = this;
            }
        }
예제 #2
0
            public bool LoopBody(CollidableReference reference)
            {
                BepuPhysicsComponent bpc = BepuSimulation.getFromReference(reference);

                if (((uint)bpc.CollisionGroup & lookingFor) != 0)
                {
                    components.Add(bpc);
                }
                return(true);
            }