Skip to content

Commit

Permalink
fix eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Dec 6, 2023
1 parent 3fe5a85 commit f891a9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cocos/core/math/vec3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { Mat4 } from './mat4';
import { IMat3Like, IMat4Like, IQuatLike, IVec3Like } from './type-define';
import { clamp, EPSILON, lerp, random } from './utils';
import { legacyCC } from '../global-exports';
import { warn } from '../platform';

/**
* @en Representation of 3D vectors and points.
Expand Down Expand Up @@ -1035,7 +1036,7 @@ export class Vec3 extends ValueType {
* @param scalar scalar number
*/
public multiplyScalar (scalar: number): Vec3 {
if (typeof scalar === 'object') { console.warn('should use Vec3.multiply for vector * vector operation'); }
if (typeof scalar === 'object') { warn('should use Vec3.multiply for vector * vector operation'); }
this.x *= scalar;
this.y *= scalar;
this.z *= scalar;
Expand All @@ -1048,7 +1049,7 @@ export class Vec3 extends ValueType {
* @param other specified vector
*/
public multiply (other: Vec3): Vec3 {
if (typeof other !== 'object') { console.warn('should use Vec3.scale for vector * scalar operation'); }
if (typeof other !== 'object') { warn('should use Vec3.scale for vector * scalar operation'); }
this.x *= other.x;
this.y *= other.y;
this.z *= other.z;
Expand Down Expand Up @@ -1208,6 +1209,7 @@ export function v3 (other: Vec3): Vec3;
export function v3 (x?: number, y?: number, z?: number): Vec3;

export function v3 (x?: number | Vec3, y?: number, z?: number): Vec3 {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return new Vec3(x as any, y, z);
}

Expand Down

0 comments on commit f891a9a

Please sign in to comment.