Documentation ¶
Index ¶
- func NewCircleZone() api.IZone
- func NewDragState() api.IDragging
- type AABB
- type CircleZone
- func (z *CircleZone) DistanceFromCenter(point api.IPoint) float64
- func (z *CircleZone) DistanceFromEdge(point api.IPoint) float64
- func (z *CircleZone) PointInside(point api.IPoint) int
- func (z *CircleZone) SetPosition(x, y float64)
- func (z *CircleZone) SetRadi(innerRadius, outerRadius float64)
- func (z *CircleZone) Update(position api.IPoint) (state int, stateChanged bool)
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AABB ¶
type AABB struct {
// contains filtered or unexported fields
}
AABB is an axis-aligned-bounding-box typically used for debug visuals but can be used for anything.
type CircleZone ¶
type CircleZone struct { Zone // contains filtered or unexported fields }
CircleZone is a trigger region or area with an inner and out circular boundary
func (*CircleZone) DistanceFromCenter ¶
func (z *CircleZone) DistanceFromCenter(point api.IPoint) float64
DistanceFromCenter returns distance from point to circle center
func (*CircleZone) DistanceFromEdge ¶
func (z *CircleZone) DistanceFromEdge(point api.IPoint) float64
DistanceFromEdge returns distance from point to outer radius
func (*CircleZone) PointInside ¶
func (z *CircleZone) PointInside(point api.IPoint) int
PointInside checks if point is inside either inner or outer radius
func (*CircleZone) SetPosition ¶
func (z *CircleZone) SetPosition(x, y float64)
SetPosition sets the center location of zone.
func (*CircleZone) SetRadi ¶
func (z *CircleZone) SetRadi(innerRadius, outerRadius float64)
SetRadi sets zone's inner and outer radi
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
Zone is a trigger region or area with an inner and out boundary Zones collect subscribers such that the subscribers can be notified of enter/exit states.
func (*Zone) InitializeZone ¶
func (z *Zone) InitializeZone()
InitializeZone initializes the base zone