MCPcopy Index your code
hub / github.com/g3n/engine / DistanceToSquared

Method DistanceToSquared

math32/vector3.go:375–381  ·  view source on GitHub ↗

DistanceToSquared returns the distance squared of this point to other.

(other *Vector3)

Source from the content-addressed store, hash-verified

373
374// DistanceToSquared returns the distance squared of this point to other.
375func (v *Vector3) DistanceToSquared(other *Vector3) float32 {
376
377 dx := v.X - other.X
378 dy := v.Y - other.Y
379 dz := v.Z - other.Z
380 return dx*dx + dy*dy + dz*dz
381}
382
383// SetLength sets this vector to have the specified length.
384// If the current length is zero, does nothing.

Callers 9

DistanceToMethod · 0.95
DistanceSqToPointMethod · 0.95
SetFromPointsMethod · 0.45
ContainsPointMethod · 0.45
IntersectSphereMethod · 0.45
ClampPointMethod · 0.45
DistanceSqMethod · 0.45
BoundingSphereMethod · 0.45
SphereSphereMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected