Skip to content

@simversus/yjvisDocs


@simversus/yjvis / Vec3

Class: Vec3

Extended by

Constructors

new Vec3()

new Vec3(x, y?, z?): Vec3

Parameters

x: number = 0

y?: number

z?: number

Returns

Vec3

Defined in

math/vec3.ts:35

Properties

elements

elements: Number3

Defined in

math/vec3.ts:33

Accessors

0

get 0(): number

set 0(v): void

Parameters

v: number

Returns

number

Defined in

math/vec3.ts:63


1

get 1(): number

set 1(v): void

Parameters

v: number

Returns

number

Defined in

math/vec3.ts:67


2

get 2(): number

set 2(v): void

Parameters

v: number

Returns

number

Defined in

math/vec3.ts:71


x

get x(): number

set x(v): void

Parameters

v: number

Returns

number

Defined in

math/vec3.ts:40


y

get y(): number

set y(v): void

Parameters

v: number

Returns

number

Defined in

math/vec3.ts:44


z

get z(): number

set z(v): void

Parameters

v: number

Returns

number

Defined in

math/vec3.ts:48


unitX

get static unitX(): Vec3

Returns

Vec3

Defined in

math/vec3.ts:20


unitY

get static unitY(): Vec3

Returns

Vec3

Defined in

math/vec3.ts:24


unitZ

get static unitZ(): Vec3

Returns

Vec3

Defined in

math/vec3.ts:28

Methods

add()

add(va, vb?): Vec3

Parameters

va: Vec3

vb?: Vec3

Returns

Vec3

Defined in

math/vec3.ts:113


angleTo()

angleTo(v): number

向量夹角

Parameters

v: Vec3

Returns

number

Defined in

math/vec3.ts:277


applyMatrix3()

applyMatrix3(mat3): Vec3

Parameters

mat3: Mat3

Returns

Vec3

Defined in

math/vec3.ts:246


applyMatrix4()

applyMatrix4(mat4): Vec3

Parameters

mat4: Mat4

Returns

Vec3

Defined in

math/vec3.ts:241


applyNormalMatrix()

applyNormalMatrix(mat3): Vec3

Parameters

mat3: Mat3

Returns

Vec3

Defined in

math/vec3.ts:251


applyQuaternion()

applyQuaternion(q): Vec3

Parameters

q: Quat

Returns

Vec3

Defined in

math/vec3.ts:256


clampScalar()

clampScalar(min, max): Vec3

Parameters

min: number = Number.MIN_VALUE

max: number = Number.MAX_VALUE

Returns

Vec3

Defined in

math/vec3.ts:146


clone()

clone(): Vec3

Returns

Vec3

Defined in

math/vec3.ts:109


copy()

copy(v): Vec3

Parameters

v: Vec3

Returns

Vec3

Defined in

math/vec3.ts:103


cross()

cross(va, vb?): Vec3

叉积

Parameters

va: Vec3

vb?: Vec3

Returns

Vec3

Defined in

math/vec3.ts:208


distance()

distance(v): number

两个向量的距离

Parameters

v: Vec3

Returns

number

Defined in

math/vec3.ts:188


divide()

divide(v): Vec3

Parameters

v: Vec3

Returns

Vec3

Defined in

math/vec3.ts:131


dot()

dot(v): number

点积

Parameters

v: Vec3

Returns

number

Defined in

math/vec3.ts:219


equals()

equals(v): boolean

判断相等

Parameters

v: Vec3

Returns

boolean

Defined in

math/vec3.ts:237


inverse()

inverse(v): Vec3

Parameters

v: Vec3 = ...

Returns

Vec3

Defined in

math/vec3.ts:141


length()

length(): number

向量长度

Returns

number

Defined in

math/vec3.ts:171


lengthSq()

lengthSq(): number

向量长度的平方

Returns

number

Defined in

math/vec3.ts:179


lerp()

lerp(end, t, start): Vec3

插值

Parameters

end: Vec3

t: number

start: Vec3 = ...

Returns

Vec3

Defined in

math/vec3.ts:157


multiply()

multiply(va, vb?): Vec3

Parameters

va: Vec3

vb?: Vec3

Returns

Vec3

Defined in

math/vec3.ts:125


negate()

negate(v): Vec3

取反

Parameters

v: Vec3 = ...

Returns

Vec3

Defined in

math/vec3.ts:197


normalize()

normalize(v): Vec3

单位化

Parameters

v: Vec3 = ...

Returns

Vec3

Defined in

math/vec3.ts:227


projectOnPlane()

projectOnPlane(normal): Vec3

投影到一个平面

Parameters

normal: Vec3

Returns

Vec3

Defined in

math/vec3.ts:298


projectOnVector()

projectOnVector(v): Vec3

投影到一个向量

Parameters

v: Vec3

Returns

Vec3

Defined in

math/vec3.ts:288


scale()

scale(v): Vec3

Parameters

v: number

Returns

Vec3

Defined in

math/vec3.ts:136


set()

set(x, y, z): Vec3

Parameters

x: number | [number, number, number]

y: number | [number, number, number] = x

z: number | [number, number, number] = x

Returns

Vec3

Defined in

math/vec3.ts:97


sub()

sub(va, vb?): Vec3

Parameters

va: Vec3

vb?: Vec3

Returns

Vec3

Defined in

math/vec3.ts:119


toArray()

toArray(): Number3

Returns

Number3

Defined in

math/vec3.ts:93


transformDirection()

transformDirection(mat4): Vec3

Parameters

mat4: Mat4

Returns

Vec3

Defined in

math/vec3.ts:261


copy()

static copy(v): Vec3

Parameters

v: Vec3

Returns

Vec3

Defined in

math/vec3.ts:87


create()

static create(x, y?, z?): Vec3

Parameters

x: number = 0

y?: number

z?: number

Returns

Vec3

Defined in

math/vec3.ts:12


random()

static random(): Vec3

Returns

Vec3

Defined in

math/vec3.ts:16