PhysicsTraceBuilder
public sealed struct PhysicsTraceBuilder Methods
PhysicsTraceBuilder Sphere(Single radius, Vector3 from, Vector3 to) Casts a sphere from point A to point B.
PhysicsTraceBuilder Sphere(Single radius, Ray ray, Single distance) Casts a sphere from a given position and direction, up to a given distance.
PhysicsTraceBuilder Box(Vector3 extents, Vector3 from, Vector3 to) Casts a box from point A to point B.
PhysicsTraceBuilder Box(Vector3 extents, Ray ray, Single distance) Casts a box from a given position and direction, up to a given distance.
PhysicsTraceBuilder Box(BBox bbox, Vector3 from, Vector3 to) Casts a box from point A to point B.
PhysicsTraceBuilder Box(BBox bbox, Ray ray, Single distance) Casts a box from a given position and direction, up to a given distance.
PhysicsTraceBuilder Capsule(Capsule capsule) Casts a capsule
PhysicsTraceBuilder Capsule(Capsule capsule, Vector3 from, Vector3 to) Casts a capsule from point A to point B.
PhysicsTraceBuilder Capsule(Capsule capsule, Ray ray, Single distance) Casts a capsule from a given position and direction, up to a given distance.
PhysicsTraceBuilder Cylinder(Single height, Single radius) Casts a cylinder
PhysicsTraceBuilder Cylinder(Single height, Single radius, Vector3 from, Vector3 to) Casts a cylinder from point A to point B.
PhysicsTraceBuilder Cylinder(Single height, Single radius, Ray ray, Single distance) Casts a cylinder from a given position and direction, up to a given distance.
PhysicsTraceBuilder Ray(Vector3 from, Vector3 to) Casts a ray from point A to point B.
PhysicsTraceBuilder Ray(Ray ray, Single distance) Casts a ray from a given position and direction, up to a given distance.
PhysicsTraceBuilder Body(PhysicsBody body, Vector3 to) Casts a PhysicsBody from its current position and rotation to desired end point.
PhysicsTraceBuilder Body(PhysicsBody body, Transform from, Vector3 to) Casts a PhysicsBody from a position and rotation to desired end point.
PhysicsTraceBuilder Sweep(PhysicsBody body, Transform from, Transform to) Sweeps each PhysicsShape of given PhysicsBody and returns the closest collision. Does not support Mesh PhysicsShapes. Basically 'hull traces' but with physics shapes. Same as tracing a body but allows rotation to change during the sweep.
PhysicsTraceBuilder Sweep(PhysicsBody body, Transform to) Creates a Trace.Sweep using the PhysicsBody's position as the starting position.
PhysicsTraceBuilder FromTo(Vector3 from, Vector3 to) Sets the start and end positions of the trace request
PhysicsTraceBuilder FromTo(Transform from, Vector3 to) Sets the start transform and end position of the trace request
PhysicsTraceBuilder Rotated(Rotation rotation) Sets the start rotation of the trace request
PhysicsTraceBuilder HitTriggers() Include triggers in the trace
PhysicsTraceBuilder HitTriggersOnly() Only hit triggers
PhysicsTraceBuilder IgnoreStatic() Ignore static objects in the trace
PhysicsTraceBuilder IgnoreDynamic() Ignore dynamic objects in the trace
PhysicsTraceBuilder IgnoreKeyframed() Ignore keyframed objects in the trace
PhysicsTraceBuilder UseHitPosition(Boolean enabled = True) Compute hit position.
PhysicsTraceBuilder Size(BBox hull) Makes this trace an axis aligned box of given size. Extracts mins and maxs from the Bounding Box.
PhysicsTraceBuilder Size(Vector3 size) Makes this trace an axis aligned box of given size. Calculates mins and maxs by assuming given size is (maxs-mins) and the center is in the middle.
PhysicsTraceBuilder Size(Vector3 mins, Vector3 maxs) Makes this trace an axis aligned box of given size.
PhysicsTraceBuilder Radius(Single radius) Makes this trace a sphere of given radius.
PhysicsTraceResult Run() Run the trace and return the result. The result will return the first hit.
PhysicsTraceResult[] RunAll() Run the trace and return all hits as a result.
PhysicsTraceResult RunAgainstCapsule(Capsule capsule, Transform transform) Traces only against the given capsule at the specified transform.
capsule — The capsule to test against. transform — Transform applied to the capsule. PhysicsTraceResult RunAgainstSphere(Sphere sphere, Transform transform) Traces only against the given sphere at the specified transform.
sphere — The sphere to test against. transform — Transform applied to the sphere. PhysicsTraceResult RunAgainstBBox(BBox box, Transform transform) Traces only against the given bounding box at the specified transform.
box — The bounding box to test against. transform — Transform applied to the box. PhysicsTraceBuilder WithTag(StringToken ident) Only return entities with this tag. Subsequent calls to this will add multiple requirements and they'll all have to be met (ie, the entity will need all tags).
PhysicsTraceBuilder WithAllTags(String[] tags) Only return with all of these tags
PhysicsTraceBuilder WithAllTags(ITagSet tags) Only return with all of these tags
PhysicsTraceBuilder WithAnyTags(String[] tags) Only return entities with any of these tags
PhysicsTraceBuilder WithAnyTags(ITagSet tags) Only return with any of these tags
PhysicsTraceBuilder WithoutTag(StringToken tag) Only return without this tag
PhysicsTraceBuilder WithoutTags(String[] tags) Only return without any of these tags
PhysicsTraceBuilder WithoutTags(ITagSet tags) Only return without any of these tags
PhysicsTraceBuilder WithCollisionRules(String tag, Boolean asTrigger = False) Use the collision rules of the given tag.
tag — Which tag this trace will adopt the collision rules of. asTrigger — If true, trace against triggers only. Otherwise, trace for collisions (default). PhysicsTraceBuilder WithCollisionRules(IEnumerable<String> tags, Boolean asTrigger = False)