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

Method Normalize

math32/plane.go:77–83  ·  view source on GitHub ↗

Normalize normalizes this plane normal vector and adjusts the constant. Note: will lead to a divide by zero if the plane is invalid. Returns pointer to this updated plane.

()

Source from the content-addressed store, hash-verified

75// Note: will lead to a divide by zero if the plane is invalid.
76// Returns pointer to this updated plane.
77func (p *Plane) Normalize() *Plane {
78
79 inverseNormalLength := 1.0 / p.normal.Length()
80 p.normal.MultiplyScalar(inverseNormalLength)
81 p.constant *= inverseNormalLength
82 return p
83}
84
85// Negate negates this plane normal.
86// Returns pointer to this updated plane.

Callers 15

SetFromCoplanarPointsMethod · 0.45
ClampPointMethod · 0.45
DistanceSqToSegmentMethod · 0.45
ApplyMatrix4Method · 0.45
SetFromMatrixMethod · 0.45
PanMethod · 0.45
NewTubeFunction · 0.45
NewSphereSectorFunction · 0.45
ApplyMatrixMethod · 0.45
NewTruncatedConeSectorFunction · 0.45
NewTorusFunction · 0.45

Calls 2

LengthMethod · 0.45
MultiplyScalarMethod · 0.45

Tested by

no test coverage detected