Documentation
¶
Index ¶
- func EncodeObjects(offset int, length int, objects ...DimSlicer) []byte
- func MultiMul(matrices ...*mgl.Mat4) mgl.Mat4
- func Quad(a mgl.Vec3, b mgl.Vec3) []float32
- func RandomParticle(origin mgl.Vec3, force float32) *particle
- func StartMobile(engine Engine)
- func Upvote(tip mgl.Vec3, size float32) []float32
- type DimSlicer
- type DrawContext
- type Drawable
- type DynamicShape
- type Emitter
- type Engine
- type Floor
- type FrameContext
- type Light
- type Node
- type Point
- type Scene
- type Shape
- type Skybox
- type StaticShape
- type Vector
- type World
- type WorldContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeObjects ¶
EncodeObjects converts float32 vertices into a LittleEndian byte array. Offset and length are based on the number of rows per dimension. TODO: Replace with https://github.com/lunixbochs/struc?
func MultiMul ¶
MultiMul multiplies every non-nil Mat4 reference and returns the result. If none are given, then it returns the identity matrix.
func RandomParticle ¶
func StartMobile ¶
func StartMobile(engine Engine)
StartMobile launches the Engine using the x/mobile backend, should be run from the main thread.
Types ¶
type DimSlicer ¶
func NewDimSlice ¶
type DrawContext ¶
type DynamicShape ¶
type DynamicShape struct {
StaticShape
}
func NewDynamicShape ¶
func NewDynamicShape(glctx gl.Context, bufSize int) *DynamicShape
func (*DynamicShape) Buffer ¶
func (shape *DynamicShape) Buffer(offset int)
type Engine ¶
type Floor ¶
type Floor struct { Node // contains filtered or unexported fields }
func (*Floor) Draw ¶
func (scene *Floor) Draw(ctx DrawContext)
type FrameContext ¶
type FrameContext struct { GL gl.Context Camera camera.Camera // contains filtered or unexported fields }
func (*FrameContext) DrawContext ¶
func (ctx *FrameContext) DrawContext(shader loader.Shader) DrawContext
type Node ¶
type Node struct { Shape // contains filtered or unexported fields }
TODO: node tree with transforms
func (*Node) Draw ¶
func (node *Node) Draw(ctx DrawContext)
type Scene ¶
type Scene interface { Add(Drawable) Draw(FrameContext) String() string }
type Skybox ¶
type Skybox struct {
Node
}
func (*Skybox) Draw ¶
func (node *Skybox) Draw(ctx DrawContext)
type StaticShape ¶
type StaticShape struct { VBO gl.Buffer IBO gl.Buffer Texture gl.Texture // contains filtered or unexported fields }
func NewStaticShape ¶
func NewStaticShape(glctx gl.Context) *StaticShape
func (*StaticShape) Buffer ¶
func (shape *StaticShape) Buffer()
func (*StaticShape) Bytes ¶
func (shape *StaticShape) Bytes() []byte
func (*StaticShape) BytesOffset ¶
func (shape *StaticShape) BytesOffset(n int) []byte
func (*StaticShape) Close ¶
func (shape *StaticShape) Close() error
func (*StaticShape) Draw ¶
func (shape *StaticShape) Draw(ctx DrawContext)
func (*StaticShape) Len ¶
func (s *StaticShape) Len() int
func (*StaticShape) Stride ¶
func (shape *StaticShape) Stride() int
Source Files
¶
Click to show internal directories.
Click to hide internal directories.