Constructors
constructor
- new Vec3(x?, y?, z?): Vec3
Parameters
x: number = 0
y: number = x
z: number = x
Accessors
x
- get x(): number
Returns number
- set x(value): void
Returns void
y
- get y(): number
Returns number
- set y(value): void
Returns void
z
- get z(): number
Returns number
- set z(value): void
Returns void
Methods
Optional
_onChangeCallback
- _onChangeCallback(): void
Returns void
set
- set(x?, y?, z?): Vec3
Parameters
x: number = 0
y: number = x
z: number = x
- this Vec3 after being set
sub
- sub(vector?): Vec3
- this Vec3 after subtraction
subScalar
- subScalar(value?): Vec3
- this Vec3 after subtraction
multiply
- multiply(vector?): Vec3
- this Vec3 after multiplication
multiplyScalar
- multiplyScalar(value?): Vec3
- this Vec3 after multiplication
divideScalar
- divideScalar(value?): Vec3
-
max
- max(vector?): Vec3
- Vec3 with max values applied
min
- min(vector?): Vec3
- Vec3 with min values applied
equals
- equals(vector?): boolean
Returns boolean
- whether the Vec3 are equals or not
lengthSq
- lengthSq(): number
Returns number
- square length of this Vec3
length
- length(): number
Returns number
distance
- distance(vector?): number
Returns number
dot
- dot(vector?): number
Returns number
- dot product of the 2 Vec3
cross
- cross(vector?): Vec3
- this Vec3 after cross product
crossVectors
- crossVectors(a?, b?): Vec3
- this Vec3 after cross product
lerp
- lerp(vector?, alpha?): Vec3
Parameters
vector: Vec3 = ...
alpha: number = 1
- this Vec3 after linear interpolation
setFromMatrixPosition
- setFromMatrixPosition(matrix): Vec3
-
applyQuat
- applyQuat(quaternion?): Vec3
- this Vec3 with the transformation applied
applyAxisAngle
- applyAxisAngle(axis?, angle?, quaternion?): Vec3
Parameters
axis: Vec3 = ...
angle: number = 0
quaternion: Quat = ...
- this Vec3 with the rotation applied
Really basic 3D vector class used for vector calculations
See