CullSphereGroup

Associated namespace: sm.cullSphereGroup

A userdata object representing a cull sphere group.

Values:

Functions:

Operations:

OperationDescription
CullSphereGroup == CullSphereGroupChecks if two instances of CullSphereGroup refer to the same CullSphereGroup.

id int

Get:

Returns the id of a sphere group.


addSphere(sphereGroup, id, position, radius)

Adds a sphere to the sphere group, duplicate ids are ignored.

Parameters:

TypeNameDescription
CullSphereGroupsphereGroupThe sphere group.
intidSphere id.
Vec3positionSphere position.
numberradiusSphere radius.

getDelta(sphereGroup, position, innerRadius, outerRadius)

Queries the change in overlapping spheres since the last call to getDelta.

Parameters:

TypeNameDescription
CullSphereGroupsphereGroupThe sphere group.
Vec3positionPosition to query shpere.
numberinnerRadiusRadius for inner shpere.
numberouterRadiusRadius for outer sphere.

Returns:

TypeDescription
table, tableArrays of removed, added ids {integer, ...}.

getOverlaps(sphereGroup, position, radius)

Query for overlapping spheres.

Parameters:

TypeNameDescription
CullSphereGroupsphereGroupThe sphere group.
Vec3positionPosition to query sphere.
numberradiusRadius for query sphere.

leave(sphereGroup)

Query all currently active spheres and leave them.

Parameters:

TypeNameDescription
CullSphereGroupsphereGroupThe sphere group.

Returns:

TypeDescription
tableAn array of previously active ids {integer, ...}.

removeSphere(sphereGroup, id)

Removes a sphere from the sphere group.

Parameters:

TypeNameDescription
CullSphereGroupsphereGroupThe sphere group.
intidSphere id.