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

Method DistanceToPoint

math32/sphere.go:78–81  ·  view source on GitHub ↗

DistanceToPoint returns the distance from the sphere surface to the specified point.

(point *Vector3)

Source from the content-addressed store, hash-verified

76
77// DistanceToPoint returns the distance from the sphere surface to the specified point.
78func (s *Sphere) DistanceToPoint(point *Vector3) float32 {
79
80 return point.DistanceTo(&s.Center) - s.Radius
81}
82
83// IntersectSphere returns if other sphere intersects this one.
84func (s *Sphere) IntersectSphere(other *Sphere) bool {

Callers

nothing calls this directly

Calls 1

DistanceToMethod · 0.45

Tested by

no test coverage detected