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

Method Reflect

math32/vector3.go:566–570  ·  view source on GitHub ↗

Reflect sets this vector to its reflection relative to the normal vector. The normal vector is assumed to be normalized. Returns the pointer to this updated vector.

(normal *Vector3)

Source from the content-addressed store, hash-verified

564// The normal vector is assumed to be normalized.
565// Returns the pointer to this updated vector.
566func (v *Vector3) Reflect(normal *Vector3) *Vector3 {
567
568 var tmp Vector3
569 return v.Sub(tmp.Copy(normal).MultiplyScalar(2 * v.Dot(normal)))
570}
571
572// AngleTo returns the angle between this vector and other
573func (v *Vector3) AngleTo(other *Vector3) float32 {

Callers

nothing calls this directly

Calls 4

SubMethod · 0.95
CopyMethod · 0.95
DotMethod · 0.95
MultiplyScalarMethod · 0.45

Tested by

no test coverage detected