Пример #1
0
        public MobilityHitHandler(CollidableMobility mobilityFilter)
        {
            Collidable = default;
            T          = float.MaxValue;
            Normal     = default;
            Hit        = false;
            ChildIndex = 0;

            MobilityFilter = mobilityFilter;
        }
Пример #2
0
 internal static bool CanCollide(int source, CollidableMobility sourcemob, int target, CollidableMobility targetmob)
 {
     return(((uint)getFromHandle(source, sourcemob).CollisionGroup & (uint)getFromHandle(target, targetmob).CanCollideWith) != 0);
 }
Пример #3
0
 public static BepuPhysicsComponent getFromHandle(int handle, CollidableMobility mobility)
 {
     return(mobility == CollidableMobility.Static ? (BepuPhysicsComponent)StaticMappings[handle] : (BepuPhysicsComponent)RigidMappings[handle]);
 }
Пример #4
0
 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.");
 }
Пример #5
0
 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;
 }