narrowphase

package
Version: v0.0.0-...-344f55e Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectCircle

func DetectCircle(circle1 *geometry.Circle, transform1 *geometry.Transform, circle2 *geometry.Circle, transform2 *geometry.Transform) bool

func DetectCirclePenetration

func DetectCirclePenetration(circle1 *geometry.Circle, transform1 *geometry.Transform, circle2 *geometry.Circle, transform2 *geometry.Transform, penetration *Penetration) bool

func DistanceCircle

func DistanceCircle(circle1 *geometry.Circle, transform1 *geometry.Transform, circle2 *geometry.Circle, transform2 *geometry.Transform, separation *Separation) bool

func RaycastCircle

func RaycastCircle(ray *geometry.Ray, maxLength float64, circle *geometry.Circle, transform *geometry.Transform, raycast *Raycast) bool

func RaycastSegment

func RaycastSegment(ray *geometry.Ray, maxLength float64, segment *geometry.Segment, transform *geometry.Transform, raycast *Raycast) bool

Types

type AbstractFallbackCondition

type AbstractFallbackCondition struct {
	// contains filtered or unexported fields
}

func (*AbstractFallbackCondition) CompareTo

func (*AbstractFallbackCondition) GetSortIndex

func (a *AbstractFallbackCondition) GetSortIndex() int

func (*AbstractFallbackCondition) InitAbstractFallbackCondition

func (a *AbstractFallbackCondition) InitAbstractFallbackCondition(sortIndex int)

type DistanceDetector

type DistanceDetector interface {
	Distance(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform, separation *Separation) bool
}

type EPA

type EPA struct {
	// contains filtered or unexported fields
}

func NewEPA

func NewEPA() *EPA

func (*EPA) GetDistanceEpsilon

func (e *EPA) GetDistanceEpsilon() float64

func (*EPA) GetMaxIterations

func (e *EPA) GetMaxIterations() int

func (*EPA) GetPenetration

func (e *EPA) GetPenetration(simplex *[]*geometry.Vector2, minkowskiSum *MinkowskiSum, penetration *Penetration)

func (*EPA) SetDistanceEpsilon

func (e *EPA) SetDistanceEpsilon(distanceEpsilon float64)

func (*EPA) SetMaxIterations

func (e *EPA) SetMaxIterations(maxIterations int)

type EPAEdge

type EPAEdge struct {
	// contains filtered or unexported fields
}

type FallbackConditionSortable

type FallbackConditionSortable []FallbackConditioner

func (*FallbackConditionSortable) Len

func (f *FallbackConditionSortable) Len() int

func (*FallbackConditionSortable) Less

func (f *FallbackConditionSortable) Less(i, j int) bool

func (*FallbackConditionSortable) Swap

func (f *FallbackConditionSortable) Swap(i, j int)

type FallbackConditioner

type FallbackConditioner interface {
	IsMatch(convex1, convex2 geometry.Convexer) bool
	GetSortIndex() int
}

type FallbackNarrowphaseDetector

type FallbackNarrowphaseDetector struct {
	// contains filtered or unexported fields
}

func NewFallbackNarrowphaseDetector

func NewFallbackNarrowphaseDetector(primaryNarrowphaseDetector, fallbackNarrowphaseDetector NarrowphaseDetector) *FallbackNarrowphaseDetector

func NewFallbackNarrowphaseDetectorFallbackConditions

func NewFallbackNarrowphaseDetectorFallbackConditions(primaryNarrowphaseDetector, fallbackNarrowphaseDetector NarrowphaseDetector, conditions []FallbackConditioner) *FallbackNarrowphaseDetector

func (*FallbackNarrowphaseDetector) AddCondition

func (f *FallbackNarrowphaseDetector) AddCondition(condition FallbackConditioner)

func (*FallbackNarrowphaseDetector) ContainsCondition

func (f *FallbackNarrowphaseDetector) ContainsCondition(condition FallbackConditioner) bool

func (*FallbackNarrowphaseDetector) Detect

func (f *FallbackNarrowphaseDetector) Detect(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) bool

func (*FallbackNarrowphaseDetector) DetectPenetration

func (f *FallbackNarrowphaseDetector) DetectPenetration(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform, penetration *Penetration) bool

func (*FallbackNarrowphaseDetector) GetCondition

func (f *FallbackNarrowphaseDetector) GetCondition(index int) FallbackConditioner

func (*FallbackNarrowphaseDetector) GetConditionCount

func (f *FallbackNarrowphaseDetector) GetConditionCount() int

func (*FallbackNarrowphaseDetector) GetFallbackNarrowphaseDetector

func (f *FallbackNarrowphaseDetector) GetFallbackNarrowphaseDetector() NarrowphaseDetector

func (*FallbackNarrowphaseDetector) GetPrimaryNarrowphaseDetector

func (f *FallbackNarrowphaseDetector) GetPrimaryNarrowphaseDetector() NarrowphaseDetector

func (*FallbackNarrowphaseDetector) IsFallbackRequired

func (f *FallbackNarrowphaseDetector) IsFallbackRequired(convex1, convex2 geometry.Convexer) bool

func (*FallbackNarrowphaseDetector) RemoveCondition

func (f *FallbackNarrowphaseDetector) RemoveCondition(condition FallbackConditioner) bool

type GJK

type GJK struct {
	// contains filtered or unexported fields
}

func NewGJK

func NewGJK() *GJK

func NewGJKMinkowskiPenetrationSolver

func NewGJKMinkowskiPenetrationSolver(minkowskiPenetrationSolver MinkowskiPenetrationSolver) *GJK

func (*GJK) Detect

func (g *GJK) Detect(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) bool

func (*GJK) DetectPenetration

func (g *GJK) DetectPenetration(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform, penetration *Penetration) bool

func (*GJK) Distance

func (g *GJK) Distance(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform, separation *Separation) bool

func (*GJK) GetDistanceEpsilon

func (g *GJK) GetDistanceEpsilon() float64

func (*GJK) GetMaxIterations

func (g *GJK) GetMaxIterations() int

func (*GJK) GetMinkowskiPenetrationSolver

func (g *GJK) GetMinkowskiPenetrationSolver() MinkowskiPenetrationSolver

func (*GJK) Raycast

func (g *GJK) Raycast(ray *geometry.Ray, maxLength float64, convex geometry.Convexer, transform *geometry.Transform, raycast *Raycast) bool

func (*GJK) SetDistanceEpsilon

func (g *GJK) SetDistanceEpsilon(distanceEpsilon float64)

func (*GJK) SetMaxIterations

func (g *GJK) SetMaxIterations(maxIterations int)

func (*GJK) SetMinkowskiPenetrationSolver

func (g *GJK) SetMinkowskiPenetrationSolver(minkowskiPenetrationSolver MinkowskiPenetrationSolver)

type MinkowskiPenetrationSolver

type MinkowskiPenetrationSolver interface {
	GetPenetration(simplex *[]*geometry.Vector2, minkowskiSum *MinkowskiSum, penetration *Penetration)
}

type MinkowskiSum

type MinkowskiSum struct {
	// contains filtered or unexported fields
}

func NewMinkowskiSum

func NewMinkowskiSum(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) *MinkowskiSum

func (*MinkowskiSum) GetConvex1

func (m *MinkowskiSum) GetConvex1() geometry.Convexer

func (*MinkowskiSum) GetConvex2

func (m *MinkowskiSum) GetConvex2() geometry.Convexer

func (*MinkowskiSum) GetTransform1

func (m *MinkowskiSum) GetTransform1() *geometry.Transform

func (*MinkowskiSum) GetTransform2

func (m *MinkowskiSum) GetTransform2() *geometry.Transform

func (*MinkowskiSum) SetConvex1

func (m *MinkowskiSum) SetConvex1(convex1 geometry.Convexer)

func (*MinkowskiSum) SetConvex2

func (m *MinkowskiSum) SetConvex2(convex2 geometry.Convexer)

func (*MinkowskiSum) SetTransform1

func (m *MinkowskiSum) SetTransform1(transform1 *geometry.Transform)

func (*MinkowskiSum) SetTransform2

func (m *MinkowskiSum) SetTransform2(transform2 *geometry.Transform)

func (*MinkowskiSum) String

func (m *MinkowskiSum) String() string

func (*MinkowskiSum) Support

func (m *MinkowskiSum) Support(direction *geometry.Vector2) *geometry.Vector2

func (*MinkowskiSum) SupportMinkowskiSumPoint

func (m *MinkowskiSum) SupportMinkowskiSumPoint(direction *geometry.Vector2, p *MinkowskiSumPoint)

type MinkowskiSumPoint

type MinkowskiSumPoint struct {
	// contains filtered or unexported fields
}

func NewMinkowskiSumPoint

func NewMinkowskiSumPoint() *MinkowskiSumPoint

func NewMinkowskiSumPointVector2Vector2

func NewMinkowskiSumPointVector2Vector2(p1, p2 *geometry.Vector2) *MinkowskiSumPoint

func (*MinkowskiSumPoint) SetMinkowskiSumPoint

func (m *MinkowskiSumPoint) SetMinkowskiSumPoint(p *MinkowskiSumPoint)

func (*MinkowskiSumPoint) SetVector2s

func (m *MinkowskiSumPoint) SetVector2s(p1, p2 *geometry.Vector2)

type NarrowphaseDetector

type NarrowphaseDetector interface {
	DetectPenetration(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform, penetration *Penetration) bool
	Detect(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) bool
}

type PairwiseTypedFallbackCondition

type PairwiseTypedFallbackCondition struct {
	TypedFallbackCondition
	// contains filtered or unexported fields
}

func NewPairwiseTypedFallbackCondition

func NewPairwiseTypedFallbackCondition(type1, type2 reflect.Type) *PairwiseTypedFallbackCondition

func NewPairwiseTypedFallbackConditionInt

func NewPairwiseTypedFallbackConditionInt(type1, type2 reflect.Type, sortIndex int) *PairwiseTypedFallbackCondition

func (*PairwiseTypedFallbackCondition) IsMatch

func (p *PairwiseTypedFallbackCondition) IsMatch(type1, type2 reflect.Type) bool

type Penetration

type Penetration struct {
	// contains filtered or unexported fields
}

func NewPenetration

func NewPenetration() *Penetration

func (*Penetration) Clear

func (p *Penetration) Clear()

func (*Penetration) GetDepth

func (p *Penetration) GetDepth() float64

func (*Penetration) GetNormal

func (p *Penetration) GetNormal() *geometry.Vector2

func (*Penetration) SetDepth

func (p *Penetration) SetDepth(depth float64)

func (*Penetration) SetNormal

func (p *Penetration) SetNormal(normal *geometry.Vector2)

func (*Penetration) String

func (p *Penetration) String() string

type Raycast

type Raycast struct {
	// contains filtered or unexported fields
}

func NewRaycast

func NewRaycast() *Raycast

func NewRaycastVector2Vector2Float64

func NewRaycastVector2Vector2Float64(point, normal *geometry.Vector2, distance float64) *Raycast

func (*Raycast) Clear

func (r *Raycast) Clear()

func (*Raycast) GetDistance

func (r *Raycast) GetDistance() float64

func (*Raycast) GetNormal

func (r *Raycast) GetNormal() *geometry.Vector2

func (*Raycast) GetPoint

func (r *Raycast) GetPoint() *geometry.Vector2

func (*Raycast) SetDistance

func (r *Raycast) SetDistance(distance float64)

func (*Raycast) SetNormal

func (r *Raycast) SetNormal(normal *geometry.Vector2)

func (*Raycast) SetPoint

func (r *Raycast) SetPoint(point *geometry.Vector2)

type RaycastDetector

type RaycastDetector interface {
	Raycast(ray *geometry.Ray, maxLength float64, convex geometry.Convexer, transform *geometry.Transform, raycast *Raycast) bool
}

type SAT

type SAT struct{}

func (*SAT) Detect

func (s *SAT) Detect(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) bool

func (*SAT) DetectPenetration

func (s *SAT) DetectPenetration(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform, penetration *Penetration) bool

type Separation

type Separation struct {
	// contains filtered or unexported fields
}

func NewSeparation

func NewSeparation() *Separation

func NewSeparationVector2Float64Vector2Vector2

func NewSeparationVector2Float64Vector2Vector2(normal *geometry.Vector2, distance float64, point1, point2 *geometry.Vector2) *Separation

func (*Separation) Clear

func (s *Separation) Clear()

func (*Separation) GetDistance

func (s *Separation) GetDistance() float64

func (*Separation) GetNormal

func (s *Separation) GetNormal() *geometry.Vector2

func (*Separation) GetPoint1

func (s *Separation) GetPoint1() *geometry.Vector2

func (*Separation) GetPoint2

func (s *Separation) GetPoint2() *geometry.Vector2

func (*Separation) SetDistance

func (s *Separation) SetDistance(distance float64)

func (*Separation) SetNormal

func (s *Separation) SetNormal(normal *geometry.Vector2)

func (*Separation) SetPoint1

func (s *Separation) SetPoint1(point1 *geometry.Vector2)

func (*Separation) SetPoint2

func (s *Separation) SetPoint2(point2 *geometry.Vector2)

type SingleTypedFallbackCondition

type SingleTypedFallbackCondition struct {
	TypedFallbackCondition
	// contains filtered or unexported fields
}

func NewSingleTypedFallbackCondition

func NewSingleTypedFallbackCondition(compareType reflect.Type) *SingleTypedFallbackCondition

func NewSingleTypedFallbackConditionInt

func NewSingleTypedFallbackConditionInt(compareType reflect.Type, sortIndex int) *SingleTypedFallbackCondition

func (*SingleTypedFallbackCondition) IsMatch

func (s *SingleTypedFallbackCondition) IsMatch(type1, type2 reflect.Type) bool

type TypedFallbackCondition

type TypedFallbackCondition struct {
	AbstractFallbackCondition
}

func (*TypedFallbackCondition) InitTypedFallbackCondition

func (t *TypedFallbackCondition) InitTypedFallbackCondition()

func (*TypedFallbackCondition) InitTypedFallbackConditionInt

func (t *TypedFallbackCondition) InitTypedFallbackConditionInt(sortIndex int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL