BoundingVolume

package
v0.0.0-...-9749107 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: GPL-3.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

View Source
const (
	Yaml_key_aabb   = "AABB"
	Yaml_key_sphere = "sphere"
	Yaml_key_point  = "point"
	Yaml_key_empty  = ""
)

Variables

This section is empty.

Functions

func IntersectionAABBAndPoint

func IntersectionAABBAndPoint(box AABB, point Point) bool

func IntersectionAABBandAABB

func IntersectionAABBandAABB(box1, box2 AABB) bool

func IntersectionPointAndPoint

func IntersectionPointAndPoint(point1, point2 Point) bool

func IntersectionSphereAndAABB

func IntersectionSphereAndAABB(sphere Sphere, box AABB) bool

func IntersectionSphereAndPoint

func IntersectionSphereAndPoint(sphere Sphere, point Point) bool

func IntersectionSphereAndSphere

func IntersectionSphereAndSphere(sphere1, sphere2 Sphere) bool

Types

type AABB

type AABB struct {
	Min GeometryMath.Vector3 `yaml:"min"`
	Max GeometryMath.Vector3 `yaml:"max"`
}

func NewAABB

func NewAABB(vertices []GeometryMath.Vector3) AABB

func NewDefaultAABB

func NewDefaultAABB() AABB

func (AABB) GetCenter

func (aabb AABB) GetCenter() GeometryMath.Vector3

func (AABB) IntersectsWith

func (aabb AABB) IntersectsWith(volume IBoundingVolume) bool

func (AABB) Transform

func (aabb AABB) Transform(mat GeometryMath.Matrix4x4) IBoundingVolume

type IBoundingVolume

type IBoundingVolume interface {
	GetCenter() GeometryMath.Vector3
	Transform(mat GeometryMath.Matrix4x4) IBoundingVolume
	IntersectsWith(volume IBoundingVolume) bool
}

func NewBoundingVolumeAABB

func NewBoundingVolumeAABB(vertices []GeometryMath.Vector3) IBoundingVolume

func NewBoundingVolumeSphere

func NewBoundingVolumeSphere(vertices []GeometryMath.Vector3) IBoundingVolume

type ICollisionObject

type ICollisionObject interface {
	GetBoundingVolume() IBoundingVolume
}

type Point

type Point GeometryMath.Vector3

func NewDefaultPoint

func NewDefaultPoint() Point

func (Point) GetCenter

func (point Point) GetCenter() GeometryMath.Vector3

func (Point) IntersectsWith

func (point Point) IntersectsWith(volume IBoundingVolume) bool

func (Point) Transform

func (point Point) Transform(mat GeometryMath.Matrix4x4) IBoundingVolume

func (Point) X

func (point Point) X() float32

func (Point) Y

func (point Point) Y() float32

func (Point) Z

func (point Point) Z() float32

type Ptr

type Ptr struct {
	IBoundingVolume
}

func (*Ptr) UnmarshalYAML

func (ptr *Ptr) UnmarshalYAML(value *yaml.Node) error

type Sphere

type Sphere struct {
	Center GeometryMath.Vector3 `yaml:"center"`
	Radius float32              `yaml:"radius"`
}

func NewDefaultSphere

func NewDefaultSphere() Sphere

func NewSphere

func NewSphere(vertices []GeometryMath.Vector3) Sphere

func NewSphereWithCenter

func NewSphereWithCenter(center GeometryMath.Vector3, vertices []GeometryMath.Vector3) Sphere

func (Sphere) GetCenter

func (sphere Sphere) GetCenter() GeometryMath.Vector3

func (Sphere) IntersectsWith

func (sphere Sphere) IntersectsWith(volume IBoundingVolume) bool

func (Sphere) Transform

func (sphere Sphere) Transform(mat GeometryMath.Matrix4x4) IBoundingVolume

Jump to

Keyboard shortcuts

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