Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollisionCloserThan ¶
func CollisionCloserThan(r geometry.Ray, renderables []Renderable, t float64) bool
CollisionCloserThan checks if there was a collision with any shape on a ray closer than location t
Types ¶
type Collision ¶
type Collision struct { T float64 Renderable Renderable Location geometry.Vector Normal geometry.Vector // contains filtered or unexported fields }
Collision represents a Ray colliding with a Shape in 3D space
func ClosestCollision ¶
func ClosestCollision(ray geometry.Ray, renderables []Renderable) *Collision
ClosestCollision returns the closest collision to any Shape on Ray r. Closest means the shortest distance from the rays origin. If there was no collision, return nil
Click to show internal directories.
Click to hide internal directories.