Constructors
constructor
- new Vector(x: number, y: number, z: number): Vector
-
Parameters
-
x: number
-
y: number
-
z: number
Methods
[Symbol.iterator]
- [Symbol.iterator](): Iterator<number>
add
-
Parameters
-
b: Vector | [x: number, y: number, z: number]
clampVectorMagnitude
- clampVectorMagnitude(min: number, max: number): Vector
distance
- distance(b: Vector | [x: number, y: number, z: number]): number
-
Parameters
-
b: Vector | [x: number, y: number, z: number]
Returns number
dot
- dot(b: Vector | [x: number, y: number, z: number]): number
-
Parameters
-
b: Vector | [x: number, y: number, z: number]
Returns number
equals
- equals(b: Vector | [x: number, y: number, z: number], errorTolerance: number): boolean
-
Parameters
-
b: Vector | [x: number, y: number, z: number]
-
errorTolerance: number
Returns boolean
findClosestPointOnLine
- findClosestPointOnLine(lineOrigin: Vector | [x: number, y: number, z: number], lineDirection: Vector | [x: number, y: number, z: number]): Vector
-
Parameters
-
lineOrigin: Vector | [x: number, y: number, z: number]
-
lineDirection: Vector | [x: number, y: number, z: number]
findClosestPointOnSegment
- findClosestPointOnSegment(segmentStart: Vector | [x: number, y: number, z: number], segmentEnd: Vector | [x: number, y: number, z: number]): Vector
-
Parameters
-
segmentStart: Vector | [x: number, y: number, z: number]
-
segmentEnd: Vector | [x: number, y: number, z: number]
findLookAtRotation
- findLookAtRotation(target: Vector | [x: number, y: number, z: number]): Rotator
-
Parameters
-
target: Vector | [x: number, y: number, z: number]
getDistanceToLine
- getDistanceToLine(lineOrigin: Vector | [x: number, y: number, z: number], lineDirection: Vector | [x: number, y: number, z: number]): number
-
Parameters
-
lineOrigin: Vector | [x: number, y: number, z: number]
-
lineDirection: Vector | [x: number, y: number, z: number]
Returns number
getDistanceToSegment
- getDistanceToSegment(segmentStart: Vector | [x: number, y: number, z: number], segmentEnd: Vector | [x: number, y: number, z: number]): number
-
Parameters
-
segmentStart: Vector | [x: number, y: number, z: number]
-
segmentEnd: Vector | [x: number, y: number, z: number]
Returns number
getReflectionVector
- getReflectionVector(surfaceNormal: Vector | [x: number, y: number, z: number]): Vector
-
Parameters
-
surfaceNormal: Vector | [x: number, y: number, z: number]
isInBox
- isInBox(boxOrigin: Vector | [x: number, y: number, z: number], boxExtent: Vector | [x: number, y: number, z: number]): boolean
-
Parameters
-
boxOrigin: Vector | [x: number, y: number, z: number]
-
boxExtent: Vector | [x: number, y: number, z: number]
Returns boolean
magnitudeSquared
- magnitudeSquared(): number
rotateAngleAxis
- rotateAngleAxis(angleDeg: number, axis: Vector | [x: number, y: number, z: number]): Vector
-
Parameters
-
angleDeg: number
-
axis: Vector | [x: number, y: number, z: number]
subtract
- subtract(b: Vector | [x: number, y: number, z: number]): Vector
-
Parameters
-
b: Vector | [x: number, y: number, z: number]
Static getVectorArrayAverage
Static interpolateTo
- interpolateTo(current: Vector | [x: number, y: number, z: number], target: Vector | [x: number, y: number, z: number], deltaTime: number, interpSpeed: number): Vector
-
Parameters
-
current: Vector | [x: number, y: number, z: number]
-
target: Vector | [x: number, y: number, z: number]
-
deltaTime: number
-
interpSpeed: number
Static interpolateToConstant
- interpolateToConstant(current: Vector | [x: number, y: number, z: number], target: Vector | [x: number, y: number, z: number], deltaTime: number, interpSpeed: number): Vector
-
Parameters
-
current: Vector | [x: number, y: number, z: number]
-
target: Vector | [x: number, y: number, z: number]
-
deltaTime: number
-
interpSpeed: number
Static lerp
- lerp(a: Vector | [x: number, y: number, z: number], b: Vector | [x: number, y: number, z: number], alpha: number): Vector
-
Parameters
-
a: Vector | [x: number, y: number, z: number]
-
b: Vector | [x: number, y: number, z: number]
-
alpha: number
Static randomPointInBoundingBox
- randomPointInBoundingBox(origin: Vector | [x: number, y: number, z: number], boxExtent: Vector | [x: number, y: number, z: number]): Vector
-
Parameters
-
origin: Vector | [x: number, y: number, z: number]
-
boxExtent: Vector | [x: number, y: number, z: number]
A point or direction in 3d space