- Preparing search index...
- The search index is not available
threejs-math
Properties
Readonly
isVector
isVector: boolean
Methods
addScalar
- addScalar(scalar: number): Vector
-
Optional
distanceTo
- distanceTo(v: Vector): number
-
Returns number
Optional
distanceToSquared
- distanceToSquared(v: Vector): number
-
Returns number
divideScalar
- divideScalar(s: number): Vector
-
dot
- dot(v: Vector): number
-
Returns number
equals
- equals(v: Vector): boolean
-
Returns boolean
getComponent
- getComponent(index: number): number
-
Returns number
length
- length(): number
-
Returns number
lengthSq
- lengthSq(): number
-
Returns number
multiplyScalar
- multiplyScalar(s: number): Vector
-
set
- set(...args: number[]): Vector
-
setComponent
- setComponent(index: number, value: number): Vector
-
Parameters
-
index: number
-
value: number
setScalar
- setScalar(scalar: number): Vector
-
Abstract interface of https://github.com/mrdoob/three.js/blob/master/src/math/Vector2.js|Vector2, https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js|Vector3 and https://github.com/mrdoob/three.js/blob/master/src/math/Vector4.js|Vector4.
Currently the members of Vector is NOT type safe because it accepts different typed vectors.
Those definitions will be changed when TypeScript innovates Generics to be type safe.
Example