struct Sphere

Represents a sphere in 3D space! Composed of a center point and a radius, can be used for raycasting, collision, visibility, and other things!

Instance Fields and Properties

   
Vec3 center Center of the sphere.
float Diameter Length of the line passing through the center from one side of the sphere to the other, in meters. Twice the radius.
float radius Distance from the center, to the surface of the sphere, in meters. Half the diameter.

Instance Methods

   
Sphere Creates a sphere using a center point and a diameter!
Contains A fast check to see if the given point is contained in or on a sphere!
Intersect Intersects a ray with this sphere, and finds if they intersect, and if so, where that intersection is! This only finds the closest intersection point to the origin of the ray.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!