open class Vector3(var x: Float, var y: Float, var z: Float)
Vector3
(
v
)
:
Vector3 |
Constructor for creating a Vector3 with all components set to the same value.
Signature
constructor(v: Float) Parameters
v:
Float
Returns |
Vector3
(
c
)
:
Vector3 |
Constructor for creating a Vector3 from a Color object.
Signature
constructor(c: Color) Parameters
c:
Color
Returns |
Vector3
(
x
,
y
,
z
)
:
Vector3 |
Signature
constructor(x: Float, y: Float, z: Float) Parameters
x:
Float
y:
Float
z:
Float
Returns |
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
)
:
Vector3 | |
angleBetweenDegrees
(
v
)
:
Float
|
Calculates the angle between two vectors in degrees.
Signature
fun angleBetweenDegrees(v: Vector3): Float Parameters
v:
Vector3 Returns
Float
|
component1
()
:
Float
|
Signature
operator fun component1(): Float Returns
Float
|
component2
()
:
Float
|
Signature
operator fun component2(): Float Returns
Float
|
component3
()
:
Float
|
Signature
operator fun component3(): Float Returns
Float
|
copy
()
:
Vector3 | |
cross
(
other
)
:
Vector3 | |
distanceTo
(
v
)
:
Float
|
Calculates the distance between two vectors.
Signature
fun distanceTo(v: Vector3): Float Parameters
v:
Vector3 Returns
Float
|
div
(
v
)
:
Vector3 |
Divides a vector by a scalar.
Signature
inline operator fun div(v: Float): Vector3 Parameters
v:
Float
|
divide
(
v
)
:
Vector3 |
Divides a vector by a scalar.
Signature
inline fun divide(v: Float): Vector3 Parameters
v:
Float
|
dot
(
v
)
:
Float
|
Calculates the dot product of two vectors.
Signature
inline fun dot(v: Vector3): Float Parameters
v:
Vector3 Returns
Float
|
equals
(
other
)
:
Boolean
|
Signature
open operator override fun equals(other: Any?): Boolean Parameters
other:
Any?
Returns
Boolean
|
hashCode
()
:
Int
|
Signature
open override fun hashCode(): Int Returns
Int
|
length
()
:
Float
|
Calculates the length (magnitude) of a vector.
Signature
fun length(): Float Returns
Float
|
lerp
(
dest
,
ratio
)
:
Vector3 |
Linearly interpolates between two vectors.
Signature
fun lerp(dest: Vector3, ratio: Float): Vector3 Parameters
dest:
Vector3
ratio:
Float
|
max
(
v
)
:
Vector3 | |
min
(
v
)
:
Vector3 | |
minus
(
v
)
:
Vector3 | |
multiply
(
v
)
:
Vector3 | |
multiply
(
v
)
:
Vector3 |
Multiplies a vector by a scalar.
Signature
inline fun multiply(v: Float): Vector3 Parameters
v:
Float
|
negate
()
:
Vector3 | |
normalize
()
:
Vector3 |
Normalizes a vector to have a length of 1
Signature
fun normalize(): Vector3 Returns
A new vector representing the normalization of this vector, or (0, 0, 0) if the length of this vector is 0.
|
plus
(
v
)
:
Vector3 | |
setX
(
x
)
:
Vector3 | |
setY
(
y
)
:
Vector3 | |
setZ
(
z
)
:
Vector3 | |
sub
(
v
)
:
Vector3 | |
times
(
v
)
:
Vector3 | |
times
(
v
)
:
Vector3 |
Multiplies a vector by a scalar.
Signature
inline operator fun times(v: Float): Vector3 Parameters
v:
Float
|
toString
()
:
String
|
Returns a string representation of the vector.
Signature
open override fun toString(): String Returns
String
|
unaryMinus
()
:
Vector3 |
Negates a vector.
Signature
inline operator fun unaryMinus(): Vector3 |