Runtime Spawner 1.5.1
Generic Runtime spawn and instance pooling system for spawning random AI agents around a map. Works with ANY AI system easily.
Loading...
Searching...
No Matches
MegaCrush.Spawner.SpawnMath Class Reference

Lightweight math helpers shared by spawner flows (global/region/wave) and the executor. Uses squared-distance comparisons for performance and XZ-planar checks to ignore height. More...

Static Public Member Functions

static bool WithinRangeXZ (Vector3 a, Vector3 b, float r)
 Determines whether two world positions are within a specified planar (XZ) radius of each other. Ignores the Y axis for performance and to avoid false negatives due to height differences.
 
static bool CirclesOverlapXZ (Vector3 centerA, float radiusA, Vector3 centerB, float radiusB)
 Tests whether two planar (XZ) circles overlap or touch. Useful for quick prefilters like "spawnpoint center (with its local range) vs player cull circle".
 

Detailed Description

Lightweight math helpers shared by spawner flows (global/region/wave) and the executor. Uses squared-distance comparisons for performance and XZ-planar checks to ignore height.

Member Function Documentation

◆ CirclesOverlapXZ()

static bool MegaCrush.Spawner.SpawnMath.CirclesOverlapXZ ( Vector3 centerA,
float radiusA,
Vector3 centerB,
float radiusB )
static

Tests whether two planar (XZ) circles overlap or touch. Useful for quick prefilters like "spawnpoint center (with its local range) vs player cull circle".

Parameters
centerAFirst circle center (world position).
radiusAFirst circle radius in world units.
centerBSecond circle center (world position).
radiusBSecond circle radius in world units.
Returns
true if the circles overlap or touch; otherwise false.

◆ WithinRangeXZ()

static bool MegaCrush.Spawner.SpawnMath.WithinRangeXZ ( Vector3 a,
Vector3 b,
float r )
static

Determines whether two world positions are within a specified planar (XZ) radius of each other. Ignores the Y axis for performance and to avoid false negatives due to height differences.

Parameters
aFirst world position.
bSecond world position.
rRadius to compare against, in world units.
Returns
true if the squared distance between a and b on the XZ plane is less than or equal to r squared; otherwise false.

The documentation for this class was generated from the following file: