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

Method TranslateOnAxis

core/node.go:522–529  ·  view source on GitHub ↗

TranslateOnAxis translates the specified distance on the specified local axis.

(axis *math32.Vector3, dist float32)

Source from the content-addressed store, hash-verified

520
521// TranslateOnAxis translates the specified distance on the specified local axis.
522func (n *Node) TranslateOnAxis(axis *math32.Vector3, dist float32) {
523
524 v := math32.NewVec3().Copy(axis)
525 v.ApplyQuaternion(&n.quaternion)
526 v.MultiplyScalar(dist)
527 n.position.Add(v)
528 n.matNeedsUpdate = true
529}
530
531// TranslateX translates the specified distance on the local X axis.
532func (n *Node) TranslateX(dist float32) {

Callers 3

TranslateXMethod · 0.95
TranslateYMethod · 0.95
TranslateZMethod · 0.95

Calls 5

NewVec3Function · 0.92
ApplyQuaternionMethod · 0.80
CopyMethod · 0.45
MultiplyScalarMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected