Summary
Methods
- add(a, b, out) → {Vec3}
- angle(a, b) → {Number}
- bezier(a, b, c, d, t, out) → {Vec3}
- clone(a) → {Vec3}
- copy(a, out) → {Vec3}
- create() → {Vec3}
- cross(a, b, out) → {Vec3}
- dist()
- distance(a, b) → {Number}
- div()
- divide(a, b, out) → {Vec3}
- dot(a, b) → {Number}
- forEach(a, stride, offset, count, fn, argopt) → {Array}
- fromValues(x, y, z) → {Vec3}
- hermite(a, b, c, d, t, out) → {Vec3}
- inverse(a, out) → {Vec3}
- len()
- length(a) → {Number}
- lerp(a, b, t, out) → {Vec3}
- max(a, b, out) → {Vec3}
- min(a, b, out) → {Vec3}
- mul()
- multiply(a, b, out) → {Vec3}
- negate(a, out) → {Vec3}
- normalize(a, out) → {Vec3}
- random(scaleopt, out) → {Vec3}
- rotateX(a, b, c, out) → {Vec3}
- rotateY(a, b, c, out) → {Vec3}
- rotateZ(a, b, c, out) → {Vec3}
- scale(a, b, out) → {Vec3}
- scaleAndAdd(a, b, scale, out) → {Vec3}
- set(x, y, z, out) → {Vec3}
- sqrDist()
- sqrLen()
- squaredDistance(a, b) → {Number}
- squaredLength(a) → {Number}
- str(vec) → {String}
- sub()
- subtract(a, b, out) → {Vec3}
- transformMat3(a, m, out) → {Vec3}
- transformMat4(a, m, out) → {Vec3}
- transformQuat(a, q, out) → {Vec3}
Detailed Description
Methods
add(a, b, out) → {Vec3}
angle(a, b) → {Number}
bezier(a, b, c, d, t, out) → {Vec3}
Performs a bezier interpolation with two control points
Parameters:
Name | Type | Description |
---|---|---|
a |
Vec3 | the first operand |
b |
Vec3 | the second operand |
c |
Vec3 | the third operand |
d |
Vec3 | the fourth operand |
t |
Number | interpolation amount between the two inputs |
out |
Vec3 | the receiving vector |
Returns:
out
- Type
- Vec3
- Source:
clone(a) → {Vec3}
copy(a, out) → {Vec3}
create() → {Vec3}
cross(a, b, out) → {Vec3}
dist()
Alias for vec3.distance
- Source:
distance(a, b) → {Number}
div()
Alias for vec3.divide
- Source:
divide(a, b, out) → {Vec3}
dot(a, b) → {Number}
forEach(a, stride, offset, count, fn, argopt) → {Array}
Perform some operation over an array of vec3s.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
a |
Array | the array of vectors to iterate over | |
stride |
Number | Number of elements between the start of each vec3. If 0 assumes tightly packed | |
offset |
Number | Number of elements to skip at the beginning of the array | |
count |
Number | Number of vec3s to iterate over. If 0 iterates over entire array | |
fn |
function | Function to call for each vector in the array | |
arg |
Object |
<optional> |
additional argument to pass to fn |
Returns:
a
- Type
- Array
- Source:
fromValues(x, y, z) → {Vec3}
Creates a new vec3 initialized with the given values
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | X component |
y |
Number | Y component |
z |
Number | Z component |
Returns:
a new 3D vector
- Type
- Vec3
- Source:
hermite(a, b, c, d, t, out) → {Vec3}
Performs a hermite interpolation with two control points
Parameters:
Name | Type | Description |
---|---|---|
a |
Vec3 | the first operand |
b |
Vec3 | the second operand |
c |
Vec3 | the third operand |
d |
Vec3 | the fourth operand |
t |
Number | interpolation amount between the two inputs |
out |
Vec3 | the receiving vector |
Returns:
out
- Type
- Vec3
- Source:
inverse(a, out) → {Vec3}
len()
Alias for vec3.length
- Source:
length(a) → {Number}
Calculates the length of a vec3
Parameters:
Name | Type | Description |
---|---|---|
a |
Vec3 | vector to calculate length of |
Returns:
length of a
- Type
- Number
- Source:
lerp(a, b, t, out) → {Vec3}
max(a, b, out) → {Vec3}
min(a, b, out) → {Vec3}
mul()
Alias for vec3.multiply
- Source:
multiply(a, b, out) → {Vec3}
negate(a, out) → {Vec3}
normalize(a, out) → {Vec3}
random(scaleopt, out) → {Vec3}
rotateX(a, b, c, out) → {Vec3}
rotateY(a, b, c, out) → {Vec3}
rotateZ(a, b, c, out) → {Vec3}
scale(a, b, out) → {Vec3}
scaleAndAdd(a, b, scale, out) → {Vec3}
set(x, y, z, out) → {Vec3}
sqrDist()
Alias for vec3.squaredDistance
- Source:
sqrLen()
Alias for vec3.squaredLength
- Source:
squaredDistance(a, b) → {Number}
squaredLength(a) → {Number}
Calculates the squared length of a vec3
Parameters:
Name | Type | Description |
---|---|---|
a |
Vec3 | vector to calculate squared length of |
Returns:
squared length of a
- Type
- Number
- Source:
str(vec) → {String}
Returns a string representation of a vector
Parameters:
Name | Type | Description |
---|---|---|
vec |
Vec3 | vector to represent as a string |
Returns:
string representation of the vector
- Type
- String
- Source:
sub()
Alias for vec3.subtract
- Source: