Companion

object Companion

Functions

Link copied to clipboard
fun fromList(list: List<Float>): Vec3<Float>
fun fromList(list: List<Int>): Vec3<Int>
fun fromList(list: List<Long>): Vec3<Long>

Returns an instance of Vec3 with the given list of coordinates.

fun <T : Number, Comparable<T>> fromList(list: List<T>, type: KClass<T>): Vec3<T>

Returns an instance of Vec3 with the given list of coordinates of given type.

Link copied to clipboard
fun fromSphericalCoordinates(distance: Double, longitude: Angle<Double>, latitude: Angle<Double>): Vec3<Double>
fun fromSphericalCoordinates(distance: Float, longitude: Angle<Float>, latitude: Angle<Float>): Vec3<Float>
fun <T : Number, Comparable<T>> fromSphericalCoordinates(distance: T, longitude: Angle<T>, latitude: Angle<T>, type: KClass<T>): Vec3<T>

Returns a 3D vector defined by its spherical coordinates: radial distance, longitude and latitude.

Link copied to clipboard
inline fun <T : Number, Comparable<T>> nullVector(): Vec3<T>

Returns a null vector.

fun <T : Number, Comparable<T>> nullVector(type: KClass<T>): Vec3<T>

Returns a null vector with coordinates of given type.

Link copied to clipboard
inline fun <T : Number, Comparable<T>> unitX(): Vec3<T>

Returns a standard unit vector in the direction of X axis.

fun <T : Number, Comparable<T>> unitX(type: KClass<T>): Vec3<T>

Returns a standard unit vector in the direction of X axis with coordinates of given type.

Link copied to clipboard
inline fun <T : Number, Comparable<T>> unitY(): Vec3<T>

Returns a standard unit vector in the direction of Y axis.

fun <T : Number, Comparable<T>> unitY(type: KClass<T>): Vec3<T>

Returns a standard unit vector in the direction of Y axis with coordinates of given type.

Link copied to clipboard
inline fun <T : Number, Comparable<T>> unitZ(): Vec3<T>

Returns a standard unit vector in the direction of Z axis.

fun <T : Number, Comparable<T>> unitZ(type: KClass<T>): Vec3<T>

Returns a standard unit vector in the direction of Z axis with coordinates of given type.

Properties

Link copied to clipboard

A null vector.

Link copied to clipboard

A standard unit vector in the direction of X axis.

Link copied to clipboard

A standard unit vector in the direction of Y axis.

Link copied to clipboard

A standard unit vector in the direction of Z axis.