Basis

gdext.builtin.Basis
See theBasis companion object
final case class Basis(xx: Float, xy: Float, xz: Float, yx: Float, yy: Float, yz: Float, zx: Float, zy: Float, zz: Float)

Godot's Basis: a 3x3 matrix, stored flat so one value is one object.

Fields are named by column, as in GDScript: column x is (xx, xy, xz), y is (yx, yy, yz), z is (zx, zy, zz). The engine stores rows, so row 0 is (xx, yx, zx). Euler order values follow Godot's EulerOrder (0 XYZ, 1 XZY, 2 YXZ, 3 YZX, 4 ZXY, 5 ZYX).

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def *(v: Vector3): Vector3
def *(o: Basis): Basis

Composition: o first, then this.

Composition: o first, then this.

Attributes

def *(s: Float): Basis
def /(s: Float): Basis
def column(i: Int): Vector3
def determinant: Float
def el(r: Int, c: Int): Float

Element at row r, column c.

Element at row r, column c.

Attributes

def getEuler(order: Long = ...): Vector3

The rotation as a quaternion; assumes this basis is a pure rotation.

The rotation as a quaternion; assumes this basis is a pure rotation.

Attributes

The rotation part, with any scale and reflection removed.

The rotation part, with any scale and reflection removed.

Attributes

def inverse: Basis
def isConformal: Boolean
def isEqualApprox(b: Basis): Boolean
def isFinite: Boolean
def rotated(axis: Vector3, angle: Float): Basis

Rotate around a normalized axis (left-multiplies the rotation).

Rotate around a normalized axis (left-multiplies the rotation).

Attributes

def row(i: Int): Vector3
def scaled(scale: Vector3): Basis

Scale rows: the global-space scale.

Scale rows: the global-space scale.

Attributes

def scaledLocal(scale: Vector3): Basis

Scale columns: the local-space scale.

Scale columns: the local-space scale.

Attributes

def slerp(to: Basis, weight: Float): Basis
def tdotx(v: Vector3): Float

Column x dotted with v.

Column x dotted with v.

Attributes

def tdoty(v: Vector3): Float

Column y dotted with v.

Column y dotted with v.

Attributes

def tdotz(v: Vector3): Float

Column z dotted with v.

Column z dotted with v.

Attributes

def x: Vector3

Column x (the basis' X axis).

Column x (the basis' X axis).

Attributes

def xform(v: Vector3): Vector3
def y: Vector3

Column y (the basis' Y axis).

Column y (the basis' Y axis).

Attributes

def z: Vector3

Column z (the basis' Z axis).

Column z (the basis' Z axis).

Attributes

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product