(from-seq v1)
convert a seq of 3 elements to vector3
convert a seq of 3 elements to vector3
(from-spherical s1)
convert spherical point to vector3 point
convert spherical point to vector3 point
(from-spherical-coords radius phi theta)
convert spherical point, radius phi theta as input, to vector3 point
convert spherical point, radius phi theta as input, to vector3 point
(project-on-plane v plane-normal-v)
planeNormal - A vector representing a plane normal. Projects this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.
planeNormal - A vector representing a plane normal. Projects this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.
(dot v1 v2)
Calculate the dot product of this vector and v.
Calculate the dot product of this vector and v.
(apply-axis-angle v axis angle)
.applyAxisAngle ( axis : Vector3, angle : Float ) : this. axis - A normalized Vector3. angle - An angle in radians.
.applyAxisAngle ( axis : Vector3, angle : Float ) : this. axis - A normalized Vector3. angle - An angle in radians.
(angle-to v1 v2)
Returns the angle between this vector and vector v in radians.
Returns the angle between this vector and vector v in radians.
(add v1 v2)
Adds v to this vector.
Adds v to this vector.
(cross v1 v2)
Sets this vector to cross product of a and b.
Sets this vector to cross product of a and b.
(normalize v)
Convert this vector to a unit vector - that is, sets it equal to a vector with the same direction as this one, but length 1.
Convert this vector to a unit vector - that is, sets it equal to a vector with the same direction as this one, but length 1.
(apply-normal-matrix v m)
Multiplies this vector by normal matrix m and normalizes the result.
Multiplies this vector by normal matrix m and normalizes the result.
(sub v1 v2)
Subtracts v from this vector.
Subtracts v from this vector.
(multiply-scalar v s)
Multiplies this vector by scalar s.
Multiplies this vector by scalar s.
(almost-equals v1 v2)
Return true if v1 and v2 are almost equal. every element is less than 0.000001.
Return true if v1 and v2 are almost equal. every element is less than 0.000001.
(apply-matrix4 v m)
Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective.
Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective.
(->array v)
array - (optional) array to store this vector to. If this is not provided a new array will be created. offset - (optional) optional offset into the array.
array - (optional) array to store this vector to. If this is not provided a new array will be created. offset - (optional) optional offset into the array.
(apply-matrix3 v m)
Multiplies this vector by m
Multiplies this vector by m
(equals v1 v2)
Returns true if the components of this vector and v are strictly equal; false otherwise.
Returns true if the components of this vector and v are strictly equal; false otherwise.
(clone' v)
Returns a new vector3 with the same x, y and z values as this one.
Returns a new vector3 with the same x, y and z values as this one.
(add-scalar v1 s)
Adds the scalar value s to this vector's x, y and z values.
Adds the scalar value s to this vector's x, y and z values.
(length v)
Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).
Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).
(apply-euler v e)
Applies euler transform to this vector by converting the Euler object to a Quaternion and applying.
Applies euler transform to this vector by converting the Euler object to a Quaternion and applying.
(apply-quaternion v q)
Applies a Quaternion transform to this vecto
Applies a Quaternion transform to this vecto
(random)
Sets each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
Sets each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
(vector3)
(vector3 x y z)
Constructor function vector3( x : Float, y : Float, z : Float ) x - the x value of this vector. Default is 0. y - the y value of this vector. Default is 0. z - the z value of this vector. Default is 0.
Constructor function vector3( x : Float, y : Float, z : Float ) x - the x value of this vector. Default is 0. y - the y value of this vector. Default is 0. z - the z value of this vector. Default is 0.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close