Class ScyllaLooseOctreeUtil
Static math-only helpers for working with ScyllaLooseOctree and ScyllaLooseOctreeCore that are safe to call from Burst-compiled code.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public static class ScyllaLooseOctreeUtil
Remarks
These utilities are provided as a convenience for callers preparing ray query parameters. All methods operate purely on numeric types with no managed allocations.
Methods
RcpSafe(float3)
Computes the component-wise reciprocal of a direction vector, substituting
float.PositiveInfinity for any component that is exactly zero.
Declaration
public static float3 RcpSafe(float3 dir)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | dir | The ray direction vector. Components may be zero for axis-aligned rays; the vector does not need to be normalized. |
Returns
| Type | Description |
|---|---|
| float3 | Component-wise reciprocal of |
Remarks
Standard AABB slab-test ray intersection relies on dividing by each direction component.
When a direction component is zero the ray is exactly axis-aligned on that axis, and the
standard math.rcp(0) produces NaN rather than infinity, which breaks the
slab test. This method replaces zero-component reciprocals with +Infinity so that
the slab test degenerates correctly to a 2D overlap check on the remaining axes.
Pass the result directly as invDir to
QueryRay(float3, float3, float, float, NativeList<int>, NativeList<int>) or
QueryRay(float3, float3, float, float, NativeList<int>).