rectangle

package
v0.0.0-...-77601ef Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rectangle

type Rectangle struct {
	A                 geometry.Point `json:"a"`
	B                 geometry.Point `json:"b"`
	IsCulled          bool           `json:"is_culled"`
	HasNegativeNormal bool           `json:"has_negative_normal"`
	// contains filtered or unexported fields
}

Rectangle represents a Axis-Aligned rectangle geometry object

func Unit

func Unit(xOffset, yOffset, zOffset float64) *Rectangle

Unit return a unit rectangle

func (*Rectangle) BoundingBox

func (r *Rectangle) BoundingBox(t0, t1 float64) (*aabb.AABB, bool)

BoundingBox return an AABB of this object

func (*Rectangle) Copy

func (r *Rectangle) Copy() primitive.Primitive

Copy returns a shallow copy of this object

func (*Rectangle) Intersection

func (r *Rectangle) Intersection(ray geometry.Ray, tMin, tMax float64, rng *rand.Rand) (*material.RayHit, bool)

Intersection computer the intersection of this object and a given ray if it exists

func (*Rectangle) IsClosed

func (r *Rectangle) IsClosed() bool

IsClosed returns whether this object is closed

func (*Rectangle) IsInfinite

func (r *Rectangle) IsInfinite() bool

IsInfinite return whether this object is infinite

func (*Rectangle) SetMaterial

func (r *Rectangle) SetMaterial(m material.Material)

SetMaterial sets this object's material

func (*Rectangle) Setup

func (r *Rectangle) Setup() (*Rectangle, error)

Setup sets up internal fields in a rectangle

Jump to

Keyboard shortcuts

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