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

Method LookAt

core/node.go:679–687  ·  view source on GitHub ↗

LookAt rotates the node to look at the specified target position, using the specified up vector.

(target, up *math32.Vector3)

Source from the content-addressed store, hash-verified

677
678// LookAt rotates the node to look at the specified target position, using the specified up vector.
679func (n *Node) LookAt(target, up *math32.Vector3) {
680
681 var worldPos math32.Vector3
682 n.WorldPosition(&worldPos)
683 var rotMat math32.Matrix4
684 rotMat.LookAt(&worldPos, target, up)
685 n.quaternion.SetFromRotationMatrix(&rotMat)
686 n.rotNeedsUpdate = true
687}
688
689// SetScale sets the scale.
690func (n *Node) SetScale(x, y, z float32) {

Callers 1

RotateMethod · 0.45

Calls 3

WorldPositionMethod · 0.95
LookAtMethod · 0.95
SetFromRotationMatrixMethod · 0.45

Tested by

no test coverage detected