mesh

package
v0.0.0-...-8e5a076 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data[V vertex.VertexFormat, I vertex.IndexFormat] struct {
	Vertices []V
	Indices  []I
}

type Dynamic

type Dynamic[V vertex.VertexFormat, I vertex.IndexFormat] struct {
	*Static
	// contains filtered or unexported fields
}

func NewDynamic

func NewDynamic[V vertex.VertexFormat, I vertex.IndexFormat](pool object.Pool, name string, mat *material.Def, fn Generator[V, I]) *Dynamic[V, I]

func (*Dynamic[V, I]) Name

func (m *Dynamic[V, I]) Name() string

func (*Dynamic[V, I]) Refresh

func (m *Dynamic[V, I]) Refresh()

func (*Dynamic[V, I]) RefreshSync

func (m *Dynamic[V, I]) RefreshSync()

func (*Dynamic[V, I]) Update

func (m *Dynamic[V, I]) Update(scene object.Component, dt float32)

type Generator

type Generator[V vertex.VertexFormat, I vertex.IndexFormat] func() Data[V, I]

type Mesh

type Mesh interface {
	object.Component

	CastShadows() bool

	Material() *material.Def
	MaterialID() material.ID

	// Texture returns the texture attached to the given slot
	Texture(texture.Slot) assets.Texture

	// Mesh returns the mesh data
	Mesh() assets.Mesh
}

type Static

type Static struct {
	object.Component

	CastsShadow object.Property[bool]
	Mat         object.Property[*material.Def]
	Textures    object.Dict[texture.Slot, assets.Texture]
	VertexData  object.Property[assets.Mesh]
	// contains filtered or unexported fields
}

mesh base

func New

func New(pool object.Pool, mat *material.Def) *Static

NewMesh creates a new mesh

func (*Static) CastShadows

func (m *Static) CastShadows() bool

func (*Static) Material

func (m *Static) Material() *material.Def

func (*Static) MaterialID

func (m *Static) MaterialID() material.ID

func (*Static) Mesh

func (m *Static) Mesh() assets.Mesh

func (*Static) Name

func (m *Static) Name() string

func (*Static) SetTexture

func (m *Static) SetTexture(slot texture.Slot, ref assets.Texture)

func (*Static) Texture

func (m *Static) Texture(slot texture.Slot) assets.Texture

Jump to

Keyboard shortcuts

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