models

package
v0.0.0-...-f57b503 Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeTransform

func NodeTransform(node *collada.Node) glm.Mat4d

func Quaternion

func Quaternion(m glm.Mat3d) glm.Quatd

func RotationComponent

func RotationComponent(m glm.Mat4d) glm.Mat3d

Types

type Context

type Context struct {
	sync.RWMutex
	ode.World
	Space      ode.Space
	JointGroup ode.JointGroup
	Profile    protocol.Profile
	// contains filtered or unexported fields
}

Context ...

func NewContext

func NewContext(profile protocol.Profile) *Context

NewContext ...

func (*Context) AddVehicle

func (ctx *Context) AddVehicle(name string, pos []float64) *Vehicle

AddVehicle ...

func (*Context) GetVehicle

func (ctx *Context) GetVehicle(name string) *Vehicle

GetVehicle ...

func (*Context) Iter

func (ctx *Context) Iter(step time.Duration, callback ode.NearCallback)

Iter ...

func (*Context) IterVehicles

func (ctx *Context) IterVehicles(f func(string, *Vehicle))

IterVehicles ...

func (*Context) RmVehicle

func (ctx *Context) RmVehicle(name string)

RmVehicle ...

type Geometry

type Geometry struct {
	Name      string
	Triangles *Triangles
}

func NewGeometry

func NewGeometry(name string, triangles *Triangles) *Geometry

type Index

type Index struct {
	Collada     *collada.Collada
	Id          map[collada.Id]interface{}
	Data        map[collada.Id]interface{}
	Mesh        map[collada.Id]*Mesh
	Transforms  map[collada.Id]glm.Mat4d
	VisualScene *collada.VisualScene
}

func NewIndex

func NewIndex(c *collada.Collada) (*Index, error)

func (*Index) AddId

func (index *Index) AddId(id collada.Id, obj interface{})

func (*Index) ReadOffsets

func (index *Index) ReadOffsets(inputs []*collada.InputShared, verticies map[string]collada.Id) (int, []float64, int, []float64, int)

type IndexPair

type IndexPair struct {
	V int
	N int
}

type Mesh

type Mesh struct {
	VerticesId string
	Triangles  []*Triangles
}

type Model

type Model struct {
	Name          string
	Transform     glm.Mat4d
	BaseTransform glm.Mat4d
	Geometry      []*Geometry
	Children      []*Model
	Parent        *Model
	Unit          float64
}

func EmptyModel

func EmptyModel(name string) *Model

func LoadModel

func LoadModel(index *Index, node *collada.Node, geometryTemplates map[collada.Id][]*Geometry) (*Model, bool)

func LoadSceneAsModel

func LoadSceneAsModel(filename string) (*Model, error)

func NewModel

func NewModel(name string, children []*Model, geometry []*Geometry, transform glm.Mat4d) *Model

func NewSingleModel

func NewSingleModel(name string, triangles *Triangles, transform glm.Mat4d) *Model

func (*Model) AddChild

func (model *Model) AddChild(child *Model)

func (*Model) AddGeometry

func (model *Model) AddGeometry(geometry ...*Geometry) *Model

func (*Model) FindModelWithName

func (model *Model) FindModelWithName(name string) (*Model, bool)

func (*Model) SetTransform

func (model *Model) SetTransform(m glm.Mat4d) *Model

func (*Model) WorldTransform

func (model *Model) WorldTransform() glm.Mat4d

type Triangles

type Triangles struct {
	VertexData []float64
	NormalData []float64
	Index      []int
}

type Vehicle

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

Vehicle ...

func NewVehicle

func NewVehicle(ctx *Context, profile protocol.VehicleProfile) *Vehicle

NewVehicle ...

func (*Vehicle) Destroy

func (v *Vehicle) Destroy()

func (*Vehicle) Position

func (v *Vehicle) Position() ode.Vector3

func (*Vehicle) Quaternion

func (v *Vehicle) Quaternion() ode.Quaternion

func (*Vehicle) Rotation

func (v *Vehicle) Rotation() ode.Matrix3

func (*Vehicle) Set

func (v *Vehicle) Set(in *protocol.Input)

func (*Vehicle) SetPosition

func (v *Vehicle) SetPosition(pos ode.Vector3)

func (*Vehicle) Update

func (v *Vehicle) Update(dt float64)

func (*Vehicle) Wheel

func (v *Vehicle) Wheel(index int) *Wheel

type Wheel

type Wheel struct {
	Joint ode.Hinge2Joint
	// contains filtered or unexported fields
}

Wheel ...

func NewWheel

func NewWheel(ctx *Context, density, diameter, width float64) *Wheel

NewWheel ...

func (*Wheel) Destroy

func (w *Wheel) Destroy()

func (*Wheel) Position

func (w *Wheel) Position() ode.Vector3

func (*Wheel) Quaternion

func (w *Wheel) Quaternion() ode.Quaternion

func (*Wheel) Rotation

func (w *Wheel) Rotation() ode.Matrix3

Jump to

Keyboard shortcuts

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