MCPcopy Create free account
hub / github.com/melonjs/melonJS / cross

Method cross

packages/melonjs/src/math/vector3d.ts:347–360  ·  view source on GitHub ↗

* calculate the cross product of this vector and the passed one * @param v other vector * @returns Reference to this object for method chaining

(v: Vector3d)

Source from the content-addressed store, hash-verified

345 * @returns Reference to this object for method chaining
346 */
347 cross(v: Vector3d) {
348 const ax = this.x;
349 const ay = this.y;
350 const az = this.z;
351 const bx = v.x;
352 const by = v.y;
353 const bz = v.z;
354
355 this.x = ay * bz - az * by;
356 this.y = az * bx - ax * bz;
357 this.z = ax * by - ay * bx;
358
359 return this;
360 }
361
362 /**
363 * return the square length of this vector

Callers 6

quadNormalFunction · 0.95
_projectVerticesWorldMethod · 0.45
vector2d.spec.tsFile · 0.45
vector3d.spec.tsFile · 0.45

Calls

no outgoing calls

Tested by 1

quadNormalFunction · 0.76