Skip to main content

vrsphere

Module: Maths

A sphere.

#include <lua_api.h>

Public Functions

TypeName
booleancontains(Any b)
(vrTestContain) Returns whether or object A completly contains object B.
Anycopy()
(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane
booleanintersects(Any b)
(vrTestIntersection) Returns whether or not two objects are intersecting one another.
vrspheremerge(vrsphere](../classes/vrsphere.mdx) right)
(vrSphereMerge) Returns a sphere that encapsulates two spheres.
Anyoperator=()
vrspheretransform(vrmatrix4](../classes/vrmatrix4.mdx) matrix)
(vrSphereTransform) Returns a sphere transformed by a matrix.

Public Attributes

TypeName
vrvec3center
Centre of the sphere.
vrvec3centre
Centre of the sphere.
numberradius
Radius of the sphere.

Public Functions Documentation

contains

boolean contains(
Any b
)

(vrTestContain) Returns whether or object A completly contains object B.

Parameters:

  • b A sphere, AABB, or vec3

Return: true if b is inside a

copy

Any copy()

(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane

intersects

boolean intersects(
Any b
)

(vrTestIntersection) Returns whether or not two objects are intersecting one another.

Parameters:

  • b A sphere or AABB

Return: True if the objects are intersecting

merge

vrsphere merge(
vrsphere right
)

(vrSphereMerge) Returns a sphere that encapsulates two spheres.

operator=

Any operator=()

transform

vrsphere transform(
vrmatrix4 matrix
)

(vrSphereTransform) Returns a sphere transformed by a matrix.

Public Attributes Documentation

center

vrvec3 center;

Centre of the sphere.

centre

vrvec3 centre;

Centre of the sphere.

radius

number radius;

Radius of the sphere.