input

package
v0.0.0-...-e791307 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	FOV  float32
	Eye  types.Vec3
	Look types.Vec3
	Up   types.Vec3
}

Camera settings.

type Material

type Material struct {
	Name string

	// Material expression.
	Expression string

	// Relative path for textures.
	AssetRelPath *asset.Resource

	// True if material is referenced by scene geometry.
	Used bool
}

type Mesh

type Mesh struct {
	Name       string
	Primitives []*Primitive
	// contains filtered or unexported fields
}

A mesh is constructed by a list of primitive.

func NewMesh

func NewMesh(name string) *Mesh

Create a new mesh.

func (*Mesh) BBox

func (m *Mesh) BBox() [2]types.Vec3

Get mesh bounding box.

func (*Mesh) MarkBBoxDirty

func (m *Mesh) MarkBBoxDirty()

Mark the bbox of this mesh as dirty.

func (*Mesh) SetBBox

func (m *Mesh) SetBBox(bbox [2]types.Vec3)

Set the mesh AABB.

type MeshInstance

type MeshInstance struct {
	MeshIndex uint32
	Transform types.Mat4
	// contains filtered or unexported fields
}

A mesh instance applies a transformation to a particular Mesh.

func (*MeshInstance) BBox

func (mi *MeshInstance) BBox() [2]types.Vec3

Get AABB.

func (*MeshInstance) Center

func (mi *MeshInstance) Center() types.Vec3

Get AABB center.

func (*MeshInstance) SetBBox

func (mi *MeshInstance) SetBBox(bbox [2]types.Vec3)

Set the mesh instance AABB.

func (*MeshInstance) SetCenter

func (mi *MeshInstance) SetCenter(center types.Vec3)

Set the mesh instance center.

type Primitive

type Primitive struct {
	Vertices      [3]types.Vec3
	Normals       [3]types.Vec3
	UVs           [3]types.Vec2
	MaterialIndex int
	// contains filtered or unexported fields
}

A triangle primitive

func (*Primitive) BBox

func (prim *Primitive) BBox() [2]types.Vec3

Get the primitive AABB.

func (*Primitive) Center

func (prim *Primitive) Center() types.Vec3

Get primitive AABB center.

func (*Primitive) SetBBox

func (prim *Primitive) SetBBox(bbox [2]types.Vec3)

Set the primitive AABB.

func (*Primitive) SetCenter

func (prim *Primitive) SetCenter(center types.Vec3)

Set the primitive center.

type Scene

type Scene struct {
	Meshes        []*Mesh
	MeshInstances []*MeshInstance
	Materials     []*Material
	Camera        *Camera
}

The scene contains all elements that are processed and optimized by the scene compiler. optimized

func NewScene

func NewScene() *Scene

Create a new scene.

Jump to

Keyboard shortcuts

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