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

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

Casts a convex shape against the collidable.
public ConvexCast ( ConvexShapes castShape, RigidTransform &startingTransform, System.Vector3 &sweep, bool>.Func filter, RayCastResult &result ) : bool
castShape ConvexShapes Shape to cast.
startingTransform BEPUutilities.RigidTransform Initial transform of the shape.
sweep System.Vector3 Sweep to apply to the shape.
filter bool>.Func Test to apply to the entry. If it returns true, the entry is processed, otherwise the entry is ignored. If a collidable hierarchy is present /// in the entry, this filter will be passed into inner ray casts.
result RayCastResult Hit data, if any.
Результат bool
        public bool ConvexCast(ConvexShapes.ConvexShape castShape, ref RigidTransform startingTransform, ref Vector3 sweep, Func<BroadPhaseEntry, bool> filter, out RayCastResult result)
        {
            var outputOverlappedElements = PhysicsResources.GetCollidableList();
            BoundingBox boundingBox;
            castShape.GetSweptBoundingBox(ref startingTransform, ref sweep, out boundingBox);

            CollidableTree.GetOverlaps(boundingBox, outputOverlappedElements);
            result = new RayCastResult();
            result.HitData.T = float.MaxValue;
            for (int i = 0; i < outputOverlappedElements.Count; ++i)
            {
                RayHit hit;
                if (outputOverlappedElements.Elements[i].ConvexCast(castShape, ref startingTransform, ref sweep, filter, out hit))
                {
                    if (hit.T < result.HitData.T)
                    {
                        result.HitData = hit;
                        result.HitObject = outputOverlappedElements.Elements[i];
                    }
                }
            }
            PhysicsResources.GiveBack(outputOverlappedElements);
            return result.HitData.T < float.MaxValue;
        }

Same methods

StaticGroupShape::ConvexCast ( ConvexShapes castShape, RigidTransform &startingTransform, System.Vector3 &sweep, RayCastResult &result ) : bool