bound

package
v0.0.0-...-ec9fd1c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2012 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package bound provides a bounding box type, along with various manipulation operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bound

type Bound struct {
	Min, Max vec64.Vector
}

Bound is a simple bounding box.

func Union

func Union(b1, b2 Bound) Bound

Union creates a new bounding box that contains the two bounds.

func (Bound) Center

func (b Bound) Center() vec64.Vector

func (Bound) Cross

func (b Bound) Cross(from, ray vec64.Vector, dist float64) (lmin, lmax float64, crosses bool)

Cross checks whether a given ray crosses the bound. from specifies a point where the ray starts. ray specifies the direction the ray is in. dist is the maximum distance that this method will check. Pass in math.Inf(1) to remove the check.

func (Bound) Grow

func (b Bound) Grow(d float64) Bound

Grow increases the size of the bounding box by d on all sides. The center will remain the same.

func (Bound) HalfSize

func (b Bound) HalfSize() [3]float64

func (Bound) Include

func (b Bound) Include(p vec64.Vector) Bound

Include modifies the bounding box so that it contains the specified point.

func (Bound) Includes

func (b Bound) Includes(p vec64.Vector) bool

Includes returns whether a given point is in the bounding box.

func (Bound) IsZero

func (b Bound) IsZero() bool

IsZero returns whether the bound is the zero bound. This is not the same as being empty.

func (Bound) LargestAxis

func (b Bound) LargestAxis() vecutil.Axis

func (Bound) Size

func (b Bound) Size() [3]float64

func (Bound) String

func (b Bound) String() string

func (Bound) Volume

func (b Bound) Volume() float64

Volume calculates the volume of the bounding box

Jump to

Keyboard shortcuts

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