# Class RotateUtil

旋转工具

#### Hierarchy

- RotateUtil

- Defined in assets/core/utils/RotateUtil.ts:11

#####
Index

### Constructors

constructor

### Methods

circularEdgePosition
rotateAround
rotateAroundTarget

## Constructors

### constructor

- new RotateUtil(): RotateUtil

- #### Returns RotateUtil

## Methods

### `Static` circularEdgePosition

- circularEdgePosition(center: Vec3, radius: number, angle: number): Vec3

- 获取心半径边上的位置

  #### Parameters

  - ##### center: Vec3

    圆心

  - ##### radius: number

    半径

  - ##### angle: number

    角度

  #### Returns Vec3

  - Defined in assets/core/utils/RotateUtil.ts:64

### `Static` rotateAround

- rotateAround(target: Node, axis: Vec3, rad: number): void

- 自由旋转

  #### Parameters

  - ##### target: Node

    旋转目标

  - ##### axis: Vec3

    围绕旋转的轴

  - ##### rad: number

    旋转弧度

  #### Returns void

  - Defined in assets/core/utils/RotateUtil.ts:18

### `Static` rotateAroundTarget

- rotateAroundTarget(lookAt: Node, target: Node, axis: Vec3, rad: number): void

- 参考瞄准目标,使当前物体围绕瞄准目标旋转 1、先通过弧度计算旋转四元数 2、通过旋转中心点或当前目标点向量相减计算出移动方向 3、计算起始向量旋转后的向量 4、计算旋转后的坐标点

  #### Parameters

  - ##### lookAt: Node

    瞄准目标

  - ##### target: Node

    旋转目标

  - ##### axis: Vec3

    围绕旋转的轴(例：Vec3.UP为Y轴)

  - ##### rad: number

    旋转弧度(例：delta.x * 1e-2)

  #### Returns void

  - Defined in assets/core/utils/RotateUtil.ts:35

Generated using TypeDoc