Documentation ¶
Index ¶
- func AbsElem(a r3.Vec) r3.Vec
- func CeilElem(a r3.Vec) r3.Vec
- func Clamp(x, a, b r3.Vec) r3.Vec
- func CosElem(a r3.Vec) r3.Vec
- func DivElem(a, b r3.Vec) r3.Vec
- func Elem(sides float64) r3.Vec
- func EqualWithin(a, b r3.Vec, tol float64) bool
- func FromR2(v r2.Vec, z float64) r3.Vec
- func LTEZero(a r3.Vec) bool
- func LTZero(a r3.Vec) bool
- func Max(a r3.Vec) float64
- func MaxElem(a, b r3.Vec) r3.Vec
- func Min(a r3.Vec) float64
- func MinElem(a, b r3.Vec) r3.Vec
- func MulElem(a, b r3.Vec) r3.Vec
- func SinElem(a r3.Vec) r3.Vec
- type Box
- func (a Box) Center() r3.Vec
- func (a Box) Contains(v r3.Vec) bool
- func (a Box) Enlarge(v r3.Vec) Box
- func (a Box) Equals(b Box, tol float64) bool
- func (a Box) Extend(b Box) Box
- func (a Box) Include(v r3.Vec) Box
- func (a Box) MinMaxDist2(p r3.Vec) (min, max float64)
- func (b *Box) Random() r3.Vec
- func (b *Box) RandomSet(n int) Set
- func (a Box) ScaleAboutCenter(k float64) Box
- func (a Box) Size() r3.Vec
- func (a Box) Translate(v r3.Vec) Box
- func (a Box) Vertices() Set
- type Set
- type Transform
- func (t Transform) Det() float64
- func (t Transform) Inv() Transform
- func (t Transform) Mul(b Transform) Transform
- func (t Transform) Scale(origin, factor r3.Vec) Transform
- func (t Transform) SliceCopy() []float64
- func (t Transform) Transform(v r3.Vec) r3.Vec
- func (t Transform) Translate(v r3.Vec) Transform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Box ¶
d3.Box is a 3d bounding box.
func CenteredBox ¶
CenteredBox creates a Box with a given center and size. Negative components of size will be interpreted as zero.
func (Box) Contains ¶
Contains checks if the 3d box contains the given vector (considering bounds as inside).
func (Box) MinMaxDist2 ¶
MinMaxDist2 returns the minimum and maximum dist * dist from a point to a box. Points within the box have minimum distance = 0.
func (Box) ScaleAboutCenter ¶
ScaleAboutCenter returns a new 3d box scaled about the center of a box.
type Transform ¶
type Transform struct {
// contains filtered or unexported fields
}
Transform represents a 3D spatial transformation. The zero value of Transform is the identity transform.
func ComposeTransform ¶
ComposeTransform creates a new transform for a given translation to positon, scaling vector scale and quaternion rotation. The identity Transform is constructed with
ComposeTransform(Vec{}, Vec{1,1,1}, Rotation{})
func NewTransform ¶
NewTransform returns a new Transform type and populates its elements with values passed in row-major form. If val is nil then NewTransform returns a Transform filled with zeros.
func (Transform) Inv ¶
Inv returns the inverse of the transform such that t.Inv() * t is the identity Transform. If matrix is singular then Inv() returns the zero transform.
func (Transform) Mul ¶
Mul multiplies the Transforms a and b and returns the result. This is the equivalent of combining two transforms in one.
func (Transform) SliceCopy ¶
SliceCopy returns a copy of the Transform's data in row major storage format. It returns 16 elements.