Class ScyllaLooseQuadtreeUtil
Static utility methods for projecting 3D coordinates and building ScyllaAABB2 instances for use with the loose quadtree. All methods are pure math operations compatible with Burst compilation.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public static class ScyllaLooseQuadtreeUtil
Remarks
These helpers are consumed internally by the 3D overloads on ScyllaLooseQuadtree and are also publicly available for callers that build input data before querying.
Methods
Project(float3, ScyllaQuadtreePlane)
Projects a 3D point to a 2D point by discarding the axis not relevant to plane.
Declaration
public static float2 Project(float3 v, ScyllaQuadtreePlane plane)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | v | The 3D world-space point to project. |
| ScyllaQuadtreePlane | plane |
Returns
| Type | Description |
|---|---|
| float2 | The 2D projection of |
ProjectAabb(float3, float3, ScyllaQuadtreePlane)
Builds a ScyllaAABB2 from 3D world-space min/max corners by projecting both corners onto the selected plane.
Declaration
public static ScyllaAABB2 ProjectAabb(float3 min, float3 max, ScyllaQuadtreePlane plane)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | min | Minimum corner of the 3D world-space AABB. |
| float3 | max | Maximum corner of the 3D world-space AABB. |
| ScyllaQuadtreePlane | plane | Projection plane; see Project(float3, ScyllaQuadtreePlane) for axis selection. |
Returns
| Type | Description |
|---|---|
| ScyllaAABB2 | A ScyllaAABB2 whose min/max are the projected corners. |
ProjectAabbFromCenterHalfSize(float3, float3, ScyllaQuadtreePlane)
Builds a ScyllaAABB2 from a 3D world-space center and half-size by projecting both onto the selected plane using FromCenterHalfSize(float2, float2).
Declaration
public static ScyllaAABB2 ProjectAabbFromCenterHalfSize(float3 center, float3 halfSize, ScyllaQuadtreePlane plane)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | center | World-space center of the 3D AABB. |
| float3 | halfSize | Half-extents of the 3D AABB on each axis. |
| ScyllaQuadtreePlane | plane | Projection plane. For XY, uses (x, y) components of
both |
Returns
| Type | Description |
|---|---|
| ScyllaAABB2 | A ScyllaAABB2 centered at the projected center with the projected half-size. |
Remarks
This method has a distinct name from ProjectAabb(float3, float3, ScyllaQuadtreePlane)
to prevent C# overload resolution ambiguity, since both take two float3 arguments.
RcpSafe(float2)
Computes a component-wise safe reciprocal of a 2D direction vector, replacing infinities
that would arise from division by zero with float.PositiveInfinity explicitly.
Declaration
public static float2 RcpSafe(float2 dir)
Parameters
| Type | Name | Description |
|---|---|---|
| float2 | dir | The 2D direction vector to invert. Zero components produce |
Returns
| Type | Description |
|---|---|
| float2 | A |
Remarks
Pass the result of this method as the invDir parameter to
QueryRay(float2, float2, float, float, NativeList<int>, NativeList<int>) or
QueryRay(float2, float2, float, float, NativeList<int>)
when the direction vector may be axis-aligned (i.e., contain zero components).