# Class Vec3Util

向量工具

#### Hierarchy

- Vec3Util

- Defined in assets/core/utils/Vec3Util.ts:6

#####
Index

### Constructors

constructor

### Accessors

back
down
forward
left
one
right
up
x
y
z
zero

### Methods

add
angle
bezierOne
bezierThree
bezierTwo
cross
dirAngle
direction
distance
div
dot
equals
lerp
magnitude
mul
normalize
progress
rotateTo
slerp
sub

## Constructors

### constructor

- new Vec3Util(): Vec3Util

- #### Returns Vec3Util

## Accessors

### `Static` back

- get back(): Readonly<Vec3>

- 后向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:66

### `Static` down

- get down(): Readonly<Vec3>

- 下向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:52

### `Static` forward

- get forward(): Readonly<Vec3>

- 前向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:59

### `Static` left

- get left(): Readonly<Vec3>

- 左向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:31

### `Static` one

- get one(): Readonly<Vec3>

- 1向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:73

### `Static` right

- get right(): Readonly<Vec3>

- 右向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:38

### `Static` up

- get up(): Readonly<Vec3>

- 上向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:45

### `Static` x

- get x(): Readonly<Vec3>

- X轴

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:10

### `Static` y

- get y(): Readonly<Vec3>

- Y轴

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:17

### `Static` z

- get z(): Readonly<Vec3>

- Z轴

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:24

### `Static` zero

- get zero(): Readonly<Vec3>

- 0向量

  #### Returns Readonly<Vec3>

  - Defined in assets/core/utils/Vec3Util.ts:80

## Methods

### `Static` add

- add(pos1: Vec3, pos2: Vec3): Vec3

- 求两个三维向量的和

  #### Parameters

  - ##### pos1: Vec3

    向量1

  - ##### pos2: Vec3

    向量2

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:103

### `Static` angle

- angle(dir1: Vec3, dir2: Vec3): number

- 获得两个方向向量的角度

  #### Parameters

  - ##### dir1: Vec3

    方向量1

  - ##### dir2: Vec3

    方向量2

  #### Returns number

  - Defined in assets/core/utils/Vec3Util.ts:381

### `Static` bezierOne

- bezierOne(t: number, posStart: Vec3, posEnd: Vec3): Vec3

- 一次贝塞尔即为线性插值函数

  ### Returns

  #### Parameters

  - ##### t: number

  - ##### posStart: Vec3

  - ##### posEnd: Vec3

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:260

### `Static` bezierThree

- bezierThree(t: number, posStart: Vec3, posCon1: Vec3, posCon2: Vec3, posEnd: Vec3): Vec3

- 三次贝塞尔

  ### Returns

  #### Parameters

  - ##### t: number

  - ##### posStart: Vec3

  - ##### posCon1: Vec3

  - ##### posCon2: Vec3

  - ##### posEnd: Vec3

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:315

### `Static` bezierTwo

- bezierTwo(t: number, posStart: Vec3, posCon: Vec3, posEnd: Vec3): Vec3

- 二次贝塞尔曲线

  ### Returns

  #### Parameters

  - ##### t: number

  - ##### posStart: Vec3

  - ##### posCon: Vec3

  - ##### posEnd: Vec3

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:282

### `Static` cross

- cross(dir1: Vec3, dir2: Vec3): Vec3

- 叉乘

  #### Parameters

  - ##### dir1: Vec3

    方向量1

  - ##### dir2: Vec3

    方向量2

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:361

### `Static` dirAngle

- dirAngle(a: Vec3, b: Vec3): number

- 获得方向a到方向b的角度（带有方向的角度）

  #### Parameters

  - ##### a: Vec3

    角度a

  - ##### b: Vec3

    角度b

  #### Returns number

  - Defined in assets/core/utils/Vec3Util.ts:391

### `Static` direction

- direction(pos1: Vec3, pos2: Vec3): Vec3

- 获得位置1，到位置2的方向

  #### Parameters

  - ##### pos1: Vec3

    向量1

  - ##### pos2: Vec3

    向量2

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:181

### `Static` distance

- distance(pos1: Vec3, pos2: Vec3): number

- 获得两点间的距离

  #### Parameters

  - ##### pos1: Vec3

    向量1

  - ##### pos2: Vec3

    向量2

  #### Returns number

  - Defined in assets/core/utils/Vec3Util.ts:192

### `Static` div

- div(pos: Vec3, scalar: number): Vec3

- 三维向量除常量

  #### Parameters

  - ##### pos: Vec3

    向量

  - ##### scalar: number

    常量

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:136

### `Static` dot

- dot(dir1: Vec3, dir2: Vec3): number

- 点乘

  #### Parameters

  - ##### dir1: Vec3

    方向量1

  - ##### dir2: Vec3

    方向量2

  #### Returns number

  - Defined in assets/core/utils/Vec3Util.ts:349

### `Static` equals

- equals(pos1: Vec3, pos2: Vec3): boolean

- 判断两个三维向量的值是否相等

  #### Parameters

  - ##### pos1: Vec3

    向量1

  - ##### pos2: Vec3

    向量2

  #### Returns boolean

  - Defined in assets/core/utils/Vec3Util.ts:151

### `Static` lerp

- lerp(posStart: Vec3, posEnd: Vec3, t: number): Vec3

- 插值运算

  #### Parameters

  - ##### posStart: Vec3

    开始俏步

  - ##### posEnd: Vec3

    结束位置

  - ##### t: number

    时间

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:202

### `Static` magnitude

- magnitude(pos: Vec3): number

- 三维向量的模

  #### Parameters

  - ##### pos: Vec3

    向量

  #### Returns number

  - Defined in assets/core/utils/Vec3Util.ts:163

### `Static` mul

- mul(pos: Vec3, scalar: number): Vec3

- 三维向量乘以常量

  #### Parameters

  - ##### pos: Vec3

    向量

  - ##### scalar: number

    常量

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:125

### `Static` normalize

- normalize(pos: Vec3): Vec3

- 三维向量归一化

  #### Parameters

  - ##### pos: Vec3

    向量

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:171

### `Static` progress

- progress(start: Vec3, end: Vec3, t: number): Vec3

- 随时间变化进度值

  #### Parameters

  - ##### start: Vec3

    起始位置

  - ##### end: Vec3

    结束位置

  - ##### t: number

    进度[0，1]

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:90

### `Static` rotateTo

- rotateTo(from: Vec3, to: Vec3, angle: number): Vec3

- 向量旋转一个角度

  #### Parameters

  - ##### from: Vec3

    起点

  - ##### to: Vec3

    终点

  - ##### angle: number

    角并

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:232

### `Static` slerp

- slerp(from: Vec3, to: Vec3, t: number): Vec3

- 球面插值

  #### Parameters

  - ##### from: Vec3

    起点

  - ##### to: Vec3

    终点

  - ##### t: number

    时间

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:212

### `Static` sub

- sub(pos1: Vec3, pos2: Vec3): Vec3

- 求两个三维向量的差

  #### Parameters

  - ##### pos1: Vec3

    向量1

  - ##### pos2: Vec3

    向量2

  #### Returns Vec3

  - Defined in assets/core/utils/Vec3Util.ts:114

Generated using TypeDoc