-
Notifications
You must be signed in to change notification settings - Fork 0
math
Set the tolerance of the math library
Parameters
t: Number, The new tolerance
Find out what the no intersection constant is
Returns
Number, The constant representing that there was no intersection
Get the tolerance of the math library
Returns
Number, The current tolerance
Create a Vect
Parameters
x: Number, The x coordinate
y: Number, The y coordinate
z: Number, The z coordinate
w: Number, The homogeneous component
Converts this object to string format
Returns
String, The string representation of the Vect
Create a Ray to cast
Parameters
o: Vect, Origin of Ray
dir: Vect, Direction of Ray
Convert Ray to string
Returns
String, The string representation of the Ray
Get a point along the ray
Parameters
t: Number, The position along the line to retrieve
Returns
Vect, The point at position t
Create a Triangle
Parameters
a: Vect, The first point in the triangle
b: Vect, The second point in the triangle
c: Vect, The third point in the triangle
Get the string representation of this Triangle
Returns
String, The string representation of this Triangle
Creates a Sphere
Parameters
c: Vect, The center of the Sphere
r: Number, The radius of the Sphere
Get the string representation of this sphere
Returns
String, String representation of the Sphere
A record of a collision between objects
Parameters
point: Vect, The position at which the collision occured
normal: Vect, The collision normal
Viewport constructor
Parameters
width: type,
height: type,
top: type,
bottom: type,
left: type,
right: type,
near: type,
far: type,
fov: type,
Get cross product of two vectors
Parameters
v0: Vect, The first vector of the cross operation
v1: Vect, the second vector of the cross operation
Returns
Vect, The result of the cross operation
Find dot product of two vectors
Parameters
v0: Vect, The first vector of the dot product operation
v1: Vect, The second vector of the dot product operation
Returns
Number, The result of the dot product operation
Normalize a vector
Parameters
v: Vect, The vector to normalize
Returns
Vect, The normalized vector
Get the magnitude of a vector
Parameters
v: Vect, The vector to get the magnitude of
Returns
Number, The magnitude of the vector
Find the projection of one vector onto another
Parameters
v1: Vect, The first vector of the projection operation
v2: Vect, The second vector of the projection operation
Returns
Vect, The result of the projection operation
Scale a Vect by a scalar
Parameters
v0: Vect, The vector to scale
s: Number, The scalar to scale the vector by
Returns
Vect, The scaled vector
Add one Vect to another
Parameters
v0: Vect, The first addend vector
v1: Vect, The second addend vector
Returns
Vect, The sum of the vectors
Return the difference between two vects
Parameters
v0: Vect, The minuend vector
v1: Vect, The subtrahend vector
Returns
Vect, The difference vector
Multiply one vect by another
Parameters
v0: Vect, The multiplicand vector
v1: Vect, The multiplier vector
Returns
Vect, The product vector
Divide a Vect by another
Parameters
v0: Vect, The dividend vector
v1: Vect, The divisor vector
Returns
Vect, The quotient vector
Check that two Vect are equal within tolerance
Parameters
v0: type, The first vector to be compared for equality
v1: type, The second vector to be compared for equality
Returns
Boolean, Whether the vectors are equal within tolerance
See if two Numbers are equal within tolerance
Parameters
n0: Number, The first number to be compared for equality
n1: Number, The second number to be compared for equality
Returns
Boolean, Whether the numbers are equal within tolerance
Convert degrees to radians
Parameters
degrees: Number, Degrees to convert
Returns
Number, Radians conversion
Convert radians to degress
Parameters
radians: Number, Radians to convert
Returns
Number, Degrees conversion
Collide a Ray with a Triangle
Parameters
ray: Ray, The ray to cast for collision
tri: Triangle, The triangle to check for collision
Returns
Number, Where along the ray the intersection occured
Collide a Ray with a Sphere
Parameters
ray: Ray, The ray to cast for collision
sphere: Sphere, the Sphere to check for collision
Returns
Number, Where along the ray the intersection occured
Try and intersect two objects
Parameters
a: Object, The collider object of the collision check
b: Object, The collidee object of the collision check
Returns
Number, The penetration depth of the collision if there was one