Documentation
¶
Index ¶
- Variables
- func ClampLength[A Attr[A]](value A, min float32, max float32) A
- func Closest[A Attr[A]](start A, end A, point A, line bool) A
- func CubicCurve[A Attr[A]](delta float32, p0 A, p1 A, p2 A, p3 A, matrix [4][4]float32, inverse bool) A
- func Delta[A Attr[A]](start A, end A, point A) float32
- func DistanceFrom[A Attr[A]](start A, end A, point A, line bool) float32
- func GetNormalizedDistances[T Attr[T]](points []AnimValue[T]) []float32
- func GetTriangleHeight(base float32, side1 float32, side2 float32) float32
- func InterceptTime[A Attr[A]](interceptor A, interceptorSpeed float32, targetPosition A, targetVelocity A) float32
- func IsCircleInView[A Attr[A]](viewOrigin A, viewDirection A, fovTan float32, fovCos float32, circle A, ...) bool
- func IsCircleInViewType[A Attr[A]](viewOrigin A, viewDirection A, fovTan float32, fovCos float32, circle A, ...) bool
- func IsNormal[A Attr[A]](value A) bool
- func IsPointInView[A Attr[A]](viewOrigin A, viewDirection A, fovCos float32, point A) bool
- func Lengthen[A Attr[A]](value A, length float32) A
- func NewBehaviorSystem[B any]() ecs.DataSystem[B]
- func NewInputActionSystem(unhandled input.ActionHandler) ecs.DataSystem[InputActionListener]
- func NewInputEventsSystem() ecs.DataSystem[InputEvents]
- func NewLogicSystem() ecs.DataSystem[Logic]
- func NewTransformSystem[A Attr[A]]() ecs.DataSystem[Transform[A]]
- func NewTransformSystem3f() ecs.DataSystem[Transform3f]
- func NewTransformSystem4f() ecs.DataSystem[Transform4f]
- func NewUserInterfaceSystem() ecs.DataSystem[UserInterface]
- func Normalize[A Attr[A]](value A, normal *A) float32
- func ParametricCubicCurve[A Attr[A]](delta float32, points []A, matrix [4][4]float32, weight float32, inverse bool, ...) A
- func Reflect[A Attr[A]](dir A, normal A) A
- func Refract[A Attr[A]](dir A, normal A) A
- func Resolve[T any](value any) T
- func Slerp[A Attr[A]](start A, end A, t float32) A
- func SlerpAngle[A Attr[A]](start A, end A, angle float32, t float32) A
- func SlerpNormal[A Attr[A]](start A, end A, t float32) A
- type AnimConstant
- type AnimValue
- type AssetSystem
- type Attr
- type AudioAmbience
- type AudioAmbienceOption
- type AudioAttenuation
- type AudioData
- type AudioEmitter
- type AudioInstance
- type AudioInstanceSettings
- type AudioListener
- type AudioRequest
- type AudioSettings
- type AudioSource
- type AudioSystem
- type AudioVirtualOp
- type BehaviorOnLive
- type BehaviorOnRemove
- type BehaviorOnStage
- type BehaviorOnUpdate
- type BehaviorSystem
- func (sys BehaviorSystem[B]) Destroy(ctx ecs.Context)
- func (sys BehaviorSystem[B]) Init(ctx ecs.Context) error
- func (sys BehaviorSystem[B]) OnLive(data *B, e *ecs.Entity, ctx ecs.Context)
- func (sys BehaviorSystem[B]) OnRemove(data *B, e *ecs.Entity, ctx ecs.Context)
- func (sys BehaviorSystem[B]) OnStage(data *B, e *ecs.Entity, ctx ecs.Context)
- func (sys BehaviorSystem[B]) Update(iter ds.Iterable[ecs.Value[*B]], ctx ecs.Context)
- type Bounds
- func (b Bounds[A]) Bounds(bounds *Bounds[A]) bool
- func (b Bounds[A]) Corner(cornerIndex int) A
- func (b Bounds[A]) CornerCount() int
- func (b Bounds[A]) Corners() []A
- func (b Bounds[A]) Distance(point A) float32
- func (b Bounds[A]) DistanceSq(point A) float32
- func (b Bounds[A]) Finite() bool
- func (b Bounds[A]) Normal(point A, out *A) bool
- func (b Bounds[A]) PlaneSign(plane Plane[A]) PlaneSign
- func (b Bounds[A]) Raytrace(point A, direction A) bool
- func (b Bounds[A]) Round(round *Round[A]) bool
- func (b Bounds[A]) Transform(shapeTransform Trans[A]) Shape[A]
- type Bounds2f
- type Camera
- type Camera2d
- type Camera3d
- type Circle
- type Computed
- type DebugEvent
- type DebugGraph
- type DebugLog
- type DebugProfiler
- type DebugSnapshot
- type DebugSystem
- type Dynamic
- type EventSystem
- type Face
- type FieldOfView
- type FontBitmapFormat
- func (loader *FontBitmapFormat) Activate(a *asset.Asset) error
- func (loader *FontBitmapFormat) Deactivate(a *asset.Asset) error
- func (loader *FontBitmapFormat) Handles(ref asset.Ref) bool
- func (loader *FontBitmapFormat) Load(a *asset.Asset) error
- func (loader *FontBitmapFormat) Types() []asset.Type
- func (loader *FontBitmapFormat) Unload(a *asset.Asset) error
- type Game
- type GameSettings
- type GameState
- type GameSystem
- type GraphicsSystem
- type InputActionListener
- type InputActionSystem
- func (sys *InputActionSystem) Destroy(ctx ecs.Context)
- func (sys *InputActionSystem) Init(ctx ecs.Context) error
- func (sys InputActionSystem) OnLive(data *InputActionListener, e *ecs.Entity, ctx ecs.Context)
- func (sys InputActionSystem) OnRemove(data *InputActionListener, e *ecs.Entity, ctx ecs.Context)
- func (sys InputActionSystem) OnStage(data *InputActionListener, e *ecs.Entity, ctx ecs.Context)
- func (sys *InputActionSystem) Update(iter ds.Iterable[ecs.Value[*InputActionListener]], ctx ecs.Context)
- type InputEvents
- type InputEventsSystem
- func (sys *InputEventsSystem) Destroy(ctx ecs.Context)
- func (sys *InputEventsSystem) Init(ctx ecs.Context) error
- func (sys InputEventsSystem) OnLive(data *InputEvents, e *ecs.Entity, ctx ecs.Context)
- func (sys InputEventsSystem) OnRemove(data *InputEvents, e *ecs.Entity, ctx ecs.Context)
- func (sys InputEventsSystem) OnStage(data *InputEvents, e *ecs.Entity, ctx ecs.Context)
- func (sys *InputEventsSystem) Update(iter ds.Iterable[ecs.Value[*InputEvents]], ctx ecs.Context)
- type InputSystem
- type Integer
- type Light
- type LightAttenuate
- type Line
- type Logic
- type LogicSystem
- func (sys LogicSystem) Destroy(ctx ecs.Context)
- func (sys LogicSystem) Init(ctx ecs.Context) error
- func (sys LogicSystem) OnLive(data *Logic, e *ecs.Entity, ctx ecs.Context)
- func (sys LogicSystem) OnRemove(data *Logic, e *ecs.Entity, ctx ecs.Context)
- func (sys LogicSystem) OnStage(data *Logic, e *ecs.Entity, ctx ecs.Context)
- func (sys LogicSystem) Update(iter ds.Iterable[ecs.Value[*Logic]], ctx ecs.Context)
- type Mat
- type Mat2d
- type Mat3d
- func (m *Mat3d) Determinant() float32
- func (m *Mat3d) Get() []float32
- func (m *Mat3d) Identity()
- func (m *Mat3d) Invert()
- func (m *Mat3d) Multiply(other Mat[Vec3d])
- func (m *Mat3d) Ortho(left, right, bottom, top float32)
- func (m *Mat3d) Perpsective(fov, aspectRatio, near, far float32)
- func (m *Mat3d) Set(values []float32)
- func (m *Mat3d) Transform(v Vec3d) Vec3d
- func (m *Mat3d) TransformVector(v Vec3d) Vec3d
- type Material
- type Materials
- type Matrix
- func (m *Matrix[A]) Adjoint(other Matrix[A])
- func (m *Matrix[A]) Cofactor(other Matrix[A])
- func (m *Matrix[A]) Col(index int) A
- func (m *Matrix[A]) Determinant() float32
- func (m Matrix[A]) GetValues() [][]float32
- func (m *Matrix[A]) Identity()
- func (m *Matrix[A]) Invert(other Matrix[A])
- func (m *Matrix[A]) Minor(other Matrix[A])
- func (m *Matrix[A]) Mul(base Matrix[A], other Matrix[A])
- func (m *Matrix[A]) PostTranslate(translation A)
- func (m *Matrix[A]) Rotate(radians A, hasTranslation bool)
- func (m *Matrix[A]) Row(index int) A
- func (m *Matrix[A]) Scale(scale A)
- func (m *Matrix[A]) Set(other Matrix[A])
- func (m *Matrix[A]) SetAxisRotaton(radians float32, axis int, hasTranslation bool)
- func (m *Matrix[A]) SetCol(index int, col A)
- func (m *Matrix[A]) SetRotaton(radians A, hasTranslation bool)
- func (m *Matrix[A]) SetRow(index int, row A)
- func (m *Matrix[A]) SetScale(scale A)
- func (m *Matrix[A]) SetTranslation(translation A)
- func (m *Matrix[A]) SetValues(values [][]float32)
- func (m Matrix[A]) Size() int
- func (m Matrix[A]) Transform(point A) A
- func (m Matrix[A]) TransformVector(point A) A
- func (m *Matrix[A]) Translate(translation A)
- func (m *Matrix[A]) Transpose(other Matrix[A])
- func (m *Matrix[A]) Zero()
- type Matrix2f
- type Matrix3f
- type Matrix4f
- type Mesh
- type MeshData
- type MeshFaceGroup
- type MtlFormat
- func (format *MtlFormat) Activate(asset *asset.Asset) error
- func (format *MtlFormat) Deactivate(asset *asset.Asset) error
- func (format *MtlFormat) Handles(ref asset.Ref) bool
- func (format *MtlFormat) Load(a *asset.Asset) error
- func (format *MtlFormat) Types() []asset.Type
- func (format *MtlFormat) Unload(asset *asset.Asset) error
- type NoAudioSystem
- func (audio *NoAudioSystem) Destroy()
- func (audio *NoAudioSystem) EntitySystem() ecs.DataSystem[AudioEmitter]
- func (audio *NoAudioSystem) Init(game *Game) error
- func (audio *NoAudioSystem) Instances() []AudioInstance
- func (audio *NoAudioSystem) Listeners() []AudioListener
- func (audio *NoAudioSystem) Settings() map[string]AudioSettings
- func (audio *NoAudioSystem) Sources() []AudioSource
- func (audio *NoAudioSystem) Update(game *Game)
- type NoGraphicsSystem
- type NoInputSystem
- type NoWindowSystem
- func (windows *NoWindowSystem) Destroy()
- func (windows *NoWindowSystem) Events() *core.Listeners[WindowSystemEvents]
- func (windows *NoWindowSystem) Init(game *Game) error
- func (windows *NoWindowSystem) MainWindow() Window
- func (windows *NoWindowSystem) Screens() []Screen
- func (windows *NoWindowSystem) Update(game *Game)
- func (windows *NoWindowSystem) Windows() []Window
- type Numeric
- type NumericRange
- type ObjFormat
- func (format *ObjFormat) Activate(asset *asset.Asset) error
- func (format *ObjFormat) Deactivate(asset *asset.Asset) error
- func (format *ObjFormat) Handles(ref asset.Ref) bool
- func (format *ObjFormat) Load(asset *asset.Asset) error
- func (format *ObjFormat) Types() []asset.Type
- func (format *ObjFormat) Unload(asset *asset.Asset) error
- type Path
- type PathDelta
- type PathFlag
- type PathLinear
- type PathPoint
- type Plane
- type Plane2d
- func (p *Plane2d) Distance(point Vec2d) float32
- func (p *Plane2d) GetNormal() Vec2d
- func (p *Plane2d) GetPoint() Vec2d
- func (p *Plane2d) Intersection(plane Plane[Vec2d], out *Vec2d) bool
- func (p *Plane2d) SetPointNormal(point Vec2d, normal Vec2d)
- func (p *Plane2d) SetPoints(points []Vec2d)
- func (p *Plane2d) Sign(point Vec2d) PlaneSign
- type Plane3d
- func (p *Plane3d) Clip(line Line[Vec3d], side PlaneSign) *Line[Vec3d]
- func (p *Plane3d) Distance(point Vec3d) float32
- func (p *Plane3d) DistanceLine(line Line[Vec3d]) float32
- func (p *Plane3d) DistanceRound(round Round[Vec3d]) float32
- func (p *Plane3d) GetNormal() Vec3d
- func (p *Plane3d) GetPoint() Vec3d
- func (p *Plane3d) Intersection(plane Plane[Vec3d], out *Line[Vec3d]) bool
- func (p *Plane3d) SetPointNormal(point Vec3d, normal Vec3d)
- func (p *Plane3d) SetPoints(points []Vec3d)
- func (p *Plane3d) Sign(point Vec3d) PlaneSign
- func (p *Plane3d) SignPoints(points []Vec3d) PlaneSign
- type PlaneSign
- type ProjectionOutside
- type Quat
- func (q Quat) Add(value Quat, out *Quat)
- func (q Quat) AddScaled(value Quat, amount float32, out *Quat)
- func (q1 Quat) AngleBetween(q2 Quat) float32
- func (q Quat) Components() int
- func (q *Quat) Conjugate()
- func (q Quat) Distance(other Quat) float32
- func (q Quat) DistanceSq(other Quat) float32
- func (a Quat) Div(b Quat, out *Quat)
- func (q1 Quat) Dot(q2 Quat) float32
- func (q Quat) GetAngle() (dir Vec3f, angle float32)
- func (q Quat) GetComponent(index int) float32
- func (q Quat) GetEuler() Vec3f
- func (q *Quat) Invert()
- func (q Quat) Length() float32
- func (q Quat) LengthSq() float32
- func (start Quat) Lerp(end Quat, delta float32, out *Quat)
- func (a Quat) Mul(b Quat, out *Quat)
- func (q *Quat) Multiply(a Quat, b Quat)
- func (q *Quat) MultiplyValues(aX, aY, aZ, aW, bX, bY, bZ, bW float32)
- func (q *Quat) Normal() float32
- func (q Quat) Rotate(v Vec3f, out *Vec3f)
- func (q *Quat) RotateAround(point Vec3f, angle float32, axis Vec3f)
- func (q Quat) Scale(amount float32, out *Quat)
- func (q Quat) Set(out *Quat)
- func (q *Quat) SetAngle(dir Vec3f, angle float32)
- func (q Quat) SetComponent(index int, value float32, out *Quat)
- func (q Quat) SetComponents(value float32, out *Quat)
- func (q *Quat) SetEuler(yaw float32, pitch float32, roll float32)
- func (q *Quat) Sets(X, Y, Z, W float32)
- func (q *Quat) Slerp(q1 Quat, q2 Quat, delta float32)
- func (q Quat) Sub(subtrahend Quat, out *Quat)
- func (q *Quat) ToMatrix(m Matrix4f)
- type Range
- type RenderTarget
- type Round
- type Scalar
- func (s Scalar[D]) Add(addend Scalar[D], out *Scalar[D])
- func (s Scalar[D]) AddScaled(value Scalar[D], scale float32, out *Scalar[D])
- func (s Scalar[D]) Components() int
- func (s Scalar[D]) Distance(value Scalar[D]) float32
- func (s Scalar[D]) DistanceSq(value Scalar[D]) float32
- func (s Scalar[D]) Div(factor Scalar[D], out *Scalar[D])
- func (s Scalar[D]) Dot(value Scalar[D]) float32
- func (s Scalar[D]) GetComponent(index int) float32
- func (s Scalar[D]) Length() float32
- func (s Scalar[D]) LengthSq() float32
- func (start Scalar[D]) Lerp(end Scalar[D], delta float32, out *Scalar[D])
- func (s Scalar[D]) Mul(factor Scalar[D], out *Scalar[D])
- func (s Scalar[D]) Scale(scale float32, out *Scalar[D])
- func (s Scalar[D]) Set(out *Scalar[D])
- func (s Scalar[D]) SetComponent(index int, value float32, out *Scalar[D])
- func (s Scalar[D]) SetComponents(value float32, out *Scalar[D])
- func (s Scalar[D]) Sub(subtrahend Scalar[D], out *Scalar[D])
- type Scalarf
- type Scalari
- type Scene
- type Scene2f
- type Scene3f
- type Screen
- type Segment
- type Shape
- type Space
- type SpaceCollisionCallback
- type SpaceComponent
- type SpaceCoord
- type SpaceFlags
- type SpaceNearest
- type SpaceQuery
- type SpaceSearchCallback
- type Sphere
- type Stage
- func (stage *Stage) GetScene2f(name string) *Scene2f
- func (stage *Stage) GetScene3f(name string) *Scene3f
- func (stage Stage) HasStartedLoading() bool
- func (stage *Stage) IsLoaded() bool
- func (stage *Stage) Load(game *Game)
- func (stage *Stage) Start(game *Game)
- func (stage *Stage) Unload(activeStage *Stage)
- func (stage *Stage) Update(game *Game)
- type StageManager
- func (sm *StageManager) Add(stage *Stage)
- func (sm *StageManager) Destroy()
- func (sm *StageManager) Events() *core.Listeners[StageManagerEvents]
- func (sm *StageManager) Get(name string) *Stage
- func (sm *StageManager) GetStage(game *Game) *Stage
- func (sm *StageManager) Init(game *Game) error
- func (sm *StageManager) Set(name string) bool
- func (sm *StageManager) Update(game *Game)
- type StageManagerEvents
- type StageWindow
- type StatDatabase
- type StatPoint
- type StatSet
- type Tag
- type Texture
- type TextureColor
- type TextureCoord
- type TextureFilter
- type TextureSettings
- type TextureWrap
- type Tile
- type Tiles
- type Time
- type TimeType
- type Timer
- type Trans
- type Trans2d
- type Trans3d
- type Transform
- func (t *Transform[A]) GetPosition() A
- func (t *Transform[A]) GetRotation() A
- func (t *Transform[A]) GetScale() A
- func (t Transform[A]) IsDirty() bool
- func (t *Transform[A]) Local() Matrix[A]
- func (t *Transform[A]) SetLocal(local Matrix[A])
- func (t *Transform[A]) SetParent(parent *ecs.Entity)
- func (t *Transform[A]) SetPosition(position A)
- func (t *Transform[A]) SetRotation(rotation A)
- func (t *Transform[A]) SetScale(scale A)
- func (t *Transform[A]) Update(updateWorld bool)
- func (t *Transform[A]) World() Matrix[A]
- type Transform2f
- type Transform3f
- type Transform4f
- type TransformCreate
- type TransformCreate2f
- type TransformCreate3f
- type TransformCreate4f
- type TransformSystem
- func (sys *TransformSystem[A]) Destroy(ctx ecs.Context)
- func (sys *TransformSystem[A]) Init(ctx ecs.Context) error
- func (sys *TransformSystem[A]) OnLive(data *Transform[A], e *ecs.Entity, ctx ecs.Context)
- func (sys *TransformSystem[A]) OnRemove(data *Transform[A], e *ecs.Entity, ctx ecs.Context)
- func (sys *TransformSystem[A]) OnStage(data *Transform[A], e *ecs.Entity, ctx ecs.Context)
- func (sys *TransformSystem[A]) Update(iter ds.Iterable[ecs.Value[*Transform[A]]], ctx ecs.Context)
- type Tween
- type UserInterface
- type UserInterfaceSystem
- func (sys UserInterfaceSystem) Destroy(ctx ecs.Context)
- func (sys UserInterfaceSystem) Init(ctx ecs.Context) error
- func (sys UserInterfaceSystem) OnLive(data *UserInterface, e *ecs.Entity, ctx ecs.Context)
- func (sys UserInterfaceSystem) OnRemove(data *UserInterface, e *ecs.Entity, ctx ecs.Context)
- func (sys UserInterfaceSystem) OnStage(data *UserInterface, e *ecs.Entity, ctx ecs.Context)
- func (sys UserInterfaceSystem) Update(iter ds.Iterable[ecs.Value[*UserInterface]], ctx ecs.Context)
- type Vec2
- func (v Vec2[D]) Add(value Vec2[D], out *Vec2[D])
- func (v Vec2[D]) AddScaled(value Vec2[D], scale float32, out *Vec2[D])
- func (v Vec2[D]) Components() int
- func (v Vec2[D]) Distance(value Vec2[D]) float32
- func (v Vec2[D]) DistanceSq(a Vec2[D]) float32
- func (v Vec2[D]) Div(factor Vec2[D], out *Vec2[D])
- func (v Vec2[D]) Dot(a Vec2[D]) float32
- func (v Vec2[D]) GetComponent(index int) float32
- func (v Vec2[D]) Length() float32
- func (v Vec2[D]) LengthSq() float32
- func (start Vec2[D]) Lerp(end Vec2[D], delta float32, out *Vec2[D])
- func (v Vec2[D]) Mul(factor Vec2[D], out *Vec2[D])
- func (v Vec2[D]) Scale(amount float32, out *Vec2[D])
- func (v Vec2[D]) Set(out *Vec2[D])
- func (v Vec2[D]) SetComponent(index int, value float32, out *Vec2[D])
- func (v Vec2[D]) SetComponents(value float32, out *Vec2[D])
- func (v *Vec2[D]) SetDegrees(deg float32, len float32)
- func (v *Vec2[D]) SetRadians(rad float32, len float32)
- func (v Vec2[D]) Sub(value Vec2[D], out *Vec2[D])
- func (v Vec2[D]) To2d() (x, y float32)
- func (v Vec2[D]) To3d() (x, y, z float32)
- type Vec2d
- type Vec2f
- type Vec2i
- type Vec3
- func (v Vec3[D]) Add(value Vec3[D], out *Vec3[D])
- func (v Vec3[D]) AddScaled(value Vec3[D], scale float32, out *Vec3[D])
- func (v Vec3[D]) Components() int
- func (v Vec3[D]) Cross(other Vec3[D], out *Vec3[D])
- func (v Vec3[D]) Distance(value Vec3[D]) float32
- func (v Vec3[D]) DistanceSq(value Vec3[D]) float32
- func (v Vec3[D]) Div(value Vec3[D], out *Vec3[D])
- func (v Vec3[D]) Dot(a Vec3[D]) float32
- func (v Vec3[D]) GetComponent(index int) float32
- func (v Vec3[D]) Length() float32
- func (v Vec3[D]) LengthSq() float32
- func (start Vec3[D]) Lerp(end Vec3[D], delta float32, out *Vec3[D])
- func (v Vec3[D]) Mul(value Vec3[D], out *Vec3[D])
- func (v Vec3[D]) Normal(out *Vec3[D]) float32
- func (v Vec3[D]) Scale(amount float32, out *Vec3[D])
- func (v Vec3[D]) Set(out *Vec3[D])
- func (v Vec3[D]) SetComponent(index int, value float32, out *Vec3[D])
- func (v Vec3[D]) SetComponents(value float32, out *Vec3[D])
- func (v Vec3[D]) Sub(value Vec3[D], out *Vec3[D])
- func (v Vec3[D]) To2d() (x, y float32)
- func (v Vec3[D]) To3d() (x, y, z float32)
- type Vec3d
- type Vec3f
- type Vec3i
- type Vec4
- func (v Vec4[D]) Add(value Vec4[D], out *Vec4[D])
- func (v Vec4[D]) AddScaled(value Vec4[D], scale float32, out *Vec4[D])
- func (v Vec4[D]) Components() int
- func (v Vec4[D]) Cross(other Vec4[D], out *Vec4[D])
- func (v Vec4[D]) Distance(value Vec4[D]) float32
- func (v Vec4[D]) DistanceSq(value Vec4[D]) float32
- func (v Vec4[D]) Div(value Vec4[D], out *Vec4[D])
- func (v Vec4[D]) Dot(a Vec4[D]) float32
- func (v Vec4[D]) GetComponent(index int) float32
- func (v Vec4[D]) Length() float32
- func (v Vec4[D]) LengthSq() float32
- func (start Vec4[D]) Lerp(end Vec4[D], delta float32, out *Vec4[D])
- func (v Vec4[D]) Mul(value Vec4[D], out *Vec4[D])
- func (v Vec4[D]) Scale(amount float32, out *Vec4[D])
- func (v Vec4[D]) Set(out *Vec4[D])
- func (v Vec4[D]) SetComponent(index int, value float32, out *Vec4[D])
- func (v Vec4[D]) SetComponents(value float32, out *Vec4[D])
- func (v Vec4[D]) Sub(value Vec4[D], out *Vec4[D])
- func (v Vec4[D]) To2d() (x, y float32)
- func (v Vec4[D]) To3d() (x, y, z float32)
- type Vec4f
- type Vec4i
- type View
- type View2f
- func (v *View2f) Destroy()
- func (v *View2f) Init(game *Game) error
- func (v View2f) Project(outside ProjectionOutside) Vec2f
- func (v View2f) ProjectIgnore() Vec2f
- func (v View2f) ProjectPoint(mouse geom.Vec2i, outside ProjectionOutside) Vec2f
- func (v View2f) Scene() *Scene2f
- func (v View2f) UnprojectIgnore(point Vec2f) Vec2f
- func (v View2f) UnprojectPoint(point Vec2f, outside ProjectionOutside) Vec2f
- func (v *View2f) Update(game *Game)
- type View3f
- func (v *View3f) Destroy()
- func (v *View3f) Init(game *Game) error
- func (v View3f) Project(outside ProjectionOutside) Vec3f
- func (v View3f) ProjectIgnore() Vec3f
- func (v View3f) ProjectPoint(mouse geom.Vec2i, outside ProjectionOutside) Vec3f
- func (v View3f) Scene() *Scene3f
- func (v View3f) UnprojectIgnore(point Vec3f) Vec3f
- func (v View3f) UnprojectPoint(point Vec3f, outside ProjectionOutside) Vec3f
- func (v *View3f) Update(game *Game)
- type Watched
- type Window
- type WindowMode
- type WindowSystem
- type WindowSystemEvents
- type World
Constants ¶
This section is empty.
Variables ¶
var ACTION = ecs.DefineComponent("input-action", InputActionListener{}).SetSystem(NewInputActionSystem(nil))
var AUDIO = ecs.DefineComponent("audio", AudioEmitter{})
var INPUT = ecs.DefineComponent("input", InputEvents{}).SetSystem(NewInputEventsSystem())
var LIGHT = ecs.DefineComponent("light", Light{})
var LOGIC = ecs.DefineComponent("Logic", Logic(nil)).SetSystem(NewLogicSystem())
var MESH = ecs.DefineComponent("mesh", Mesh{})
var TAG = ecs.DefineComponent("tag", Tag(""))
var TRANSFORM2 = ecs.DefineComponent("transform2", Transform3f{dirty: transformDirtyLocal}).SetSystem(NewTransformSystem3f())
var TRANSFORM3 = ecs.DefineComponent("transform3", Transform4f{dirty: transformDirtyLocal}).SetSystem(NewTransformSystem4f())
var UI = ecs.DefineComponent("ui", UserInterface{}).SetSystem(NewUserInterfaceSystem())
Functions ¶
func ClampLength ¶
Computes a value whose length is clamped between the given min and max.
func Closest ¶
Returns the closest value to the given point on the line or segment defined by start and end.
func CubicCurve ¶
func CubicCurve[A Attr[A]](delta float32, p0 A, p1 A, p2 A, p3 A, matrix [4][4]float32, inverse bool) A
Calculates the value on the cubic curve given a delta between 0 and 1, the 4 control points, the matrix weights, and if its an inverse.
func Delta ¶
A line is defined by start and end and there is a point on it that's closest to the given point. The delta value defines how close that casted point is between start and end where 0 is on start, 1 is on end, 0.5 is halfway between, and -1 is before start on the line the same distance between start and end.
func DistanceFrom ¶
Returns the shortest distance from the point to the line or segment defined by start and end.
func GetNormalizedDistances ¶
func GetTriangleHeight ¶
Calculates the height triangle given it's base length and two sides.
func InterceptTime ¶
func InterceptTime[A Attr[A]](interceptor A, interceptorSpeed float32, targetPosition A, targetVelocity A) float32
Calculates the time an interceptor could intercept a target given the interceptors position and possible speed and the targets current position and velocity. If no intercept exists based on the parameters then -1 is returned. Otherwise a value is returned that can be used to calculate the interception point (targetPosition+(targetVelocity*time)).
func IsCircleInView ¶
func IsCircleInView[A Attr[A]](viewOrigin A, viewDirection A, fovTan float32, fovCos float32, circle A, circleRadius float32, entirely bool) bool
Returns true if the circle is fully or partially in the defined conical view.
func IsCircleInViewType ¶
func IsCircleInViewType[A Attr[A]](viewOrigin A, viewDirection A, fovTan float32, fovCos float32, circle A, circleRadius float32, fovType FieldOfView) bool
Returns true if the circle is in the defined view based on FOV option.
func IsPointInView ¶
Returns true if the point is in the defined conical view.
func NewBehaviorSystem ¶
func NewBehaviorSystem[B any]() ecs.DataSystem[B]
func NewInputActionSystem ¶
func NewInputActionSystem(unhandled input.ActionHandler) ecs.DataSystem[InputActionListener]
func NewInputEventsSystem ¶
func NewInputEventsSystem() ecs.DataSystem[InputEvents]
func NewLogicSystem ¶
func NewLogicSystem() ecs.DataSystem[Logic]
func NewTransformSystem ¶
func NewTransformSystem[A Attr[A]]() ecs.DataSystem[Transform[A]]
func NewTransformSystem3f ¶
func NewTransformSystem3f() ecs.DataSystem[Transform3f]
func NewTransformSystem4f ¶
func NewTransformSystem4f() ecs.DataSystem[Transform4f]
func NewUserInterfaceSystem ¶
func NewUserInterfaceSystem() ecs.DataSystem[UserInterface]
func ParametricCubicCurve ¶
func ParametricCubicCurve[A Attr[A]](delta float32, points []A, matrix [4][4]float32, weight float32, inverse bool, loop bool) A
Calculates a parametric cubic curve given a delta between 0 and 1, the points of the curve, the weights, if its inversed, and if the curve loops.
func Reflect ¶
func Reflect[A Attr[A]](dir A, normal A) A
Reflects the direction across a given normal. Imagine the normal is on a plane pointing away from it and a reflection is a ball with the given direction bouncing off of it.
func Refract ¶
func Refract[A Attr[A]](dir A, normal A) A
Refracts the direction across the given normal. Like reflect except through the plane defined by the normal.
func Slerp ¶
Performs a slerp between two values. Imagine the two values define a curve that lies on an ellipse where the zero value is the center. The returned value will exist on that curve where 0 is at start and 1 is at end and 0.5 is halfway between.
func SlerpAngle ¶
Performs a slerp between the start and end value given the curves "angle" between the two values and a t value. When t is 0 the returned value will equal start and when 1 will match end. Angle is in radians.
func SlerpNormal ¶
Performs a slerp between two normals given a t. The returned value will exist on the shortest curve from the end of start and end and t between those two values (t is 0 to 1).
Types ¶
type AnimConstant ¶
type AnimConstant[T any] struct { Value T }
func (AnimConstant[T]) Get ¶
func (con AnimConstant[T]) Get() T
type AssetSystem ¶
func NewAssetSystem ¶
func NewAssetSystem() AssetSystem
func (*AssetSystem) Init ¶
func (assets *AssetSystem) Init(game *Game) error
func (*AssetSystem) Update ¶
func (assets *AssetSystem) Update(game *Game)
type Attr ¶
type Attr[V any] interface { // distance between this and value Distance(value V) float32 // squared distance between this and value DistanceSq(value V) float32 // distance between this and zero Length() float32 // squared distance between this and zero LengthSq() float32 // dot product between this and value Dot(value V) float32 // the number of float components that make up this attribute Components() int // gets the float component at the given index GetComponent(index int) float32 // out[index] = value SetComponent(index int, value float32, out *V) // out[all] = value SetComponents(value float32, out *V) // out = this Set(out *V) // out = this + value Add(addend V, out *V) // out = this + value * scale AddScaled(value V, scale float32, out *V) // out = this - value Sub(subtrahend V, out *V) // out = this * value Mul(factor V, out *V) // out = this / value Div(factor V, out *V) // out = this * scale Scale(scale float32, out *V) // out = (end - start) * delta + start Lerp(end V, delta float32, out *V) }
An attribute in the game that has basic math operations.
type AudioAmbience ¶
type AudioAmbience struct {
PlayChance int
Options []AudioAmbienceOption
Volume float32
MaxPlaysBeforeRepeat int
TransitionTime NumericRange[float32]
}
type AudioAmbienceOption ¶
type AudioAmbienceOption struct {
Data *AudioData
Chance int
PlayVolume NumericRange[float32]
PlayLength NumericRange[float32]
}
type AudioAttenuation ¶
type AudioData ¶
type AudioData struct {
Length int
Streaming bool
BitRate int
Reader io.ReadSeekCloser
}
type AudioEmitter ¶
type AudioEmitter struct {
Source AudioSource
Pending []AudioRequest
Ambience *AudioAmbience
}
func (*AudioEmitter) Play ¶
func (audio *AudioEmitter) Play(req AudioRequest)
type AudioInstance ¶
type AudioInstance struct {
Name string
Flags uint
Data *AudioData
Position SpaceCoord // optional for spatial sounds
Direction SpaceCoord // optional for directional sounds
PositionVolume float32 // volume at position
Speed float32 // playback rate modifier
StartTime time.Time
PauseTime time.Time
Settings *AudioInstanceSettings // custom or shared
// relative to current listener
Distance float32
ListenerVolume float32
LeftVolume float32
RightVolume float32
}
type AudioInstanceSettings ¶
type AudioInstanceSettings struct {
DirectionSpread float32 // optional for direction sounds, how big the noise cone is
StartOnRequest bool // if we set the start time when sound playing is requested, or when it actually starts. this plays into if we seek to the position the audio should've been playing by the time it was ready
Times int // -1=Infinite loop
Attenuate AudioAttenuation
IsVirtual bool
OnVirtual AudioVirtualOp
VirtualOutroTime time.Duration // how long we fade out when going virtual
VirtualMinRemaining time.Duration // if we are going virtual and not stopping but have <= this left then we just stop
Importance float32 // scales the listener volume by this amount to calculate a priority
}
type AudioListener ¶
type AudioListener struct {
Name string
Flags uint
Position SpaceCoord
Direction SpaceCoord
Ears SpaceCoord // Camera position?
EarsDirection SpaceCoord
VolumeScale float32
}
type AudioRequest ¶
type AudioRequest struct {
MaxWaitTime time.Duration
Instance AudioInstance
}
type AudioSettings ¶
type AudioSource ¶
type AudioSource struct {
Name string
Flags uint
Position SpaceCoord
Direction SpaceCoord
DirectionInner float32
DirectionOuter float32
DirectionOuterScale float32
Instances []AudioInstance
}
this component can emit audio, and the audio is tied to it. if the component is destroyed the audio is as well.
type AudioSystem ¶
type AudioSystem interface {
GameSystem
Listeners() []AudioListener
Instances() []AudioInstance
Settings() map[string]AudioSettings
Sources() []AudioSource
EntitySystem() ecs.DataSystem[AudioEmitter]
}
type AudioVirtualOp ¶
type AudioVirtualOp string
const ( AudioVirtualOpStop AudioVirtualOp = "stop" // when going virtual, stop and ignore the audio AudioVirtualOpRestart AudioVirtualOp = "restart" // when coming back from virtual, restart from start AudioVirtualOpPause AudioVirtualOp = "pause" // when going virtual remember place in audio, and when coming back from virtual start at that place AudioVirtualOpPlay AudioVirtualOp = "play" // when going virtual remember place in audio and when it comes out of virtual play as if we could hear it the whole time )
type BehaviorOnRemove ¶
type BehaviorSystem ¶
type BehaviorSystem[B any] struct{}
func (BehaviorSystem[B]) Destroy ¶
func (sys BehaviorSystem[B]) Destroy(ctx ecs.Context)
func (BehaviorSystem[B]) OnLive ¶
func (sys BehaviorSystem[B]) OnLive(data *B, e *ecs.Entity, ctx ecs.Context)
func (BehaviorSystem[B]) OnRemove ¶
func (sys BehaviorSystem[B]) OnRemove(data *B, e *ecs.Entity, ctx ecs.Context)
type Camera ¶
type Camera[A Attr[A]] interface { GameSystem GetTransform() Trans[A] GetPlanes() []Plane[A] GetMatrix() Mat[A] }
type Camera2d ¶
type Camera2d struct {
Transform Trans2d
Size Vec2d
Near Scalarf
Far Scalarf
Up Vec2d
Right Vec2d
Left Vec2d
Down Vec2d
Min Vec2d
Max Vec2d
Aspect Scalarf
Planes [4]Plane2d
Matrix Mat2d
}
func NewCamera2d ¶
func NewCamera2d() Camera2d
func (*Camera2d) GetTransform ¶
type Camera3d ¶
type Camera3d struct {
Transform Trans3d
Size Vec2d
Near Scalarf
Far Scalarf
Fov Scalarf
Up Vec3d
Right Vec3d
Left Vec3d
Down Vec3d
Forward Vec3d
Backward Vec3d
Min Vec3d
Max Vec3d
Aspect Scalarf
Planes [6]Plane3d
Matrix Mat3d
}
func NewCamera3d ¶
func NewCamera3d() Camera3d
func (Camera3d) GetTransform ¶
type DebugEvent ¶
type DebugEvent struct {
Id int
Name string
Parent *DebugEvent
Depth int
Children []*DebugEvent
Sibling *DebugEvent
}
type DebugGraph ¶
type DebugGraph struct {
Placement ui.Placement
Database *StatDatabase
Set *StatSet
}
type DebugProfiler ¶
type DebugProfiler struct{}
func (*DebugProfiler) Begin ¶
func (prof *DebugProfiler) Begin(ev string)
func (*DebugProfiler) End ¶
func (prof *DebugProfiler) End()
type DebugSystem ¶
type DebugSystem struct {
Logs []DebugLog
Snapshots []DebugSnapshot
Graphs []DebugGraph
Events []DebugEvent
Enabled bool
}
func (*DebugSystem) Destroy ¶
func (ds *DebugSystem) Destroy()
func (*DebugSystem) Init ¶
func (ds *DebugSystem) Init(game *Game) error
func (*DebugSystem) LogDebug ¶
func (ds *DebugSystem) LogDebug(format string, values ...any)
func (*DebugSystem) LogError ¶
func (ds *DebugSystem) LogError(err error)
func (*DebugSystem) Trigger ¶
func (ds *DebugSystem) Trigger(ev DebugEvent)
func (*DebugSystem) Update ¶
func (ds *DebugSystem) Update(game *Game)
type EventSystem ¶
type EventSystem struct {
}
func (*EventSystem) Destroy ¶
func (events *EventSystem) Destroy()
func (*EventSystem) Init ¶
func (events *EventSystem) Init(game *Game) error
func (*EventSystem) Update ¶
func (events *EventSystem) Update(game *Game)
type FieldOfView ¶
type FieldOfView string
const ( FieldOfViewIgnore FieldOfView = "ignore" FieldOfViewHalf FieldOfView = "half" FieldOfViewFull FieldOfView = "full" )
type FontBitmapFormat ¶
type FontBitmapFormat struct{}
func (*FontBitmapFormat) Deactivate ¶
func (loader *FontBitmapFormat) Deactivate(a *asset.Asset) error
func (*FontBitmapFormat) Types ¶
func (loader *FontBitmapFormat) Types() []asset.Type
type Game ¶
type Game struct {
Debug DebugSystem
Assets AssetSystem
Windows WindowSystem
Graphics GraphicsSystem
Input InputSystem
Actions input.ActionSets
Audio AudioSystem
Events EventSystem
Stages StageManager
State GameState
Settings GameSettings
Running bool
}
func ActiveGame ¶
func ActiveGame() *Game
func NewGame ¶
func NewGame(settings GameSettings) *Game
type GameSettings ¶
type GameState ¶
func (*GameState) FromSettings ¶
func (state *GameState) FromSettings(settings GameSettings)
type GameSystem ¶
type GraphicsSystem ¶
type GraphicsSystem interface {
GameSystem
}
type InputActionListener ¶
type InputActionSystem ¶
type InputActionSystem struct {
// contains filtered or unexported fields
}
func (*InputActionSystem) Destroy ¶
func (sys *InputActionSystem) Destroy(ctx ecs.Context)
func (InputActionSystem) OnLive ¶
func (sys InputActionSystem) OnLive(data *InputActionListener, e *ecs.Entity, ctx ecs.Context)
func (InputActionSystem) OnRemove ¶
func (sys InputActionSystem) OnRemove(data *InputActionListener, e *ecs.Entity, ctx ecs.Context)
func (InputActionSystem) OnStage ¶
func (sys InputActionSystem) OnStage(data *InputActionListener, e *ecs.Entity, ctx ecs.Context)
func (*InputActionSystem) Update ¶
func (sys *InputActionSystem) Update(iter ds.Iterable[ecs.Value[*InputActionListener]], ctx ecs.Context)
type InputEvents ¶
type InputEvents = input.SystemEvents
func UserInterfaceInputEventsFor ¶
func UserInterfaceInputEventsFor(e *ecs.Entity) InputEvents
type InputEventsSystem ¶
type InputEventsSystem struct {
// contains filtered or unexported fields
}
func (*InputEventsSystem) Destroy ¶
func (sys *InputEventsSystem) Destroy(ctx ecs.Context)
func (InputEventsSystem) OnLive ¶
func (sys InputEventsSystem) OnLive(data *InputEvents, e *ecs.Entity, ctx ecs.Context)
func (InputEventsSystem) OnRemove ¶
func (sys InputEventsSystem) OnRemove(data *InputEvents, e *ecs.Entity, ctx ecs.Context)
func (InputEventsSystem) OnStage ¶
func (sys InputEventsSystem) OnStage(data *InputEvents, e *ecs.Entity, ctx ecs.Context)
func (*InputEventsSystem) Update ¶
func (sys *InputEventsSystem) Update(iter ds.Iterable[ecs.Value[*InputEvents]], ctx ecs.Context)
type InputSystem ¶
type InputSystem interface {
GameSystem
input.InputSystem
}
type LightAttenuate ¶
type LightAttenuate int
const ( LightAttenuateNone LightAttenuate = iota LightAttenuateConstant LightAttenuateLinear LightAttenuateQuadratic )
type LogicSystem ¶
type LogicSystem struct{}
func (LogicSystem) Destroy ¶
func (sys LogicSystem) Destroy(ctx ecs.Context)
type Mat2d ¶
type Mat2d struct {
// contains filtered or unexported fields
}
func (*Mat2d) Determinant ¶
type Mat3d ¶
type Mat3d struct {
// contains filtered or unexported fields
}
func (*Mat3d) Determinant ¶
func (*Mat3d) Perpsective ¶
func (*Mat3d) TransformVector ¶
type Material ¶
type Material struct {
Name string // Material name
Illum int // Illumination model
Opacity float32 // Opacity factor
Refraction float32 // Refraction factor
Shininess float32 // Shininess (specular exponent)
Ambient TextureColor // Ambient color reflectivity
Diffuse TextureColor // Diffuse color reflectivity
Specular TextureColor // Specular color reflectivity
Emissive TextureColor // Emissive color
TextureBump string
}
type Matrix ¶
type Matrix[A Attr[A]] struct { // contains filtered or unexported fields }
func InitMatrix ¶
func (*Matrix[A]) Determinant ¶
func (*Matrix[A]) PostTranslate ¶
func (m *Matrix[A]) PostTranslate(translation A)
func (*Matrix[A]) SetAxisRotaton ¶
func (*Matrix[A]) SetRotaton ¶
func (*Matrix[A]) SetTranslation ¶
func (m *Matrix[A]) SetTranslation(translation A)
func (Matrix[A]) TransformVector ¶
func (m Matrix[A]) TransformVector(point A) A
type MeshFaceGroup ¶
type NoAudioSystem ¶
type NoAudioSystem struct{}
func (*NoAudioSystem) Destroy ¶
func (audio *NoAudioSystem) Destroy()
func (*NoAudioSystem) EntitySystem ¶
func (audio *NoAudioSystem) EntitySystem() ecs.DataSystem[AudioEmitter]
func (*NoAudioSystem) Init ¶
func (audio *NoAudioSystem) Init(game *Game) error
func (*NoAudioSystem) Instances ¶
func (audio *NoAudioSystem) Instances() []AudioInstance
func (*NoAudioSystem) Listeners ¶
func (audio *NoAudioSystem) Listeners() []AudioListener
func (*NoAudioSystem) Settings ¶
func (audio *NoAudioSystem) Settings() map[string]AudioSettings
func (*NoAudioSystem) Sources ¶
func (audio *NoAudioSystem) Sources() []AudioSource
func (*NoAudioSystem) Update ¶
func (audio *NoAudioSystem) Update(game *Game)
type NoGraphicsSystem ¶
type NoGraphicsSystem struct{}
func (*NoGraphicsSystem) Destroy ¶
func (gr *NoGraphicsSystem) Destroy()
func (*NoGraphicsSystem) Init ¶
func (gr *NoGraphicsSystem) Init(game *Game) error
func (*NoGraphicsSystem) Update ¶
func (gr *NoGraphicsSystem) Update(game *Game)
type NoInputSystem ¶
type NoInputSystem struct {
input.EmptySystem
}
func (*NoInputSystem) Destroy ¶
func (in *NoInputSystem) Destroy()
func (*NoInputSystem) Init ¶
func (in *NoInputSystem) Init(game *Game) error
func (*NoInputSystem) Update ¶
func (in *NoInputSystem) Update(game *Game)
type NoWindowSystem ¶
type NoWindowSystem struct{}
func (*NoWindowSystem) Destroy ¶
func (windows *NoWindowSystem) Destroy()
func (*NoWindowSystem) Events ¶
func (windows *NoWindowSystem) Events() *core.Listeners[WindowSystemEvents]
func (*NoWindowSystem) Init ¶
func (windows *NoWindowSystem) Init(game *Game) error
func (*NoWindowSystem) MainWindow ¶
func (windows *NoWindowSystem) MainWindow() Window
func (*NoWindowSystem) Screens ¶
func (windows *NoWindowSystem) Screens() []Screen
func (*NoWindowSystem) Update ¶
func (windows *NoWindowSystem) Update(game *Game)
func (*NoWindowSystem) Windows ¶
func (windows *NoWindowSystem) Windows() []Window
type NumericRange ¶
type NumericRange[D Numeric] struct { Min D Max D }
func (NumericRange[D]) At ¶
func (r NumericRange[D]) At(delta float32) D
func (NumericRange[D]) Random ¶
func (r NumericRange[D]) Random(rnd rand.Rand) D
type PathDelta ¶
func (PathDelta[T]) PointCount ¶
type PathLinear ¶
func NewPathLinear ¶
func NewPathLinear[T Attr[T]](points []AnimValue[T]) PathLinear[T]
func (PathLinear[T]) Flags ¶
func (path PathLinear[T]) Flags() PathFlag
func (PathLinear[T]) Point ¶
func (path PathLinear[T]) Point(index int) AnimValue[T]
func (PathLinear[T]) PointCount ¶
func (path PathLinear[T]) PointCount() int
func (PathLinear[T]) Set ¶
func (path PathLinear[T]) Set(out *T, delta float32)
type PathPoint ¶
func (PathPoint[T]) PointCount ¶
type Plane3d ¶
type Plane3d struct {
A, B, C, D float32
}
func (*Plane3d) Intersection ¶
func (*Plane3d) SetPointNormal ¶
func (*Plane3d) SignPoints ¶
type ProjectionOutside ¶
type ProjectionOutside int
const ( ProjectionOutsideIgnore ProjectionOutside = iota ProjectionOutsideClamp ProjectionOutsideRelative )
type Quat ¶
type Quat struct {
X, Y, Z, W float32
}
func (Quat) AngleBetween ¶
func (Quat) Components ¶
func (Quat) DistanceSq ¶
func (Quat) GetComponent ¶
func (*Quat) MultiplyValues ¶
func (Quat) SetComponents ¶
type RenderTarget ¶
type Scalar ¶
type Scalar[D Numeric] struct { Value D }
func (Scalar[D]) Components ¶
func (Scalar[D]) DistanceSq ¶
func (Scalar[D]) GetComponent ¶
func (Scalar[D]) SetComponent ¶
func (Scalar[D]) SetComponents ¶
type Scene ¶
type Space ¶
type Space[A Attr[A], E any] interface { GameSystem Collisions(flags util.Match[SpaceFlags], callback SpaceCollisionCallback[E]) Intersects(query SpaceQuery[A], callback SpaceSearchCallback[A, E]) int Contains(query SpaceQuery[A], callback SpaceSearchCallback[A, E]) int Raytrace(query SpaceQuery[A], callback SpaceSearchCallback[A, E]) int KNN(query SpaceQuery[A], nearest []SpaceNearest[E], nearestCount *int) }
type SpaceCollisionCallback ¶
type SpaceComponent ¶
type SpaceCoord ¶
type SpaceFlags ¶
type SpaceFlags uint64
type SpaceNearest ¶
type SpaceQuery ¶
type SpaceSearchCallback ¶
type Stage ¶
type Stage struct {
Name string
Assets []asset.Ref
Windows []StageWindow
Scenes2 []Scene2f
Scenes3 []Scene3f
Views2 []View2f
Views3 []View3f
Actions input.ActionSets
// contains filtered or unexported fields
}
func (*Stage) GetScene2f ¶
func (*Stage) GetScene3f ¶
func (Stage) HasStartedLoading ¶
type StageManager ¶
type StageManager struct {
Stages map[string]*Stage
Current *Stage
Next *Stage
// contains filtered or unexported fields
}
func NewStageManager ¶
func NewStageManager() StageManager
func (*StageManager) Add ¶
func (sm *StageManager) Add(stage *Stage)
func (*StageManager) Destroy ¶
func (sm *StageManager) Destroy()
func (*StageManager) Events ¶
func (sm *StageManager) Events() *core.Listeners[StageManagerEvents]
func (*StageManager) Get ¶
func (sm *StageManager) Get(name string) *Stage
func (*StageManager) GetStage ¶
func (sm *StageManager) GetStage(game *Game) *Stage
func (*StageManager) Init ¶
func (sm *StageManager) Init(game *Game) error
func (*StageManager) Set ¶
func (sm *StageManager) Set(name string) bool
func (*StageManager) Update ¶
func (sm *StageManager) Update(game *Game)
type StageManagerEvents ¶
type StageWindow ¶
type StatDatabase ¶
type TextureColor ¶
type TextureCoord ¶
type TextureFilter ¶
type TextureFilter int
const ( TextureFilterLinear TextureFilter = iota TextureFilterNearest )
func (TextureFilter) Ptr ¶
func (tf TextureFilter) Ptr() *TextureFilter
type TextureSettings ¶
type TextureSettings struct {
Min TextureFilter
Max TextureFilter
MipMap *TextureFilter
WrapX TextureWrap
WrapY TextureWrap
}
type TextureWrap ¶
type TextureWrap int
const ( TextureWrapRepeat TextureWrap = iota TextureWrapClampToEdge TextureWrapClampToBorder TextureWrapMirrorRepeat )
type Tile ¶
type Tile struct {
Texture Texture
Name string
Coord0 TextureCoord
Coord1 TextureCoord
}
type Time ¶
type Time struct {
Name string
DayDuration time.Duration
Enabled bool
Scale float32
DateTime time.Time
Elapsed time.Duration
StartTime time.Time
// contains filtered or unexported fields
}
func (*Time) ElapsedScaled ¶
type Timer ¶
type Transform ¶
func NewTransform ¶
func NewTransform[A Attr[A]](create TransformCreate[A]) Transform[A]
func (*Transform[A]) GetPosition ¶
func (t *Transform[A]) GetPosition() A
func (*Transform[A]) GetRotation ¶
func (t *Transform[A]) GetRotation() A
func (*Transform[A]) SetPosition ¶
func (t *Transform[A]) SetPosition(position A)
func (*Transform[A]) SetRotation ¶
func (t *Transform[A]) SetRotation(rotation A)
type Transform2f ¶
func NewTransform2 ¶
func NewTransform2(create TransformCreate2f) Transform2f
type Transform3f ¶
func NewTransform3 ¶
func NewTransform3(create TransformCreate3f) Transform3f
type Transform4f ¶
func NewTransform4 ¶
func NewTransform4(create TransformCreate4f) Transform4f
type TransformCreate ¶
type TransformCreate[A Attr[A]] struct { Position A Rotation A Scale A }
type TransformCreate2f ¶
type TransformCreate2f = TransformCreate[Vec2f]
type TransformCreate3f ¶
type TransformCreate3f = TransformCreate[Vec3f]
type TransformCreate4f ¶
type TransformCreate4f = TransformCreate[Vec4f]
type TransformSystem ¶
type TransformSystem[A Attr[A]] struct{}
func (*TransformSystem[A]) Destroy ¶
func (sys *TransformSystem[A]) Destroy(ctx ecs.Context)
type Tween ¶
func (Tween[T]) PointCount ¶
type UserInterface ¶
func NewUserInterface ¶
func NewUserInterface() UserInterface
type UserInterfaceSystem ¶
type UserInterfaceSystem struct{}
func (UserInterfaceSystem) Destroy ¶
func (sys UserInterfaceSystem) Destroy(ctx ecs.Context)
func (UserInterfaceSystem) OnLive ¶
func (sys UserInterfaceSystem) OnLive(data *UserInterface, e *ecs.Entity, ctx ecs.Context)
func (UserInterfaceSystem) OnRemove ¶
func (sys UserInterfaceSystem) OnRemove(data *UserInterface, e *ecs.Entity, ctx ecs.Context)
func (UserInterfaceSystem) OnStage ¶
func (sys UserInterfaceSystem) OnStage(data *UserInterface, e *ecs.Entity, ctx ecs.Context)
func (UserInterfaceSystem) Update ¶
func (sys UserInterfaceSystem) Update(iter ds.Iterable[ecs.Value[*UserInterface]], ctx ecs.Context)
type Vec2 ¶
type Vec2[D Numeric] struct { X D Y D }
func (Vec2[D]) Components ¶
func (Vec2[D]) DistanceSq ¶
func (Vec2[D]) GetComponent ¶
func (Vec2[D]) SetComponents ¶
func (*Vec2[D]) SetDegrees ¶
func (*Vec2[D]) SetRadians ¶
type Vec3 ¶
type Vec3[D Numeric] struct { X D Y D Z D }
func (Vec3[D]) Components ¶
func (Vec3[D]) DistanceSq ¶
func (Vec3[D]) GetComponent ¶
func (Vec3[D]) SetComponents ¶
type Vec4 ¶
type Vec4[D Numeric] struct { X D Y D Z D W D }
func (Vec4[D]) Components ¶
func (Vec4[D]) DistanceSq ¶
func (Vec4[D]) GetComponent ¶
func (Vec4[D]) SetComponents ¶
type View ¶
type View[A Attr[A]] interface { GameSystem Name() string Scene() Scene[A] Camera() Camera[A] ProjectionMatrix() Matrix[A] ViewMatrix() Matrix[A] CombinedMatrix() Matrix[A] ProjectPoint(mouse geom.Vec2i, outside ProjectionOutside) A Project(outside ProjectionOutside) A ProjectIgnore() A UnprojectPoint(point A, outside ProjectionOutside) A UnprojectIgnore(point A) A Placement() ui.Placement Target() RenderTarget }
type View2f ¶
type View2f struct {
Name string
SceneName string
Camera Camera2d
ProjectionMatrix Matrix2f
ViewMatrix Matrix2f
CombinedMatrix Matrix2f
Placement ui.Placement
Target RenderTarget
OnInit func(view *View2f, game *Game)
OnUpdate func(view *View2f, game *Game)
OnDestroy func(view *View2f)
// contains filtered or unexported fields
}
func (View2f) Project ¶
func (v View2f) Project(outside ProjectionOutside) Vec2f
func (View2f) ProjectIgnore ¶
func (View2f) ProjectPoint ¶
func (v View2f) ProjectPoint(mouse geom.Vec2i, outside ProjectionOutside) Vec2f
func (View2f) UnprojectIgnore ¶
func (View2f) UnprojectPoint ¶
func (v View2f) UnprojectPoint(point Vec2f, outside ProjectionOutside) Vec2f
type View3f ¶
type View3f struct {
Name string
SceneName string
Camera Camera3d
ProjectionMatrix Matrix4f
ViewMatrix Matrix4f
CombinedMatrix Matrix4f
Placement ui.Placement
Target RenderTarget
OnInit func(view *View3f, game *Game)
OnUpdate func(view *View3f, game *Game)
OnDestroy func(view *View3f)
// contains filtered or unexported fields
}
func (View3f) Project ¶
func (v View3f) Project(outside ProjectionOutside) Vec3f
func (View3f) ProjectIgnore ¶
func (View3f) ProjectPoint ¶
func (v View3f) ProjectPoint(mouse geom.Vec2i, outside ProjectionOutside) Vec3f
func (View3f) UnprojectIgnore ¶
func (View3f) UnprojectPoint ¶
func (v View3f) UnprojectPoint(point Vec3f, outside ProjectionOutside) Vec3f
type WindowMode ¶
type WindowMode int
const ( WindowModeResizable WindowMode = iota WindowModeFixed WindowModeBorderless WindowModeFullscreen )
type WindowSystem ¶
type WindowSystem interface {
GameSystem
MainWindow() Window
Windows() []Window
Screens() []Screen
Events() *core.Listeners[WindowSystemEvents]
}
type WindowSystemEvents ¶
type WindowSystemEvents struct {
MouseScreenChange func(oldMouse geom.Vec2i, oldScreen Screen, newMouse geom.Vec2i, newScreen Screen)
ScreenConnected func(newScreen Screen)
ScreenDisconnected func(oldScreen Screen)
ScreenResize func(screen Screen, oldSize geom.Vec2i, newSize geom.Vec2i)
WindowResize func(window Window, oldSize geom.Vec2i, newSize geom.Vec2i)
WindowAdded func(window Window)
WindowRemoved func(window Window)
}
Source Files
¶
- animation-value.go
- animation.go
- asset-fnt.go
- asset-mtl.go
- asset-obj.go
- asset.go
- attr-quat.go
- attr-scalar.go
- attr-vec.go
- attr.go
- audio.go
- camera.go
- core.go
- debug.go
- ecs-component-audio.go
- ecs-component-behavior.go
- ecs-component-input.go
- ecs-component-light.go
- ecs-component-logic.go
- ecs-component-mesh.go
- ecs-component-tag.go
- ecs-component-transform.go
- ecs-component-ui.go
- ecs-world.go
- game.go
- input.go
- light.go
- matrix.go
- mesh.go
- range.go
- shape.go
- space.go
- stage.go
- texture.go
- time.go
- timer.go
- types_generic.go
- window.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Possible features
|
Possible features |
|
impl
|
|
|
The steer package contains steering behaviors for autonomous movement.
|
The steer package contains steering behaviors for autonomous movement. |
|
ux
ux is a package that supplies basic components built on the ui package.
|
ux is a package that supplies basic components built on the ui package. |