open class Vector4(var x: Float, var y: Float, var z: Float, var w: Float)
Vector4
(
v
)
|
Constructor that takes a single float value and initializes all components to that value.
Signature
constructor(v: Float) Parameters
v:
Float
Returns |
Vector4
(
x
, y
, z
, w
)
|
Signature
constructor(x: Float, y: Float, z: Float, w: Float) Parameters
x:
Float
y:
Float
z:
Float
w:
Float
Returns |
w
: Float
[Get][Set] |
Signature
open var w: Float |
x
: Float
[Get][Set] |
Signature
open var x: Float |
y
: Float
[Get][Set] |
Signature
open var y: Float |
z
: Float
[Get][Set] |
Signature
open var z: Float |
add
(
v
)
| |
component1
()
|
Signature
operator fun component1(): Float Returns
Float
|
component2
()
|
Signature
operator fun component2(): Float Returns
Float
|
component3
()
|
Signature
operator fun component3(): Float Returns
Float
|
component4
()
|
Signature
operator fun component4(): Float Returns
Float
|
copy
()
| |
distanceTo
(
v
)
|
Calculates the distance between two vectors.
Signature
fun distanceTo(v: Vector4): Float Parameters Returns
Float
|
div
(
v
)
|
Overloads the div operator to perform scalar division.
Signature
operator fun div(v: Float): Vector4 Parameters
v:
Float
|
divide
(
v
)
|
Performs scalar division.
Signature
fun divide(v: Float): Vector4 Parameters
v:
Float
|
dot
(
v
)
|
Calculates the dot product of two vectors.
Signature
fun dot(v: Vector4): Float Parameters Returns
Float
|
equals
(
other
)
|
Signature
open operator override fun equals(other: Any?): Boolean Parameters
other:
Any?
Returns
Boolean
|
hashCode
()
|
Signature
open override fun hashCode(): Int Returns
Int
|
length
()
|
Calculates the length of the vector.
Signature
fun length(): Float Returns
Float
|
lerp
(
dest
, ratio
)
|
Linearly interpolates between two vectors.
Signature
fun lerp(dest: Vector4, ratio: Float): Vector4 Parameters
ratio:
Float
|
minus
(
v
)
| |
multiply
(
v
)
| |
multiply
(
v
)
|
Performs scalar multiplication.
Signature
fun multiply(v: Float): Vector4 Parameters
v:
Float
|
negate
()
| |
normalize
()
|
Normalizes the vector.
Signature
fun normalize(): Vector4 Returns
A new vector representing the normalization of this vector, or (0, 0, 0, 0) if the length of this vector is 0.
|
plus
(
v
)
| |
setW
(
w
)
| |
setX
(
x
)
| |
setY
(
y
)
| |
setZ
(
z
)
| |
sub
(
v
)
| |
times
(
v
)
| |
times
(
v
)
|
Overloads the times operator to perform scalar multiplication.
Signature
operator fun times(v: Float): Vector4 Parameters
v:
Float
|
toString
()
|
Signature
open override fun toString(): String Returns
String
|
unaryMinus
()
|
Overloads the unary minus operator to negate the vector.
Signature
operator fun unaryMinus(): Vector4 |