Skip to content

Commit

Permalink
fix logic error in Vec3.rotateN()
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Dec 6, 2023
1 parent a022a67 commit 3fe5a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cocos/core/math/vec3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export class Vec3 extends ValueType {
* from normalized `from` to normalized `to`,
* then scaled by linear interpolation of lengths from `from` to `to`.
*/
public static slerp= ((): <Out extends IVec3Like>(out: Out, from: Readonly<IVec3Like>, to: Readonly<IVec3Like>, t: number) => Out => {
public static slerp = ((): <Out extends IVec3Like>(out: Out, from: Readonly<IVec3Like>, to: Readonly<IVec3Like>, t: number) => Out => {
const cacheV1 = new Vec3();
const cacheV2 = new Vec3();
const cacheV3 = new Vec3();
Expand Down Expand Up @@ -668,7 +668,7 @@ export class Vec3 extends ValueType {

const cos = Math.cos(a);
const sin = Math.sin(a);
const rx = x * (nx * nx * (1.0 - cos) + cos) + y * (nx * ny * (1.0 - cos) - nx * sin) + z * (nx * nz * (1.0 - cos) + ny * sin);
const rx = x * (nx * nx * (1.0 - cos) + cos) + y * (nx * ny * (1.0 - cos) - nz * sin) + z * (nx * nz * (1.0 - cos) + ny * sin);
const ry = x * (nx * ny * (1.0 - cos) + nz * sin) + y * (ny * ny * (1.0 - cos) + cos) + z * (ny * nz * (1.0 - cos) - nx * sin);
const rz = x * (nx * nz * (1.0 - cos) - ny * sin) + y * (ny * nz * (1.0 - cos) + nx * sin) + z * (nz * nz * (1.0 - cos) + cos);

Expand Down

0 comments on commit 3fe5a85

Please sign in to comment.