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

Method normalize

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

* normalize this vector (scale the vector so that its magnitude is 1) * @returns Reference to this object for method chaining

()

Source from the content-addressed store, hash-verified

294 * @returns Reference to this object for method chaining
295 */
296 normalize() {
297 return this.div(this.length() || 1);
298 }
299
300 /**
301 * change this vector to be perpendicular to what it was before.<br>

Callers 10

testEllipseEllipseFunction · 0.45
testPolygonEllipseFunction · 0.45
constructorMethod · 0.45
_projectVerticesWorldMethod · 0.45
recalcMethod · 0.45
quadNormalFunction · 0.45
vector2d.spec.tsFile · 0.45
vector3d.spec.tsFile · 0.45

Calls 2

divMethod · 0.95
lengthMethod · 0.95

Tested by 1

quadNormalFunction · 0.36