Ejemplo n.º 1
0
        protected override Body[] OnVolumeCast(Box box, int contactGroup)
        {
            Vec3 origin      = box.Center;
            Vec3 halfExtents = box.Extents;
            Quat rotation    = box.Axis.ToQuat();

            int shapeCount = PhysXNativeScene.OverlapOBBShapes(nativeScene, ref origin, ref halfExtents, ref rotation,
                                                               GetContactGroupMask(contactGroup));

            if (shapeCount == 0)
            {
                return(emptyVolumeCastResult);
            }
            return(GetBodiesFromVolumeCastResult(shapeCount));
        }
Ejemplo n.º 2
0
        protected override Body[] OnVolumeCast(Bounds bounds, int contactGroup)
        {
            Vec3 origin      = bounds.GetCenter();
            Vec3 halfExtents = bounds.GetSize() * .5f;
            Quat rotation    = Quat.Identity;

            int shapeCount = PhysXNativeScene.OverlapOBBShapes(nativeScene, ref origin, ref halfExtents, ref rotation,
                                                               GetContactGroupMask(contactGroup));

            if (shapeCount == 0)
            {
                return(emptyVolumeCastResult);
            }
            return(GetBodiesFromVolumeCastResult(shapeCount));
        }