model

package
v0.0.0-...-b8d9494 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: BSD-3-Clause Imports: 12 Imported by: 36

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MeterScaleFactor  float32 = 1 / 1.26
	GlobalScaleFactor float32 = 0.01
	X2                        = &Transform{Scale: &math32.Vector3{2, 2, 2}}
	X3                        = &Transform{Scale: &math32.Vector3{3, 3, 3}}
	X4                        = &Transform{Scale: &math32.Vector3{4, 4, 4}}
	X5                        = &Transform{Scale: &math32.Vector3{5, 5, 5}}
	X6                        = &Transform{Scale: &math32.Vector3{6, 6, 6}}
	X7                        = &Transform{Scale: &math32.Vector3{7, 7, 7}}
	X8                        = &Transform{Scale: &math32.Vector3{8, 8, 8}}
	Xhalf                     = &Transform{Scale: &math32.Vector3{0.5, 0.5, 0.5}}
	Xthird                    = &Transform{Scale: &math32.Vector3{0.333, 0.333, 0.333}}
	Xquarter                  = &Transform{Scale: &math32.Vector3{0.25, 0.25, 0.25}}
)

Functions

func DirOf

func DirOf(i interface{}) string

func Load

func Load(filepath, baseFilename string, files map[string][]byte) *obj.Decoder

Types

type ActionId

type ActionId string

type ActionOccurrence

type ActionOccurrence struct {
	Action ActionId
	Ago    float32
}

type AnimationId

type AnimationId string
var ShowAlways AnimationId = ""

type IDrawable

type IDrawable interface {
	Node() INode
}

type INode

type INode interface {
	G3NNode() *core.Node
	G3NNodeMask(r, g, b, a float32) *core.Node
	Transform(ts ...*Transform) INode
	RGBA(color *math32.Color4) INode
}

func NewNode

func NewNode(ns ...INode) INode

func NewShadow

func NewShadow() INode

type NodeSpec

type NodeSpec struct {
	Decoder   *obj.Decoder
	Transform *Transform
	RGBA      *math32.Color4
}

func (*NodeSpec) Build

func (m *NodeSpec) Build() *node

type Sequence

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

func New

func New(counterLimit float32, counterFactor float32, loopable bool, multiple bool, speedFactorWhenStopping float32, steps []*Step) (*Sequence, error)

func NewTimer

func NewTimer(seconds float32) *Sequence

func (*Sequence) Add

func (s *Sequence) Add(c float32)

func (*Sequence) Counter

func (s *Sequence) Counter() float32

func (*Sequence) CounterFactor

func (s *Sequence) CounterFactor() float32

func (*Sequence) CounterLimit

func (s *Sequence) CounterLimit() float32

func (*Sequence) CurrentStep

func (s *Sequence) CurrentStep() int

func (*Sequence) IsActiveAnimation

func (s *Sequence) IsActiveAnimation(v AnimationId) bool

func (*Sequence) PollActions

func (s *Sequence) PollActions() []*ActionOccurrence

func (*Sequence) Reset

func (s *Sequence) Reset()

func (*Sequence) Running

func (s *Sequence) Running() bool

func (*Sequence) Start

func (s *Sequence) Start()

func (*Sequence) Stop

func (s *Sequence) Stop()

func (*Sequence) Stopping

func (s *Sequence) Stopping() bool

type SequenceId

type SequenceId string

type Step

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

func NewStep

func NewStep(startAtCounter float32, safeStart, safeStop bool, animations []AnimationId, actions []ActionId, transformSteps map[*Transform]*TransformStep) *Step

func (*Step) ApplyTransforms

func (s *Step) ApplyTransforms(progress float32)

type Transform

type Transform struct {
	Position *math32.Vector3
	Rotation *math32.Vector3
	Scale    *math32.Vector3
}

func NewTransform

func NewTransform() *Transform

func (*Transform) Apply

func (t *Transform) Apply(node *core.Node) *core.Node

func (*Transform) Inverse

func (t *Transform) Inverse() *Transform

type TransformStep

type TransformStep struct {
	Set    *Transform
	Mutate *Transform
}

Jump to

Keyboard shortcuts

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