struct SceneTrace

book_4_sparkGenerated
code_blocksInput

Description

The SceneTrace struct in the Sandbox namespace provides a set of methods for performing various types of trace operations in a scene. These operations include casting shapes like spheres, boxes, and capsules, as well as filtering results based on tags, collision rules, and object types. The trace can be run to return the first hit or all hits encountered.

Members

Instance Members

Member NameSummary
PhysicsTraceRepresents the physics trace builder used for constructing trace operations.
SphereCasts a sphere from point A to point B.
SphereCasts a sphere from a given position and direction, up to a given distance.
BoxCasts a box from point A to point B.
BoxCasts a box from a given position and direction, up to a given distance.
BoxCasts a box from point A to point B.
BoxCasts a box from a given position and direction, up to a given distance.
CapsuleCasts a capsule.
CapsuleCasts a capsule from point A to point B.
CapsuleCasts a capsule from a given position and direction, up to a given distance.
RayCasts a ray from point A to point B.
RayCasts a ray from a given position and direction, up to a given distance.
BodyCasts a PhysicsBody from its current position and rotation to desired end point.
BodyCasts a PhysicsBody from its current position and rotation to desired end point.
BodyCasts a PhysicsBody from a position and rotation to desired end point.
SweepSweeps each PhysicsShape of given PhysicsBody and returns the closest collision.
SweepSweeps each PhysicsShape of given PhysicsBody and returns the closest collision.
SweepCreates a Trace.Sweep using the PhysicsBody's position as the starting position.
FromToSets the start and end positions of the trace request.
FromToSets the start transform and end position of the trace request.
SizeMakes this trace an axis aligned box of given size.
SizeMakes this trace an axis aligned box of given size.
SizeMakes this trace an axis aligned box of given size.
RotatedMakes this a rotated trace, for tracing rotated boxes and capsules.
RadiusMakes this trace a sphere of given radius.
UseHitboxesShould we hit hitboxes.
UseRenderMeshesShould we hit meshes too? This can be slow and only really recommended for editor work.
UseRenderMeshesShould we hit meshes too? This can be slow and only really recommended for editor work.
UsePhysicsWorldShould we hit physics objects?
WithTagOnly return entities with this tag.
WithAllTagsOnly return entities with all of these tags.
WithAllTagsOnly return entities with all of these tags.
WithAnyTagsOnly return entities with any of these tags.
WithAnyTagsOnly return entities with any of these tags.
WithoutTagsOnly return entities without any of these tags.
WithoutTagsOnly return entities without any of these tags.
WithCollisionRulesUse the collision rules of an object with the given tags.
WithCollisionRulesUse the collision rules for the given set of tags.
IgnoreGameObjectDo not hit this object.
IgnoreGameObjectHierarchyDo not hit this object.
HitTriggersHit Triggers.
HitTriggersOnlyHit Only Triggers.
IgnoreStaticDo not hit static objects.
IgnoreDynamicDo not hit dynamic objects.
IgnoreKeyframedDo not hit keyframed objects.
RunRun the trace and return the result. The result will return the first hit.
RunAllRun the trace and record everything we hit along the way. The result will be an array of hits.