renderable

package
v0.0.0-...-e407d5c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 3 Imported by: 0

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

type Renderable

type Renderable struct {
	Shape    shape.Shape
	Material material.Material
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL