Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Magnetism

Hierarchy

Index

Constructors

constructor

Properties

accuracy

accuracy: number

Readonly isVector3

isVector3: true

timestamp

timestamp: number

x

x: number

y

y: number

z

z: number

Methods

add

  • Adds v to this vector.

    Parameters

    • v: Vector3

    Returns Magnetism

addScalar

addScaledVector

  • addScaledVector(v: Vector3, s: number): Magnetism

addVectors

  • addVectors(a: Vector3, b: Vector3): Magnetism
  • Sets this vector to a + b.

    Parameters

    • a: Vector3
    • b: Vector3

    Returns Magnetism

angleTo

  • angleTo(v: Vector3): number
  • Parameters

    • v: Vector3

    Returns number

applyAxisAngle

  • applyAxisAngle(axis: Vector3, angle: number): Magnetism

applyEuler

applyMatrix3

applyMatrix4

applyNormalMatrix

applyQuaternion

ceil

clamp

  • clamp(min: Vector3, max: Vector3): Magnetism
  • Parameters

    • min: Vector3
    • max: Vector3

    Returns Magnetism

clampLength

  • clampLength(min: number, max: number): Magnetism

clampScalar

  • clampScalar(min: number, max: number): Magnetism

clone

copy

  • Copies value of v to this vector.

    Parameters

    • v: Vector3

    Returns Magnetism

cross

  • Sets this vector to cross product of itself and v.

    Parameters

    • a: Vector3

    Returns Magnetism

crossVectors

  • crossVectors(a: Vector3, b: Vector3): Magnetism
  • Sets this vector to cross product of a and b.

    Parameters

    • a: Vector3
    • b: Vector3

    Returns Magnetism

distanceTo

  • distanceTo(v: Vector3): number
  • Computes distance of this vector to v.

    Parameters

    • v: Vector3

    Returns number

distanceToManhattan

  • distanceToManhattan(v: Vector3): number
  • deprecated

    Use {@link Vector3#manhattanDistanceTo .manhattanDistanceTo()} instead.

    Parameters

    • v: Vector3

    Returns number

distanceToSquared

  • distanceToSquared(v: Vector3): number
  • Computes squared distance of this vector to v.

    Parameters

    • v: Vector3

    Returns number

divide

divideScalar

  • Divides this vector by scalar s. Set vector to ( 0, 0, 0 ) if s == 0.

    Parameters

    • s: number

    Returns Magnetism

dot

  • dot(v: Vector3): number
  • Computes dot product of this vector and v.

    Parameters

    • v: Vector3

    Returns number

equals

  • equals(v: Vector3): boolean
  • Checks for strict equality of this vector and v.

    Parameters

    • v: Vector3

    Returns boolean

floor

fromArray

  • fromArray(array: number[] | ArrayLike<number>, offset?: number): Magnetism
  • Sets this vector's x, y and z value from the provided array or array-like.

    Parameters

    • array: number[] | ArrayLike<number>

      the source array or array-like.

    • Optional offset: number

      (optional) offset into the array. Default is 0.

    Returns Magnetism

fromBufferAttribute

  • fromBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, index: number): Magnetism
  • Parameters

    • attribute: BufferAttribute | InterleavedBufferAttribute
    • index: number

    Returns Magnetism

getComponent

  • getComponent(index: number): number
  • Parameters

    • index: number

    Returns number

length

  • length(): number
  • Computes length of this vector.

    Returns number

lengthManhattan

  • lengthManhattan(): number

lengthSq

  • lengthSq(): number
  • Computes squared length of this vector.

    Returns number

lerp

  • Parameters

    • v: Vector3
    • alpha: number

    Returns Magnetism

lerpVectors

  • lerpVectors(v1: Vector3, v2: Vector3, alpha: number): Magnetism
  • Parameters

    • v1: Vector3
    • v2: Vector3
    • alpha: number

    Returns Magnetism

manhattanDistanceTo

  • manhattanDistanceTo(v: Vector3): number

manhattanLength

  • manhattanLength(): number

max

  • Parameters

    • v: Vector3

    Returns Magnetism

min

  • Parameters

    • v: Vector3

    Returns Magnetism

multiply

multiplyScalar

  • Multiplies this vector by scalar s.

    Parameters

    • s: number

    Returns Magnetism

multiplyVectors

  • multiplyVectors(a: Vector3, b: Vector3): Magnetism

negate

normalize

project

projectOnPlane

  • projectOnPlane(planeNormal: Vector3): Magnetism

projectOnVector

random

  • Sets this vector's x, y and z from Math.random

    Returns Magnetism

reflect

  • Parameters

    • vector: Vector3

    Returns Magnetism

round

roundToZero

set

  • set(x: number, y: number, z: number): Magnetism
  • Sets value of this vector.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Magnetism

setComponent

  • setComponent(index: number, value: number): Magnetism

setFromCylindrical

  • setFromCylindrical(s: Cylindrical): Magnetism

setFromCylindricalCoords

  • setFromCylindricalCoords(radius: number, theta: number, y: number): Magnetism

setFromMatrix3Column

  • setFromMatrix3Column(matrix: Matrix3, index: number): Magnetism

setFromMatrixColumn

  • setFromMatrixColumn(matrix: Matrix4, index: number): Magnetism

setFromMatrixPosition

  • setFromMatrixPosition(m: Matrix4): Magnetism

setFromMatrixScale

setFromSpherical

setFromSphericalCoords

  • setFromSphericalCoords(r: number, phi: number, theta: number): Magnetism

setLength

  • Normalizes this vector and multiplies it by l.

    Parameters

    • l: number

    Returns Magnetism

setScalar

  • Sets all values of this vector.

    Parameters

    • scalar: number

    Returns Magnetism

setX

  • setX(x: number): Vector3
  • Sets x value of this vector.

    Parameters

    • x: number

    Returns Vector3

setY

  • setY(y: number): Vector3
  • Sets y value of this vector.

    Parameters

    • y: number

    Returns Vector3

setZ

  • setZ(z: number): Vector3
  • Sets z value of this vector.

    Parameters

    • z: number

    Returns Vector3

sub

  • Subtracts v from this vector.

    Parameters

    • a: Vector3

    Returns Magnetism

subScalar

subVectors

  • subVectors(a: Vector3, b: Vector3): Magnetism
  • Sets this vector to a - b.

    Parameters

    • a: Vector3
    • b: Vector3

    Returns Magnetism

toArray

  • toArray(array?: number[], offset?: number): number[]
  • toArray(array?: Vector3Tuple, offset?: 0): Vector3Tuple
  • toArray(array: ArrayLike<number>, offset?: number): ArrayLike<number>
  • Returns an array [x, y, z], or copies x, y and z into the provided array.

    Parameters

    • Optional array: number[]

      (optional) array to store the vector to. If this is not provided, a new array will be created.

    • Optional offset: number

      (optional) optional offset into the array.

    Returns number[]

    The created or provided array.

  • Parameters

    • Optional array: Vector3Tuple
    • Optional offset: 0

    Returns Vector3Tuple

  • Copies x, y and z into the provided array-like.

    Parameters

    • array: ArrayLike<number>

      array-like to store the vector to.

    • Optional offset: number

      (optional) optional offset into the array-like.

    Returns ArrayLike<number>

    The provided array-like.

transformDirection

unproject

Static fromArray

  • fromArray(array: number[]): Vector3