model

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body []Model

func (Body) Draw

func (b Body) Draw(g Globals)

func (Body) Inspect

func (b Body) Inspect() Summary

func (Body) Realize

func (b Body) Realize(cleanup func(func())) error

func (Body) Tick

func (b Body) Tick(delta, runtime time.Duration) bool

func (Body) With

func (b Body) With(x ...Transform) Model

type Dynamic added in v0.0.2

type Dynamic shape.DynamicTransform

func (Dynamic) Realize added in v0.0.2

func (x Dynamic) Realize(d, rt time.Duration) tensor.Mat4

type Globals

type Globals struct {
	Flatland tensor.Mat4
	World    World
	Lights   Lights
}

type Heading

type Heading struct {
	Vertical, Horizontal float64
	RadPerSec            struct {
		V, H float64
	}
}

func (*Heading) Orientation

func (h *Heading) Orientation() *Orientation

func (*Heading) SetDeg

func (h *Heading) SetDeg(v tensor.Vec2) *Heading

func (*Heading) Update

func (h *Heading) Update(delta time.Duration, mV, mH Movement)

type Light

type Light struct {
	Position tensor.Vec3
	Ambient  tensor.Vec3
	Diffuse  tensor.Vec3
	Specular tensor.Vec3
}

type Lights

type Lights []Light

func (Lights) Ambient

func (l Lights) Ambient() []tensor.Vec3

func (Lights) Diffuse

func (l Lights) Diffuse() []tensor.Vec3

func (Lights) Position

func (l Lights) Position() []tensor.Vec3

func (Lights) Specular

func (l Lights) Specular() []tensor.Vec3

type Line added in v0.0.2

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

func NewLine added in v0.0.2

func NewLine(desc string, vertex manifold.Polygon, color []tensor.Vec3, closed bool) *Line

func NewLineIndexed added in v0.0.2

func NewLineIndexed(desc string, vertex manifold.Polygon, color []tensor.Vec3, index [][2]geomath.Index) *Line

func (*Line) Draw added in v0.0.2

func (m *Line) Draw(g Globals)

func (*Line) Inspect added in v0.0.2

func (m *Line) Inspect() Summary

func (*Line) Realize added in v0.0.2

func (m *Line) Realize(cleanup func(func())) error

func (*Line) Tick added in v0.0.2

func (m *Line) Tick(delta, runtime time.Duration) bool

func (*Line) With added in v0.0.2

func (m *Line) With(x ...Transform) Model

type Mesh

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

func Illuminati

func Illuminati() *Mesh

func NewShape

func NewShape(desc string, shape manifold.Polyhedron, fnorm func(manifold.Polyhedron) mesh.Normalizer, fcolor func(manifold.Polyhedron) mesh.Colorizer) *Mesh

func (*Mesh) Draw

func (m *Mesh) Draw(g Globals)

func (*Mesh) DrawTriangles

func (m *Mesh) DrawTriangles()

func (*Mesh) Inspect

func (m *Mesh) Inspect() Summary

func (*Mesh) Realize

func (m *Mesh) Realize(cleanup func(func())) error

func (*Mesh) Setup

func (m *Mesh) Setup(g Globals)

func (*Mesh) Teardown

func (m *Mesh) Teardown()

func (*Mesh) Tick

func (m *Mesh) Tick(delta, runtime time.Duration) bool

func (*Mesh) With

func (m *Mesh) With(x ...Transform) Model

type MeshBinder

type MeshBinder func(position, normal, color glu.VertexAttrib) (vao glu.VertexArray, err error)

type MeshOptions

type MeshOptions struct {
	Description string
	NoCull      bool
	Vertex      []tensor.Vec3
	Normal      []tensor.Vec3
	Color       []tensor.Vec4
	Index       geomath.Mesh
}

type Model

type Model interface {
	Realize(func(func())) error
	Tick(delta, runtime time.Duration) bool
	With(...Transform) Model
	Draw(g Globals)

	Inspect() Summary
}

type Movement

type Movement int
const (
	Forward  Movement = +1
	None     Movement = 0
	Backward Movement = -1
)

type Orientation

type Orientation struct {
	Look, Right, Up tensor.Vec3
}

type Position

type Position struct {
	MovePerSec float64
	Value      tensor.Vec3
	View       tensor.Mat4
}

func (*Position) Update

func (p *Position) Update(delta time.Duration, mRight, mUp, mLook Movement, o *Orientation)

type Skybox

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

func (*Skybox) Draw

func (m *Skybox) Draw(g Globals)

func (*Skybox) Inspect

func (m *Skybox) Inspect() Summary

func (*Skybox) Realize

func (m *Skybox) Realize(cleanup func(func())) error

func (*Skybox) Tick

func (m *Skybox) Tick(delta, runtime time.Duration) bool

func (*Skybox) With

func (m *Skybox) With(x ...Transform) Model

type Static added in v0.0.2

type Static shape.Transform

func (Static) Realize added in v0.0.2

func (x Static) Realize(_, _ time.Duration) tensor.Mat4

type Summary

type Summary struct {
	Description     string
	VertexCount     int
	TriangleCount   int
	Transformations []Transform

	Within []Summary
}

func (Summary) String

func (s Summary) String() string

type Text

type Text struct {
	Font  font.Face
	Value string
	Color tensor.Vec4
	Pos   tensor.Vec2
	Size  float64
	// contains filtered or unexported fields
}

func (*Text) Draw

func (m *Text) Draw(g Globals)

func (*Text) Inspect

func (m *Text) Inspect() Summary

func (*Text) Realize

func (m *Text) Realize(cleanup func(func())) error

func (*Text) Tick

func (m *Text) Tick(delta, runtime time.Duration) bool

func (*Text) With

func (m *Text) With(x ...Transform) Model

type Transform added in v0.0.2

type Transform interface {
	Realize(delta, runtime time.Duration) tensor.Mat4
}

type Wireframe added in v0.0.2

type Wireframe struct {
	Model
	Cull bool
}

func (*Wireframe) Draw added in v0.0.2

func (m *Wireframe) Draw(g Globals)

func (*Wireframe) With added in v0.0.2

func (m *Wireframe) With(x ...Transform) Model

type World

type World struct {
	Projection, View tensor.Mat4
	Camera           tensor.Vec3
}

Jump to

Keyboard shortcuts

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