Documentation ¶
Index ¶
Constants ¶
View Source
const EPSILON = 0.000000001
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quadrilateral ¶
type Quadrilateral struct { Shape Vertices [4]geometry.Vector // contains filtered or unexported fields }
func NewQuadrilateral ¶
func NewQuadrilateral(vertices [4]geometry.Vector) Quadrilateral
func (Quadrilateral) CheckForCollision ¶
func (quad Quadrilateral) CheckForCollision(ray geometry.Ray) (Shape, float64)
func (Quadrilateral) RandomLocationOn ¶
func (quad Quadrilateral) RandomLocationOn() geometry.Vector
func (Quadrilateral) String ¶
func (quad Quadrilateral) String() string
type Shape ¶
type Shape interface { // CheckForCollision determines if a Ray collides with this shape CheckForCollision(ray geometry.Ray) (Shape, float64) // NormalAtLocation calculates the normal vector at a given location on this shape NormalAtLocation(loc geometry.Vector) geometry.Vector // RandomLocationOn return a random location on the surface of the shape RandomLocationOn() geometry.Vector }
Shape represents a shape in 3D space
type Sphere ¶
func (Sphere) CheckForCollision ¶
func (Sphere) NormalAtLocation ¶
func (Sphere) RandomLocationOn ¶
type Triangle ¶
type Triangle struct { Shape Vertices [3]geometry.Vector // contains filtered or unexported fields }
func (Triangle) CheckForCollision ¶
func (Triangle) NormalAtLocation ¶
func (Triangle) RandomLocationOn ¶
Click to show internal directories.
Click to hide internal directories.