Jumpvalley 0.5.0
An app and library that can be used to test and run 3D platformer levels. Currently being made with Godot.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Properties | List of all members
Jumpvalley.Raycasting.RaycastSweep Class Reference

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...

Inheritance diagram for Jumpvalley.Raycasting.RaycastSweep:

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.
 

Public Attributes

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.
 

Properties

List< RayCast3D > Raycasts [get]
 The raycasts being used by the RaycastSweep.
 

Detailed Description

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.

Member Enumeration Documentation

◆ 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)

Constructor & Destructor Documentation

◆ RaycastSweep()

Jumpvalley.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

Member Function Documentation

◆ PerformSweep()

RaycastSweepResult Jumpvalley.Raycasting.RaycastSweep.PerformSweep ( SweepOrder order)
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.

Parameters
orderThe 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: