MCPcopy
hub / github.com/g3n/engine / SetFromQuaternion

Method SetFromQuaternion

math32/vector3.go:634–640  ·  view source on GitHub ↗

SetFromQuaternion sets this vector components to the Euler angles from the specified quaternion Returns the pointer to this updated vector.

(q *Quaternion)

Source from the content-addressed store, hash-verified

632// from the specified quaternion
633// Returns the pointer to this updated vector.
634func (v *Vector3) SetFromQuaternion(q *Quaternion) *Vector3 {
635
636 matrix := NewMatrix4()
637 matrix.MakeRotationFromQuaternion(q)
638 v.SetFromRotationMatrix(matrix)
639 return v
640}
641
642// RandomTangents computes and returns two arbitrary tangents to the vector.
643func (v *Vector3) RandomTangents() (*Vector3, *Vector3) {

Callers 5

SetRotationXMethod · 0.80
SetRotationYMethod · 0.80
SetRotationZMethod · 0.80
RotationMethod · 0.80
WorldRotationMethod · 0.80

Calls 3

SetFromRotationMatrixMethod · 0.95
NewMatrix4Function · 0.85

Tested by

no test coverage detected