BEPUphysics.Space.ConvexCast C# (CSharp) Метод

ConvexCast() публичный Метод

Casts a convex shape against the space.

Convex casts are sensitive to length; avoid extremely long convex casts for better stability and performance.

public ConvexCast ( ConvexShape castShape, RigidTransform &startingTransform, System.Vector3 &sweep, bool>.Func filter, IList outputCastResults ) : bool
castShape BEPUphysics.CollisionShapes.ConvexShapes.ConvexShape Shape to cast.
startingTransform BEPUutilities.RigidTransform Initial transform of the shape.
sweep System.Vector3 Sweep to apply to the shape. Avoid extremely long convex casts for better stability and performance.
filter bool>.Func Delegate to prune out hit candidates before performing a cast against them. Return true from the filter to process an entry or false to ignore the entry.
outputCastResults IList Hit data, if any.
Результат bool
        public bool ConvexCast(ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, IList<RayCastResult> outputCastResults)
        {
            var overlappedElements = PhysicsResources.GetBroadPhaseEntryList();
            BoundingBox boundingBox;
            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);

            BroadPhase.QueryAccelerator.GetEntries(boundingBox, overlappedElements);
            for (int i = 0; i < overlappedElements.Count; ++i)
            {
                RayHit hit;
                if (overlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, filter, out hit))
                {
                    outputCastResults.Add(new RayCastResult { HitData = hit, HitObject = overlappedElements.Elements[i] });
                }
            }
            PhysicsResources.GiveBack(overlappedElements);
            return outputCastResults.Count > 0;
        }

Same methods

Space::ConvexCast ( ConvexShape castShape, RigidTransform &startingTransform, System.Vector3 &sweep, bool>.Func filter, RayCastResult &castResult ) : bool
Space::ConvexCast ( ConvexShape castShape, RigidTransform &startingTransform, System.Vector3 &sweep, IList outputCastResults ) : bool
Space::ConvexCast ( ConvexShape castShape, RigidTransform &startingTransform, System.Vector3 &sweep, RayCastResult &castResult ) : bool