MCPcopy
hub / github.com/mrdoob/three.js / setLength

Method setLength

src/math/Vector3.js:805–809  ·  view source on GitHub ↗

* Sets this vector to a vector with the same direction as this one, but * with the specified length. * * @param {number} length - The new length of this vector. * @return {Vector3} A reference to this vector.

( length )

Source from the content-addressed store, hash-verified

803 * @return {Vector3} A reference to this vector.
804 */
805 setLength( length ) {
806
807 return this.normalize().multiplyScalar( length );
808
809 }
810
811 /**
812 * Linearly interpolates between the given vector and this instance, where

Callers 8

Vector2.tests.jsFile · 0.45
Vector3.tests.jsFile · 0.45
Vector4.tests.jsFile · 0.45
unionMethod · 0.45
_panCameraMethod · 0.45
_rotateCameraMethod · 0.45
_checkDistancesMethod · 0.45

Calls 2

normalizeMethod · 0.95
multiplyScalarMethod · 0.45

Tested by

no test coverage detected