Class NavigationMeshBuildUtils
- Namespace
- Stride.Navigation
- Assembly
- Stride.Navigation.dll
Utility function for navigation mesh building
public class NavigationMeshBuildUtils
- Inheritance
-
NavigationMeshBuildUtils
Methods
BuildPlanePoints(ref Plane, float, out Vector3[], out int[])
Generates vertices and indices for an infinite size, limited by the parameter
public static void BuildPlanePoints(ref Plane plane, float size, out Vector3[] points, out int[] inds)
Parameters
plane
Planesize
floatthe amount from the origin the plane points are placed
points
Vector3[]inds
int[]
CalculateTileBoundingBox(NavigationMeshBuildSettings, Point)
public static BoundingBox CalculateTileBoundingBox(NavigationMeshBuildSettings settings, Point tileCoord)
Parameters
settings
NavigationMeshBuildSettingstileCoord
Point
Returns
CheckColliderFilter(StaticColliderComponent, CollisionFilterGroupFlags)
Checks if a static collider passes the given filter group
public static bool CheckColliderFilter(StaticColliderComponent collider, CollisionFilterGroupFlags includedCollisionGroups)
Parameters
collider
StaticColliderComponentThe collider to check
includedCollisionGroups
CollisionFilterGroupFlagsThe collision filter
Returns
- bool
true
if the collider passes the filter,false
otherwise
ExtendBoundingBox(ref BoundingBox, Vector3)
Applies an offset vector to a bounding box to make it bigger or smaller
public static void ExtendBoundingBox(ref BoundingBox boundingBox, Vector3 offsets)
Parameters
boundingBox
BoundingBoxoffsets
Vector3
GenerateTangentBinormal(Vector3, out Vector3, out Vector3)
Generates a random tangent and binormal for a given normal, usefull for creating plane vertices or orienting objects (lookat) where the rotation along the normal doesn't matter
public static void GenerateTangentBinormal(Vector3 normal, out Vector3 tangent, out Vector3 binormal)
Parameters
GetOverlappingTiles(NavigationMeshBuildSettings, BoundingBox)
Check which tiles overlap a given bounding box
public static List<Point> GetOverlappingTiles(NavigationMeshBuildSettings settings, BoundingBox boundingBox)
Parameters
settings
NavigationMeshBuildSettingsboundingBox
BoundingBox
Returns
HasLatestColliderShape(StaticColliderComponent)
Checks if a static collider has latest collider shape
public static bool HasLatestColliderShape(StaticColliderComponent collider)
Parameters
collider
StaticColliderComponentThe collider to check
Returns
- bool
true
if the collider has latest collider shape,false
otherwise
HashEntityCollider(StaticColliderComponent, CollisionFilterGroupFlags)
Hashes and entity's transform and it's collider shape settings
public static int HashEntityCollider(StaticColliderComponent collider, CollisionFilterGroupFlags includedCollisionGroups)
Parameters
collider
StaticColliderComponentThe collider to hash
includedCollisionGroups
CollisionFilterGroupFlagsThe filter group for active collides, which is used to hash if this colliders participates in the navigation mesh build
Returns
SnapBoundingBoxToCellHeight(NavigationMeshBuildSettings, ref BoundingBox)
Snaps a BoundingBox's height according to the given NavigationMeshBuildSettings
public static void SnapBoundingBoxToCellHeight(NavigationMeshBuildSettings settings, ref BoundingBox boundingBox)
Parameters
settings
NavigationMeshBuildSettingsThe build settings
boundingBox
BoundingBoxReference to the bounding box to snap