Infohazard.HyperNav 1.1.5
3D Navigation for Flying Characters
|
A volume of space in which HyperNav pathfinding can occur. More...
Classes | |
class | PropNames |
This is used to refer to the names of private fields in this class from a custom Editor. More... | |
Public Member Functions | |
virtual bool | SamplePosition (Vector3 position, out NavHit hit, float maxDistance) |
Perform a query to find the nearest point on this volume to the given point. More... | |
bool | Raycast (Vector3 start, Vector3 end, out float hit) |
Cast a ray against the blocking triangles of the volume, and return the nearest hit. More... | |
void | UpdateTransform () |
Update the native data of this NavVolume. More... | |
Static Public Member Functions | |
static void | UpdateAllTransforms () |
Update the native data on all loaded NavVolumes. More... | |
Static Public Attributes | |
static NativeParallelHashMap< long, NativeNavVolumeData > | VolumeData |
Data for all loaded volumes in the format used by jobs. More... | |
Protected Member Functions | |
virtual void | OnEnable () |
Register this volume in the Volumes dictionary and perform initialization. More... | |
virtual void | OnDisable () |
Remove this volume from the Volumes dictionary. More... | |
virtual void | OnDestroy () |
Dispose native-side data for this volume. More... | |
virtual void | Update () |
Update UniqueID in editor, and check movement. More... | |
Properties | |
Bounds | Bounds [get, set] |
The boundaries of the volume. More... | |
NavVolumeData | Data [get, set] |
The baked data for the volume. More... | |
long | InstanceID [get] |
The unique ID for this volume to identify it in pathfinding jobs and serialized data. More... | |
bool | AutoDetectMovement [get, set] |
Whether to automatically update native data if the volume moves. More... | |
float | VoxelSize [get, set] |
The voxel size of this volume, which determines the precision but also baking cost. More... | |
float | MaxAgentRadius [get, set] |
The maximum size of agents using this volume. More... | |
bool | EnableMultiQuery [get, set] |
Whether to enable multiple physics queries per voxel to get a more accurate result. More... | |
float | MaxExternalLinkDistance [get, set] |
The maximum distance that external links can extend outside of this volume. More... | |
LayerMask | BlockingLayers [get, set] |
Which layers are considered impassible for pathfinding. More... | |
bool | StaticOnly [get, set] |
Whether only static objects should be included in the baked data. More... | |
bool | UseStartLocations [get, set] |
Whether only regions connected to certain locations are considered valid. More... | |
IReadOnlyList< Vector3 > | StartLocations [get, set] |
If _useStartLocations is true, which start locations to use. More... | |
bool | UseMultithreading [get, set] |
Whether to use multiple threads when baking the volume. More... | |
NavVolumeVisualizationMode | VisualizationMode [get, set] |
Stage at which to visualize the volume bake process in the scene view. More... | |
bool | VisualizeNeighbors [get, set] |
Whether to show the connections of a selected region in the scene view. More... | |
int | VisualizeNeighborsRegion [get, set] |
If _visualizeNeighbors is true, which region to visualize in the scene view. More... | |
bool | ShowVertexNumbers [get, set] |
Whether to show the vertex numbers of the preview mesh in the scene view (for debugging). More... | |
float | ShowVertexNumbersRange [get, set] |
Max distance from the camera at which vertex numbers will be shown. More... | |
bool | VisualizeVoxelQueries [get, set] |
Whether to visualize the queries that are performed for a voxel when baking. More... | |
static int | VolumeChangingCount [get, private set] |
Number of places that are modifying volume data. More... | |
static IReadOnlyDictionary< long, NavVolume > | Volumes [get] |
All currently loaded volumes. More... | |
Events | |
static Action | VolumeDataChanging |
Event that is invoked immediately before active volume data changes. More... | |
static Action | VolumeDataChanged |
Event that is invoked immediately after active volume data changes. More... | |
Private Attributes | |
Bounds | _bounds = new Bounds(Vector3.zero, Vector3.one) |
(Serialized) The boundaries of the volume. More... | |
NavVolumeData | _data |
(Serialized) The baked data for the volume. More... | |
long | _instanceID |
(Serialized) The unique ID for this volume to identify it in pathfinding jobs and serialized data. More... | |
bool | _autoDetectMovement = false |
(Serialized) Whether to automatically update native data if the volume moves. More... | |
LayerMask | _blockingLayers = 1 |
(Serialized) Which layers are considered impassible for pathfinding. More... | |
bool | _staticOnly = true |
(Serialized) Whether only static objects should be included in the baked data. More... | |
float | _maxAgentRadius = 1 |
(Serialized) The maximum size of agents using this volume. More... | |
bool | _enableMultiQuery = true |
(Serialized) Whether to enable multiple physics queries per voxel to get a more accurate result. More... | |
float | _maxExternalLinkDistance = 1 |
(Serialized) The maximum distance that external links can extend outside of this volume. More... | |
float | _voxelSize = 1 |
(Serialized) The voxel size of this volume, which determines the precision but also baking cost. More... | |
bool | _useStartLocations = false |
(Serialized) Whether only regions connected to certain locations are considered valid. More... | |
Vector3[] | _startLocations |
(Serialized) If _useStartLocations is true, which start locations to use. More... | |
bool | _useMultithreading = true |
(Serialized) Whether to use multiple threads when baking the volume. More... | |
NavVolumeVisualizationMode | _visualizationMode = NavVolumeVisualizationMode.Final |
(Serialized) Stage at which to visualize the volume bake process in the scene view. More... | |
bool | _visualizeNeighbors |
(Serialized) Whether to show the connections of a selected region in the scene view. More... | |
int | _visualizeNeighborsRegion |
(Serialized) If _visualizeNeighbors is true, which region to visualize in the scene view. More... | |
bool | _showVertexNumbers |
(Serialized) Whether to show the vertex numbers of the preview mesh in the scene view (for debugging). More... | |
float | _showVertexNumbersRange = 2 |
(Serialized) Max distance from the camera at which vertex numbers will be shown. More... | |
bool | _visualizeVoxelQueries |
(Serialized) Whether to visualize the queries that are performed for a voxel when baking. More... | |
A volume of space in which HyperNav pathfinding can occur.
Each NavVolume is divided into convex regions that form pathfinding nodes. A volume's regions can have connections to each other, and to regions of other volumes. The information in a NavVolume must be baked in the editor - it cannot be calculated at runtime (for now).
|
protectedvirtual |
Dispose native-side data for this volume.
|
protectedvirtual |
Remove this volume from the Volumes dictionary.
|
protectedvirtual |
Register this volume in the Volumes dictionary and perform initialization.
bool Infohazard.HyperNav.NavVolume.Raycast | ( | Vector3 | start, |
Vector3 | end, | ||
out float | hit | ||
) |
Cast a ray against the blocking triangles of the volume, and return the nearest hit.
start | The position (in world space) to start the query at. |
end | The position (in world space) to end the query at. |
hit | If the query hits a triangle, the ratio between start and end at which the hit occurred. |
|
virtual |
Perform a query to find the nearest point on this volume to the given point.
position | The point at which to search. |
hit | The resulting hit, containing the nearest point on this volume. |
maxDistance | The radius in which to search (a larger value is more expensive). |
|
protectedvirtual |
Update UniqueID in editor, and check movement.
|
static |
Update the native data on all loaded NavVolumes.
Use this after moving all volumes when AutoDetectMovement is disabled.
void Infohazard.HyperNav.NavVolume.UpdateTransform | ( | ) |
Update the native data of this NavVolume.
This is called automatically if AutoDetectMovement is enabled.
|
private |
(Serialized) Whether to automatically update native data if the volume moves.
|
private |
(Serialized) Which layers are considered impassible for pathfinding.
(Serialized) The boundaries of the volume.
|
private |
(Serialized) The baked data for the volume.
|
private |
(Serialized) Whether to enable multiple physics queries per voxel to get a more accurate result.
|
private |
(Serialized) The unique ID for this volume to identify it in pathfinding jobs and serialized data.
|
private |
(Serialized) The maximum size of agents using this volume.
|
private |
(Serialized) The maximum distance that external links can extend outside of this volume.
|
private |
(Serialized) Whether to show the vertex numbers of the preview mesh in the scene view (for debugging).
|
private |
(Serialized) Max distance from the camera at which vertex numbers will be shown.
|
private |
(Serialized) If _useStartLocations is true, which start locations to use.
|
private |
(Serialized) Whether only static objects should be included in the baked data.
|
private |
(Serialized) Whether to use multiple threads when baking the volume.
|
private |
(Serialized) Whether only regions connected to certain locations are considered valid.
|
private |
(Serialized) Stage at which to visualize the volume bake process in the scene view.
|
private |
(Serialized) Whether to show the connections of a selected region in the scene view.
|
private |
(Serialized) If _visualizeNeighbors is true, which region to visualize in the scene view.
|
private |
(Serialized) Whether to visualize the queries that are performed for a voxel when baking.
|
private |
(Serialized) The voxel size of this volume, which determines the precision but also baking cost.
|
static |
Data for all loaded volumes in the format used by jobs.
|
getset |
Whether to automatically update native data if the volume moves.
Note that if this is true and the volume moves every frame, pathfinding will never be able to occur.
|
getset |
Which layers are considered impassible for pathfinding.
|
getset |
The boundaries of the volume.
This cannot be set while the game is running.
|
getset |
The baked data for the volume.
This cannot be set while the game is running.
|
getset |
Whether to enable multiple physics queries per voxel to get a more accurate result.
|
get |
The unique ID for this volume to identify it in pathfinding jobs and serialized data.
|
getset |
The maximum size of agents using this volume.
|
getset |
The maximum distance that external links can extend outside of this volume.
|
getset |
Whether to show the vertex numbers of the preview mesh in the scene view (for debugging).
|
getset |
Max distance from the camera at which vertex numbers will be shown.
|
getset |
If _useStartLocations is true, which start locations to use.
|
getset |
Whether only static objects should be included in the baked data.
|
getset |
Whether to use multiple threads when baking the volume.
This should only be turned off for debugging.
|
getset |
Whether only regions connected to certain locations are considered valid.
This can be used to exclude certain regions from a volume, such as regions that are outside reachable area.
|
getset |
Stage at which to visualize the volume bake process in the scene view.
|
getset |
Whether to show the connections of a selected region in the scene view.
|
getset |
If _visualizeNeighbors is true, which region to visualize in the scene view.
|
getset |
Whether to visualize the queries that are performed for a voxel when baking.
|
staticgetprivate set |
Number of places that are modifying volume data.
|
staticget |
All currently loaded volumes.
|
getset |
The voxel size of this volume, which determines the precision but also baking cost.
|
static |
Event that is invoked immediately after active volume data changes.
|
static |
Event that is invoked immediately before active volume data changes.