format
typescript
Quaternion.RotateVector(src)class: Quaternion
description
Calculates the vector after rotating the target vector by the current quaternion.
Equivalent to multiplying the quaternion by the vector.
parameter
| param_name | type | description |
|---|---|---|
| src | Vector3 | The target vector. |
reture
| type | description |
|---|---|
Vector3 | The new vector after rotation. |
code example
typescript
function QuaternionTest (){
let x = new Vector3(1,0,0);
let quat_axis = Quaternion.AngleAxis(60,new Vector3(0,1,0));
let rx = quat_axis.RotateVector(x);
let ix = quat_axis.InvertRotateVector(rx);
}