Documentation ¶
Index ¶
- Variables
- type Animation
- type AnimationBindingDefinitionInfo
- type AnimationDefinition
- type AnimationDefinitionInfo
- type AnimationInfo
- type BodyNodeSource
- type BoneNodeTarget
- type CameraNodeTarget
- type Controller
- type CubeTexture
- type DirectionalLightNodeTarget
- type Engine
- func (e *Engine) ActiveScene() *Scene
- func (e *Engine) Create()
- func (e *Engine) CreateAnimationDefinition(info AnimationDefinitionInfo) *AnimationDefinition
- func (e *Engine) CreateResourceSet() *ResourceSet
- func (e *Engine) CreateScene() *Scene
- func (e *Engine) Destroy()
- func (e *Engine) ECS() *ecs.Engine
- func (e *Engine) GFXWorker() Worker
- func (e *Engine) Graphics() *graphics.Engine
- func (e *Engine) IOWorker() Worker
- func (e *Engine) Physics() *physics.Engine
- func (e *Engine) Registry() asset.Registry
- func (e *Engine) Render(viewport graphics.Viewport)
- func (e *Engine) ResetDeltaTime()
- func (e *Engine) SetActiveScene(scene *Scene)
- func (e *Engine) Update()
- type EngineOption
- func WithECS(ecsEngine *ecs.Engine) EngineOption
- func WithGFXWorker(worker Worker) EngineOption
- func WithGraphics(gfxEngine *graphics.Engine) EngineOption
- func WithIOWorker(worker Worker) EngineOption
- func WithPhysics(physicsEngine *physics.Engine) EngineOption
- func WithRegistry(registry asset.Registry) EngineOption
- type Keyframe
- type KeyframeList
- type MeshNodeTarget
- type Model
- type ModelDefinition
- type ModelInfo
- type Operation
- type Playback
- func (p *Playback) Advance(amount float64)
- func (p *Playback) Delete()
- func (p *Playback) EndTime() float64
- func (p *Playback) Head() float64
- func (p *Playback) Length() float64
- func (p *Playback) Loop() bool
- func (p *Playback) Name() string
- func (p *Playback) Pause()
- func (p *Playback) Play()
- func (p *Playback) Seek(head float64)
- func (p *Playback) SetEndTime(endTime float64)
- func (p *Playback) SetLoop(loop bool)
- func (p *Playback) SetName(name string)
- func (p *Playback) SetSpeed(speed float64)
- func (p *Playback) SetStartTime(startTime float64)
- func (p *Playback) Speed() float64
- func (p *Playback) StartTime() float64
- func (p *Playback) Stop()
- type PointLightNodeTarget
- type Promise
- type ResourceSet
- func (s *ResourceSet) CreateResourceSet() *ResourceSet
- func (s *ResourceSet) Delete()
- func (s *ResourceSet) OpenCubeTexture(id string) async.Promise[*CubeTexture]
- func (s *ResourceSet) OpenModel(id string) async.Promise[*ModelDefinition]
- func (s *ResourceSet) OpenModelByName(name string) async.Promise[*ModelDefinition]
- func (s *ResourceSet) OpenScene(id string) async.Promise[*SceneDefinition]
- func (s *ResourceSet) OpenSceneByName(name string) async.Promise[*SceneDefinition]
- func (s *ResourceSet) OpenTwoDTexture(id string) async.Promise[*TwoDTexture]
- type Scene
- func (s *Scene) CreateAnimation(info AnimationInfo) *Animation
- func (s *Scene) CreateModel(info ModelInfo) *Model
- func (s *Scene) Delete()
- func (s *Scene) ECS() *ecs.Scene
- func (s *Scene) FindModel(name string) *Model
- func (s *Scene) FindPlayback(name string) *Playback
- func (s *Scene) Freeze()
- func (s *Scene) Graphics() *graphics.Scene
- func (s *Scene) Initialize(definition *SceneDefinition)
- func (s *Scene) IsFrozen() bool
- func (s *Scene) Physics() *physics.Scene
- func (s *Scene) PlayAnimation(animation *Animation) *Playback
- func (s *Scene) Render(viewport graphics.Viewport)
- func (s *Scene) Root() *hierarchy.Node
- func (s *Scene) SubscribePostAnimation(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePostNode(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePostPhysics(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePostUpdate(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePreAnimation(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePreNode(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePrePhysics(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) SubscribePreUpdate(callback timestep.UpdateCallback) *timestep.UpdateSubscription
- func (s *Scene) Unfreeze()
- func (s *Scene) Update(elapsedTime time.Duration)
- type SceneDefinition
- type SpotLightNodeTarget
- type TwoDTexture
- type Worker
- type WorkerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("resource not found") ErrStillLoading = errors.New("resource still loading") )
View Source
var ErrNotReady = errors.New("not ready")
Functions ¶
This section is empty.
Types ¶
type Animation ¶ added in v0.9.0
type Animation struct {
// contains filtered or unexported fields
}
type AnimationBindingDefinitionInfo ¶ added in v0.9.0
type AnimationBindingDefinitionInfo struct { NodeIndex int NodeName string //alternative in case of isolated animation TranslationKeyframes KeyframeList[dprec.Vec3] RotationKeyframes KeyframeList[dprec.Quat] ScaleKeyframes KeyframeList[dprec.Vec3] }
type AnimationDefinition ¶ added in v0.9.0
type AnimationDefinition struct {
// contains filtered or unexported fields
}
type AnimationDefinitionInfo ¶ added in v0.9.0
type AnimationDefinitionInfo struct { Name string StartTime float64 EndTime float64 Bindings []AnimationBindingDefinitionInfo }
type AnimationInfo ¶ added in v0.9.0
type AnimationInfo struct { Model *Model Definition *AnimationDefinition }
type BodyNodeSource ¶ added in v0.14.0
func (BodyNodeSource) ApplyTo ¶ added in v0.14.0
func (s BodyNodeSource) ApplyTo(node *hierarchy.Node)
type BoneNodeTarget ¶ added in v0.14.0
func (BoneNodeTarget) ApplyFrom ¶ added in v0.14.0
func (t BoneNodeTarget) ApplyFrom(node *hierarchy.Node)
type CameraNodeTarget ¶ added in v0.14.0
func (CameraNodeTarget) ApplyFrom ¶ added in v0.14.0
func (t CameraNodeTarget) ApplyFrom(node *hierarchy.Node)
type Controller ¶
type Controller struct { app.NopController // contains filtered or unexported fields }
func NewController ¶ added in v0.9.0
func NewController(registry asset.Registry, shaders graphics.ShaderCollection) *Controller
func (*Controller) Engine ¶ added in v0.9.0
func (c *Controller) Engine() *Engine
func (*Controller) OnCreate ¶ added in v0.9.0
func (c *Controller) OnCreate(window app.Window)
func (*Controller) OnDestroy ¶ added in v0.9.0
func (c *Controller) OnDestroy(window app.Window)
func (*Controller) OnFramebufferResize ¶ added in v0.12.0
func (c *Controller) OnFramebufferResize(window app.Window, width, height int)
func (*Controller) OnRender ¶ added in v0.9.0
func (c *Controller) OnRender(window app.Window)
type CubeTexture ¶ added in v0.9.0
type CubeTexture struct {
// contains filtered or unexported fields
}
type DirectionalLightNodeTarget ¶ added in v0.14.0
type DirectionalLightNodeTarget struct { Light *graphics.DirectionalLight UseOnlyParentPosition bool }
func (DirectionalLightNodeTarget) ApplyFrom ¶ added in v0.14.0
func (t DirectionalLightNodeTarget) ApplyFrom(node *hierarchy.Node)
type Engine ¶ added in v0.9.0
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶ added in v0.9.0
func NewEngine(opts ...EngineOption) *Engine
func (*Engine) ActiveScene ¶ added in v0.9.0
func (*Engine) CreateAnimationDefinition ¶ added in v0.9.0
func (e *Engine) CreateAnimationDefinition(info AnimationDefinitionInfo) *AnimationDefinition
func (*Engine) CreateResourceSet ¶ added in v0.9.0
func (e *Engine) CreateResourceSet() *ResourceSet
func (*Engine) CreateScene ¶ added in v0.9.0
func (*Engine) ResetDeltaTime ¶ added in v0.9.0
func (e *Engine) ResetDeltaTime()
func (*Engine) SetActiveScene ¶ added in v0.9.0
type EngineOption ¶ added in v0.9.0
type EngineOption func(e *Engine)
func WithECS ¶ added in v0.9.0
func WithECS(ecsEngine *ecs.Engine) EngineOption
func WithGFXWorker ¶ added in v0.9.0
func WithGFXWorker(worker Worker) EngineOption
func WithGraphics ¶ added in v0.9.0
func WithGraphics(gfxEngine *graphics.Engine) EngineOption
func WithIOWorker ¶ added in v0.9.0
func WithIOWorker(worker Worker) EngineOption
func WithPhysics ¶ added in v0.9.0
func WithPhysics(physicsEngine *physics.Engine) EngineOption
func WithRegistry ¶ added in v0.9.0
func WithRegistry(registry asset.Registry) EngineOption
type KeyframeList ¶ added in v0.9.0
type MeshNodeTarget ¶ added in v0.14.0
func (MeshNodeTarget) ApplyFrom ¶ added in v0.14.0
func (t MeshNodeTarget) ApplyFrom(node *hierarchy.Node)
type Model ¶ added in v0.9.0
type Model struct {
// contains filtered or unexported fields
}
func (*Model) Animations ¶ added in v0.9.0
func (*Model) BodyInstances ¶ added in v0.9.0
func (*Model) FindAnimation ¶ added in v0.9.0
type ModelDefinition ¶ added in v0.9.0
type ModelDefinition struct {
// contains filtered or unexported fields
}
func (*ModelDefinition) FindAnimation ¶ added in v0.9.0
func (d *ModelDefinition) FindAnimation(name string) *AnimationDefinition
type ModelInfo ¶ added in v0.9.0
type ModelInfo struct { // Name specifies the name of this instance. This should not be // confused with the name of the definition. Name string // Definition specifies the template from which this instance will // be created. Definition *ModelDefinition // Position is used to specify a location for the model instance. Position dprec.Vec3 // Rotation is used to specify a rotation for the model instance. Rotation dprec.Quat // Scale is used to specify a scale for the model instance. Scale dprec.Vec3 // IsDynamic determines whether the model can be repositioned once // placed in the Scene. // (i.e. whether it should be added to the scene hierarchy) IsDynamic bool // PrepareAnimations indicates whether animation definitions should be // instantiated for this model. PrepareAnimations bool }
ModelInfo contains the information necessary to place a Model instance into a Scene.
type Operation ¶ added in v0.9.0
type Operation struct {
// contains filtered or unexported fields
}
func NewOperation ¶ added in v0.9.0
func NewOperation() Operation
type Playback ¶ added in v0.10.0
type Playback struct {
// contains filtered or unexported fields
}
func (*Playback) SetEndTime ¶ added in v0.10.0
func (*Playback) SetStartTime ¶ added in v0.10.0
type PointLightNodeTarget ¶ added in v0.14.0
type PointLightNodeTarget struct {
Light *graphics.PointLight
}
func (PointLightNodeTarget) ApplyFrom ¶ added in v0.14.0
func (t PointLightNodeTarget) ApplyFrom(node *hierarchy.Node)
type Promise ¶ added in v0.9.0
type Promise[T any] struct { // contains filtered or unexported fields }
func NewPromise ¶ added in v0.9.0
func SafePromise ¶ added in v0.9.0
type ResourceSet ¶ added in v0.9.0
type ResourceSet struct {
// contains filtered or unexported fields
}
func (*ResourceSet) CreateResourceSet ¶ added in v0.9.0
func (s *ResourceSet) CreateResourceSet() *ResourceSet
func (*ResourceSet) Delete ¶ added in v0.9.0
func (s *ResourceSet) Delete()
Delete schedules all resources managed by this ResourceSet for deletion. After this method returns, the resources are not guaranteed to have been released.
Calling this method twice is not allowed. Allocating new resources after this method has been called is also not allowed.
func (*ResourceSet) OpenCubeTexture ¶ added in v0.9.0
func (s *ResourceSet) OpenCubeTexture(id string) async.Promise[*CubeTexture]
func (*ResourceSet) OpenModel ¶ added in v0.9.0
func (s *ResourceSet) OpenModel(id string) async.Promise[*ModelDefinition]
func (*ResourceSet) OpenModelByName ¶ added in v0.9.0
func (s *ResourceSet) OpenModelByName(name string) async.Promise[*ModelDefinition]
func (*ResourceSet) OpenScene ¶ added in v0.9.0
func (s *ResourceSet) OpenScene(id string) async.Promise[*SceneDefinition]
func (*ResourceSet) OpenSceneByName ¶ added in v0.9.0
func (s *ResourceSet) OpenSceneByName(name string) async.Promise[*SceneDefinition]
func (*ResourceSet) OpenTwoDTexture ¶ added in v0.9.0
func (s *ResourceSet) OpenTwoDTexture(id string) async.Promise[*TwoDTexture]
type Scene ¶ added in v0.9.0
type Scene struct {
// contains filtered or unexported fields
}
func (*Scene) CreateAnimation ¶ added in v0.9.0
func (s *Scene) CreateAnimation(info AnimationInfo) *Animation
func (*Scene) CreateModel ¶ added in v0.9.0
func (*Scene) FindPlayback ¶ added in v0.10.0
func (*Scene) Initialize ¶ added in v0.9.0
func (s *Scene) Initialize(definition *SceneDefinition)
func (*Scene) PlayAnimation ¶ added in v0.10.0
func (*Scene) SubscribePostAnimation ¶ added in v0.14.0
func (s *Scene) SubscribePostAnimation(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePostNode ¶ added in v0.14.0
func (s *Scene) SubscribePostNode(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePostPhysics ¶ added in v0.14.0
func (s *Scene) SubscribePostPhysics(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePostUpdate ¶ added in v0.14.0
func (s *Scene) SubscribePostUpdate(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePreAnimation ¶ added in v0.14.0
func (s *Scene) SubscribePreAnimation(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePreNode ¶ added in v0.14.0
func (s *Scene) SubscribePreNode(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePrePhysics ¶ added in v0.14.0
func (s *Scene) SubscribePrePhysics(callback timestep.UpdateCallback) *timestep.UpdateSubscription
func (*Scene) SubscribePreUpdate ¶ added in v0.14.0
func (s *Scene) SubscribePreUpdate(callback timestep.UpdateCallback) *timestep.UpdateSubscription
type SceneDefinition ¶ added in v0.9.0
type SceneDefinition struct {
// contains filtered or unexported fields
}
type SpotLightNodeTarget ¶ added in v0.14.0
func (SpotLightNodeTarget) ApplyFrom ¶ added in v0.14.0
func (t SpotLightNodeTarget) ApplyFrom(node *hierarchy.Node)
type TwoDTexture ¶ added in v0.9.0
type TwoDTexture struct {
// contains filtered or unexported fields
}
type WorkerFunc ¶ added in v0.9.0
func (WorkerFunc) Schedule ¶ added in v0.9.0
func (f WorkerFunc) Schedule(fn func() error) Operation
func (WorkerFunc) ScheduleVoid ¶ added in v0.9.0
func (f WorkerFunc) ScheduleVoid(fn func()) Operation
Source Files ¶
Click to show internal directories.
Click to hide internal directories.