public MobilityHitHandler(CollidableMobility mobilityFilter) { Collidable = default; T = float.MaxValue; Normal = default; Hit = false; ChildIndex = 0; MobilityFilter = mobilityFilter; }
internal static bool CanCollide(int source, CollidableMobility sourcemob, int target, CollidableMobility targetmob) { return(((uint)getFromHandle(source, sourcemob).CollisionGroup & (uint)getFromHandle(target, targetmob).CanCollideWith) != 0); }
public static BepuPhysicsComponent getFromHandle(int handle, CollidableMobility mobility) { return(mobility == CollidableMobility.Static ? (BepuPhysicsComponent)StaticMappings[handle] : (BepuPhysicsComponent)RigidMappings[handle]); }
public CollidableReference(CollidableMobility mobility, BodyHandle handle) : this(mobility, handle.Value) { Debug.Assert(mobility == CollidableMobility.Dynamic || mobility == CollidableMobility.Kinematic, "Creating a collidable reference associated with a body requires a body-related mobility."); }
internal CollidableReference(CollidableMobility mobility, int handle) { Debug.Assert((int)mobility >= 0 && (int)mobility <= 2, "Hey you, that mobility type doesn't exist. Or we changed something and this needs to be updated."); Debug.Assert(handle >= 0 && handle < 1 << 30, "Do you actually have more than 2^30 collidables? That seems unlikely."); Packed = ((uint)mobility << 30) | (uint)handle; }