Mesh

package
v0.0.0-...-9749107 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: GPL-3.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMesh

type IMesh interface {
	BoundingVolume.ICollisionObject

	GetModelMatrix() GeometryMath.Matrix4x4
	SetModelMatrix(mat GeometryMath.Matrix4x4)

	EnableFrustumCulling()
	DisableFrustumCulling()
}

type IVertexArray

type IVertexArray interface {
	Bind()
	Unbind()
	EnableUVAttribute()
	DisableUVAttribute()
	EnableNormalAttribute()
	DisableNormalAttribute()
	EnableTangentAttribute()
	DisableTangentAttribute()
	EnableBiTangentAttribute()
	DisableBiTangentAttribute()
}

type IndexBuffer

type IndexBuffer struct {
	Length int32

	RestartIndex uint32
	// contains filtered or unexported fields
}

func NewIndexBuffer

func NewIndexBuffer(indices []uint32) *IndexBuffer

func (*IndexBuffer) Bind

func (buff *IndexBuffer) Bind()

func (*IndexBuffer) Unbind

func (buff *IndexBuffer) Unbind()

type InstanceMasterMesh

type InstanceMasterMesh struct {
	Mesh
	MasterMatrix GeometryMath.Matrix4x4
	MatrixBuffer Buffer.Buffer
	Instances    []*InstancedMesh
}

func NewInstanceMasterMesh

func NewInstanceMasterMesh(mesh *Mesh, matrices ...GeometryMath.Matrix4x4) *InstanceMasterMesh

func (*InstanceMasterMesh) CreateNewInstances

func (mesh *InstanceMasterMesh) CreateNewInstances(matrices ...GeometryMath.Matrix4x4) []*InstancedMesh

func (*InstanceMasterMesh) Draw

func (mesh *InstanceMasterMesh) Draw(shader Shader.IShaderProgram, invoker Scene.IDrawable, scene Scene.IScene, camera Camera.ICamera) error

func (*InstanceMasterMesh) SetMasterMatrix

func (mesh *InstanceMasterMesh) SetMasterMatrix(mat GeometryMath.Matrix4x4)

type InstancedMesh

type InstancedMesh struct {
	ModelMatrix GeometryMath.Matrix4x4

	TransformedBoundingVolume BoundingVolume.IBoundingVolume
	FrustumCulling            bool
	Master                    *InstanceMasterMesh
	// contains filtered or unexported fields
}

func (*InstancedMesh) DisableFrustumCulling

func (mesh *InstancedMesh) DisableFrustumCulling()

func (*InstancedMesh) EnableFrustumCulling

func (mesh *InstancedMesh) EnableFrustumCulling()

func (*InstancedMesh) GetBoundingVolume

func (mesh *InstancedMesh) GetBoundingVolume() BoundingVolume.IBoundingVolume

func (*InstancedMesh) GetModelMatrix

func (mesh *InstancedMesh) GetModelMatrix() GeometryMath.Matrix4x4

func (*InstancedMesh) SetModelMatrix

func (mesh *InstancedMesh) SetModelMatrix(mat GeometryMath.Matrix4x4)

type Mesh

type Mesh struct {
	VertexBuffer Buffer.Buffer
	VertexArray  VertexArray
	IndexBuffer  *IndexBuffer
	ModelMatrix  GeometryMath.Matrix4x4

	TransformedBoundingVolume BoundingVolume.IBoundingVolume

	PrimitiveType  PrimitiveType
	FrustumCulling bool
	// contains filtered or unexported fields
}

func NewMesh

func NewMesh(vertices []Vertex, indices []uint32, boundingVolume func(vertices []GeometryMath.Vector3) BoundingVolume.IBoundingVolume) *Mesh

func (*Mesh) DisableFrustumCulling

func (mesh *Mesh) DisableFrustumCulling()

func (*Mesh) Draw

func (mesh *Mesh) Draw(shader Shader.IShaderProgram, invoker Scene.IDrawable, scene Scene.IScene, camera Camera.ICamera) error

func (*Mesh) EnableFrustumCulling

func (mesh *Mesh) EnableFrustumCulling()

func (*Mesh) GetBoundingVolume

func (mesh *Mesh) GetBoundingVolume() BoundingVolume.IBoundingVolume

func (*Mesh) GetIndexBuffer

func (mesh *Mesh) GetIndexBuffer() *IndexBuffer

func (*Mesh) GetModelMatrix

func (mesh *Mesh) GetModelMatrix() GeometryMath.Matrix4x4

func (*Mesh) GetPrimitiveType

func (mesh *Mesh) GetPrimitiveType() PrimitiveType

func (*Mesh) GetVertexArray

func (mesh *Mesh) GetVertexArray() VertexArray

func (*Mesh) GetVertexBuffer

func (mesh *Mesh) GetVertexBuffer() Buffer.Buffer

func (*Mesh) SetModelMatrix

func (mesh *Mesh) SetModelMatrix(mat GeometryMath.Matrix4x4)

type PrimitiveType

type PrimitiveType uint32

type Vertex

type Vertex struct {
	Position GeometryMath.Vector3
	UV       GeometryMath.Vector2

	Normal    GeometryMath.Vector3
	Tangent   GeometryMath.Vector3
	BiTangent GeometryMath.Vector3
}

type VertexArray

type VertexArray uint32

func NewInstancedVertexArray

func NewInstancedVertexArray(vao VertexArray, mbo Buffer.Buffer) VertexArray

func NewVertexArray

func NewVertexArray(vbo Buffer.Buffer) VertexArray

func (VertexArray) Bind

func (vao VertexArray) Bind()

func (VertexArray) DisableBiTangentAttribute

func (vao VertexArray) DisableBiTangentAttribute()

func (VertexArray) DisableNormalAttribute

func (vao VertexArray) DisableNormalAttribute()

func (VertexArray) DisableTangentAttribute

func (vao VertexArray) DisableTangentAttribute()

func (VertexArray) DisableUVAttribute

func (vao VertexArray) DisableUVAttribute()

func (VertexArray) EnableBiTangentAttribute

func (vao VertexArray) EnableBiTangentAttribute()

func (VertexArray) EnableNormalAttribute

func (vao VertexArray) EnableNormalAttribute()

func (VertexArray) EnableTangentAttribute

func (vao VertexArray) EnableTangentAttribute()

func (VertexArray) EnableUVAttribute

func (vao VertexArray) EnableUVAttribute()

func (VertexArray) Unbind

func (vao VertexArray) Unbind()

type Vertices

type Vertices []Vertex

func (Vertices) GetPositions

func (vertices Vertices) GetPositions() []GeometryMath.Vector3

Jump to

Keyboard shortcuts

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