new ScaledVector(x, y, z, scale)
Creates a new 3D scaled direction vector.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
x |
number | 0 | The normalised X-axis component of the vector. |
y |
number | 0 | The normalised Y-axis component of the vector |
z |
number | 0 | The normalised Z-axis component of the vector |
scale |
number | 0 | The magnitude of the vector. |
Extends
- THREE.Vector3
Members
-
:boolean
isScaledVector <readonly>
-
A flag identifying this object as a scaled vector.
Type
- boolean
-
:number
scale
-
Stores a distance component in model units.
Type
- number
Methods
-
copyWithScale(m_vec)
-
Copies the
x,y,zandscalecomponents.Parameters:
Name Type Description m_vecPD.ScaledVector The magnitude vector to copy from.
Returns:
Returns this vector to support method chaining.
- Type
- PD.ScaledVector
-
setFromPoints(pt1, pt2)
-
Calculates the projected vector between two 3D points.
NOTE: This method changes values within the
outparameter, however it is safe to use the same instance aspt1orpt2to change it in-place.Parameters:
Name Type Description pt1THREE.Vector3 The start position of the line.
pt2THREE.Vector3 The end position of the line.
Returns:
Returns this vector to support method chaining.
- Type
- PD.ScaledVector
-
fromPoints(pt1, pt2) <static>
-
Create a new vector with the magnitude of the vector between the given points.
Parameters:
Name Type Description pt1THREE.Vector3 The start position of the line.
pt2THREE.Vector3 The end position of the line.
Returns:
Returns a new magnitude vector.
- Type
- PD.ScaledVector
-
fromVector3(vec) <static>
-
Create a new vector with the magnitude of the given vector.
Parameters:
Name Type Description vecTHREE.Vector3 A generic vector object.
Returns:
Returns a new magnitude vector.
- Type
- PD.ScaledVector