![]() |
Jumpvalley 0.5.0
An app and library that can be used to test and run 3D platformer levels. Currently being made with Godot.
|
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...
Public Types | |
enum | SweepOrder { LeftToRight , RightToLeft , CenterLeftRight , CenterRightLeft } |
List of possible orders in which RaycastSweep can iterate over its raycasts when PerformSweep is called. More... | |
Public Member Functions | |
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. | |
Properties | |
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.
List of possible orders in which RaycastSweep can iterate over its raycasts when PerformSweep is called.
|
inline |
Creates a new RaycastSweep with the given raycast count, starting position, and ending position.
numRaycasts | |
startPosition | |
endPosition |
|
inline |
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.
order | The order in which to run through the raycasts |