Sweeps over a region of 3D space using a series of equally-spaced-out raycasts.
The center raycast, being located in the middle (or close to it), is assigned to the greatest integer that's less than or equal to the median index. "index" here refers to the numerical index that a raycast is located in within a raycast sweep from left to right.
More...
|
| | RaycastSweep (int numRaycasts, Vector3 startPosition, Vector3 endPosition, float raycastLength) |
| | Creates a new RaycastSweep with the given raycast count, starting position, and ending position.
|
|
void | UpdateRaycastLayout () |
| | Updates the number of raycasts, the positioning of the raycasts, and the length of the raycasts based on the current values of NumRaycasts, RaycastLength, StartPosition, and EndPosition.
|
| RaycastSweepResult | PerformSweep (SweepOrder order) |
| | Runs through the raycasts in Raycasts in the order specified.
This returns raycast collision information about the first raycast in Raycasts that got collided with.
Because multiple raycasts in the raycast sweep could be colliding with something at the same time, whichever counts as the "first" raycast to hit something depends on the SweepOrder specified in order .
If no raycast in Raycasts is currently hitting something, this method returns null.
|
|
new void | Dispose () |
| | Disposes of this RaycastSweep, including its raycasts.
|
|
|
int | NumRaycasts |
| | The total number of raycasts that the raycast sweep will perform from the start position to the end position.
|
|
float | RaycastLength |
| | The length in meters that each raycast in the RaycastSweep should extend in the relative Z-axis of this Node3D
|
|
Vector3 | StartPosition |
| | The starting position of the raycast sweep. This position is relative to the position of this Node3D and is where the first raycast will begin.
|
|
Vector3 | EndPosition |
| | The ending position of the raycast sweep. This position is relative to the position of this Node3D and is where the last raycast will begin.
|
|
|
List< RayCast3D > | Raycasts [get] |
| | The raycasts being used by the RaycastSweep.
|
Sweeps over a region of 3D space using a series of equally-spaced-out raycasts.
The center raycast, being located in the middle (or close to it), is assigned to the greatest integer that's less than or equal to the median index. "index" here refers to the numerical index that a raycast is located in within a raycast sweep from left to right.
◆ SweepOrder
List of possible orders in which RaycastSweep can iterate over its raycasts when PerformSweep is called.
| Enumerator |
|---|
| LeftToRight | Sweep from left to right.
|
| RightToLeft | Sweep from right to left.
|
| CenterLeftRight | Sweep starting from the center. Then go from left to right (excluding the center raycast)
|
| CenterRightLeft | Sweep starting from the center. Then go from right to left (excluding the center raycast)
|
◆ RaycastSweep()
| UTheCat.Jumpvalley.Core.Raycasting.RaycastSweep.RaycastSweep |
( |
int | numRaycasts, |
|
|
Vector3 | startPosition, |
|
|
Vector3 | endPosition, |
|
|
float | raycastLength ) |
|
inline |
Creates a new RaycastSweep with the given raycast count, starting position, and ending position.
- Parameters
-
| numRaycasts | |
| startPosition | |
| endPosition | |
◆ PerformSweep()
Runs through the raycasts in Raycasts in the order specified.
This returns raycast collision information about the first raycast in Raycasts that got collided with.
Because multiple raycasts in the raycast sweep could be colliding with something at the same time, whichever counts as the "first" raycast to hit something depends on the SweepOrder specified in order .
If no raycast in Raycasts is currently hitting something, this method returns null.
- Parameters
-
| order | The order in which to run through the raycasts |
- Returns
- The results of this raycast operation
The documentation for this class was generated from the following file: