Click or drag to resize

Basis Methods

The Basis type exposes the following members.

Methods
  NameDescription
Public methodDeterminant
Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale. A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid.
Public methodEquals(Object) (Overrides ValueTypeEquals(Object).)
Public methodEquals(Basis)
Public methodGetAxis Obsolete.
Deprecated, please use the array operator instead.
Public methodGetColumn Obsolete.
Deprecated, please use the array operator instead.
Public methodGetEuler
Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when *decomposing*, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). Consider using the Quat method instead, which returns a Quat quaternion instead of Euler angles.
Public methodGetHashCode (Overrides ValueTypeGetHashCode.)
Public methodGetOrthogonalIndex
This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x, y, z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the GridMap editor. For further details, refer to the Godot source code.
Public methodGetRow
Get rows by index. Rows are not very useful for user code, but are more efficient for some internal calculations.
Public methodGetType (Inherited from Object.)
Public methodInverse
Returns the inverse of the matrix.
Public methodIsEqualApprox
Returns true if this basis and `other` are approximately equal, by running IsEqualApprox(Vector3) on each component.
Public methodOrthonormalized
Returns the orthonormalized version of the basis matrix (useful to call occasionally to avoid rounding errors for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix.
Public methodQuat
Returns the basis's rotation in the form of a quaternion. See GetEuler if you need Euler angles, but keep in mind that quaternions should generally be preferred to Euler angles.
Public methodRotated
Introduce an additional rotation around the given `axis` by `phi` (in radians). The axis must be a normalized vector.
Public methodRotationQuat
Public methodScaled
Introduce an additional scaling specified by the given 3D scaling factor.
Public methodSetColumn Obsolete.
Deprecated, please use the array operator instead.
Public methodSetRow
Sets rows by index. Rows are not very useful for user code, but are more efficient for some internal calculations.
Public methodSlerp
Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix.
Public methodTdotx
Transposed dot product with the X axis of the matrix.
Public methodTdoty
Transposed dot product with the Y axis of the matrix.
Public methodTdotz
Transposed dot product with the Z axis of the matrix.
Public methodToString (Overrides ValueTypeToString.)
Public methodToString(String)
Public methodTransposed
Returns the transposed version of the basis matrix.
Public methodXform
Returns a vector transformed (multiplied) by the basis matrix.
Public methodXformInv
Returns a vector transformed (multiplied) by the transposed basis matrix. Note: This results in a multiplication by the inverse of the basis matrix only if it represents a rotation-reflection.
Top
See Also