mdl

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CubeUVToUVW

func CubeUVToUVW(side CubeSide, uv dprec.Vec2) dprec.Vec3

func UVWToEquirectangularUV

func UVWToEquirectangularUV(uvw dprec.Vec3) dprec.Vec2

Types

type AmbientLight

type AmbientLight struct {
	BaseShadowCaster
	// contains filtered or unexported fields
}

func NewAmbientLight

func NewAmbientLight() *AmbientLight

func (*AmbientLight) ReflectionTexture

func (l *AmbientLight) ReflectionTexture() *Texture

func (*AmbientLight) RefractionTexture

func (l *AmbientLight) RefractionTexture() *Texture

func (*AmbientLight) SetReflectionTexture

func (l *AmbientLight) SetReflectionTexture(texture *Texture)

func (*AmbientLight) SetRefractionTexture

func (l *AmbientLight) SetRefractionTexture(texture *Texture)

type Animation

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

func (*Animation) AddBinding

func (a *Animation) AddBinding(binding *AnimationBinding)

func (*Animation) Bindings

func (a *Animation) Bindings() []*AnimationBinding

func (*Animation) EndTime

func (a *Animation) EndTime() float64

func (*Animation) Name

func (a *Animation) Name() string

func (*Animation) SetEndTime

func (a *Animation) SetEndTime(value float64)

func (*Animation) SetName

func (a *Animation) SetName(value string)

func (*Animation) SetStartTime

func (a *Animation) SetStartTime(value float64)

func (*Animation) StartTime

func (a *Animation) StartTime() float64

type AnimationBinding

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

func (*AnimationBinding) AddRotationKeyframe

func (a *AnimationBinding) AddRotationKeyframe(keyframe RotationKeyframe)

func (*AnimationBinding) AddScaleKeyframe

func (a *AnimationBinding) AddScaleKeyframe(keyframe ScaleKeyframe)

func (*AnimationBinding) AddTranslationKeyframe

func (a *AnimationBinding) AddTranslationKeyframe(keyframe TranslationKeyframe)

func (*AnimationBinding) NodeName

func (a *AnimationBinding) NodeName() string

func (*AnimationBinding) RotationKeyframes

func (a *AnimationBinding) RotationKeyframes() []RotationKeyframe

func (*AnimationBinding) ScaleKeyframes

func (a *AnimationBinding) ScaleKeyframes() []ScaleKeyframe

func (*AnimationBinding) SetNodeName

func (a *AnimationBinding) SetNodeName(value string)

func (*AnimationBinding) TranslationKeyframes

func (a *AnimationBinding) TranslationKeyframes() []TranslationKeyframe

type Armature

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

func NewArmature

func NewArmature() *Armature

func (*Armature) AddJoint

func (a *Armature) AddJoint(joint *Joint)

func (*Armature) Joints

func (a *Armature) Joints() []*Joint

type BaseColorEmitter

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

func (*BaseColorEmitter) EmitColor

func (b *BaseColorEmitter) EmitColor() dprec.Vec3

func (*BaseColorEmitter) SetEmitColor

func (b *BaseColorEmitter) SetEmitColor(color dprec.Vec3)

type BaseConeEmitter

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

func (*BaseConeEmitter) EmitAngleInner

func (b *BaseConeEmitter) EmitAngleInner() dprec.Angle

func (*BaseConeEmitter) EmitAngleOuter

func (b *BaseConeEmitter) EmitAngleOuter() dprec.Angle

func (*BaseConeEmitter) SetEmitAngleInner

func (b *BaseConeEmitter) SetEmitAngleInner(angle dprec.Angle)

func (*BaseConeEmitter) SetEmitAngleOuter

func (b *BaseConeEmitter) SetEmitAngleOuter(angle dprec.Angle)

type BaseDistanceEmitter

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

func (*BaseDistanceEmitter) EmitDistance

func (b *BaseDistanceEmitter) EmitDistance() float64

func (*BaseDistanceEmitter) SetEmitDistance

func (b *BaseDistanceEmitter) SetEmitDistance(distance float64)

type BaseFilterable

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

func (*BaseFilterable) FilterMode

func (b *BaseFilterable) FilterMode() FilterMode

func (*BaseFilterable) SetFilterMode

func (b *BaseFilterable) SetFilterMode(mode FilterMode)

type BaseMipmappable

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

func (*BaseMipmappable) Mipmapping

func (b *BaseMipmappable) Mipmapping() bool

func (*BaseMipmappable) SetMipmapping

func (b *BaseMipmappable) SetMipmapping(mipmapping bool)

type BaseShadowCaster

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

func (*BaseShadowCaster) CastShadow

func (b *BaseShadowCaster) CastShadow() bool

func (*BaseShadowCaster) SetCastShadow

func (b *BaseShadowCaster) SetCastShadow(castShadow bool)

type BaseTextureReferrer

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

func (*BaseTextureReferrer) SetTexture

func (b *BaseTextureReferrer) SetTexture(texture *Texture)

func (*BaseTextureReferrer) Texture

func (b *BaseTextureReferrer) Texture() *Texture

type BaseWrappable

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

func (*BaseWrappable) SetWrapMode

func (b *BaseWrappable) SetWrapMode(mode WrapMode)

func (*BaseWrappable) WrapMode

func (b *BaseWrappable) WrapMode() WrapMode

type Body

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

func NewBody

func NewBody(definition *BodyDefinition) *Body

func (*Body) Definition

func (b *Body) Definition() *BodyDefinition

type BodyDefinition

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

func NewBodyDefinition

func NewBodyDefinition(material *BodyMaterial) *BodyDefinition

func (*BodyDefinition) AddCollisionBox

func (d *BodyDefinition) AddCollisionBox(value *CollisionBox)

func (*BodyDefinition) AddCollisionMesh

func (d *BodyDefinition) AddCollisionMesh(value *CollisionMesh)

func (*BodyDefinition) AddCollisionMeshes

func (d *BodyDefinition) AddCollisionMeshes(collisionMeshes []*CollisionMesh)

func (*BodyDefinition) AddCollisionSphere

func (d *BodyDefinition) AddCollisionSphere(value *CollisionSphere)

func (*BodyDefinition) AngularDragFactor

func (d *BodyDefinition) AngularDragFactor() float64

func (*BodyDefinition) CollisionBoxes

func (d *BodyDefinition) CollisionBoxes() []*CollisionBox

func (*BodyDefinition) CollisionMeshes

func (d *BodyDefinition) CollisionMeshes() []*CollisionMesh

func (*BodyDefinition) CollisionSpheres

func (d *BodyDefinition) CollisionSpheres() []*CollisionSphere

func (*BodyDefinition) DragFactor

func (d *BodyDefinition) DragFactor() float64

func (*BodyDefinition) Mass

func (d *BodyDefinition) Mass() float64

func (*BodyDefinition) Material

func (d *BodyDefinition) Material() *BodyMaterial

func (*BodyDefinition) MomentOfInertia

func (d *BodyDefinition) MomentOfInertia() dprec.Mat3

func (*BodyDefinition) SetAngularDragFactor

func (d *BodyDefinition) SetAngularDragFactor(value float64)

func (*BodyDefinition) SetCollisionMeshes

func (d *BodyDefinition) SetCollisionMeshes(collisionMeshes []*CollisionMesh)

func (*BodyDefinition) SetDragFactor

func (d *BodyDefinition) SetDragFactor(value float64)

func (*BodyDefinition) SetMass

func (d *BodyDefinition) SetMass(value float64)

func (*BodyDefinition) SetMomentOfInertia

func (d *BodyDefinition) SetMomentOfInertia(value dprec.Mat3)

type BodyMaterial

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

func NewBodyMaterial

func NewBodyMaterial() *BodyMaterial

func (*BodyMaterial) FrictionCoefficient

func (m *BodyMaterial) FrictionCoefficient() float64

func (*BodyMaterial) RestitutionCoefficient

func (m *BodyMaterial) RestitutionCoefficient() float64

func (*BodyMaterial) SetFrictionCoefficient

func (m *BodyMaterial) SetFrictionCoefficient(value float64)

func (*BodyMaterial) SetRestitutionCoefficient

func (m *BodyMaterial) SetRestitutionCoefficient(value float64)

type CollisionBox

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

func NewCollisionBox

func NewCollisionBox() *CollisionBox

func (*CollisionBox) Height

func (b *CollisionBox) Height() float64

func (*CollisionBox) Length

func (b *CollisionBox) Length() float64

func (*CollisionBox) Rotation

func (b *CollisionBox) Rotation() dprec.Quat

func (*CollisionBox) SetHeight

func (b *CollisionBox) SetHeight(value float64)

func (*CollisionBox) SetLength

func (b *CollisionBox) SetLength(value float64)

func (*CollisionBox) SetRotation

func (b *CollisionBox) SetRotation(value dprec.Quat)

func (*CollisionBox) SetTranslation

func (b *CollisionBox) SetTranslation(value dprec.Vec3)

func (*CollisionBox) SetWidth

func (b *CollisionBox) SetWidth(value float64)

func (*CollisionBox) Translation

func (b *CollisionBox) Translation() dprec.Vec3

func (*CollisionBox) Width

func (b *CollisionBox) Width() float64

type CollisionMesh

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

func NewCollisionMesh

func NewCollisionMesh() *CollisionMesh

func (*CollisionMesh) AddTriangle

func (m *CollisionMesh) AddTriangle(value CollisionTriangle)

func (*CollisionMesh) Rotation

func (m *CollisionMesh) Rotation() dprec.Quat

func (*CollisionMesh) SetRotation

func (m *CollisionMesh) SetRotation(value dprec.Quat)

func (*CollisionMesh) SetTranslation

func (m *CollisionMesh) SetTranslation(value dprec.Vec3)

func (*CollisionMesh) SetTriangles

func (m *CollisionMesh) SetTriangles(triangles []CollisionTriangle)

func (*CollisionMesh) Translation

func (m *CollisionMesh) Translation() dprec.Vec3

func (*CollisionMesh) Triangles

func (m *CollisionMesh) Triangles() []CollisionTriangle

type CollisionSphere

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

func NewCollisionSphere

func NewCollisionSphere() *CollisionSphere

func (*CollisionSphere) Radius

func (s *CollisionSphere) Radius() float64

func (*CollisionSphere) SetRadius

func (s *CollisionSphere) SetRadius(value float64)

func (*CollisionSphere) SetTranslation

func (s *CollisionSphere) SetTranslation(value dprec.Vec3)

func (*CollisionSphere) Translation

func (s *CollisionSphere) Translation() dprec.Vec3

type CollisionTriangle

type CollisionTriangle struct {
	A dprec.Vec3
	B dprec.Vec3
	C dprec.Vec3
}

type Color

type Color struct {
	R float64
	G float64
	B float64
	A float64
}

func RGBA16FColor

func RGBA16FColor(r, g, b, a float16.Float16) Color

func RGBA32FColor

func RGBA32FColor(r, g, b, a float32) Color

func RGBA64FColor

func RGBA64FColor(r, g, b, a float64) Color

func RGBA8Color

func RGBA8Color(r, g, b, a uint8) Color

func (Color) RGBA16F

func (c Color) RGBA16F() (r, g, b, a float16.Float16)

func (Color) RGBA32F

func (c Color) RGBA32F() (r, g, b, a float32)

func (Color) RGBA64F

func (c Color) RGBA64F() (r, g, b, a float64)

func (Color) RGBA8

func (c Color) RGBA8() (r, g, b, a uint8)

type ColorEmitter

type ColorEmitter interface {
	EmitColor() dprec.Vec3
	SetEmitColor(color dprec.Vec3)
}

type Comparison

type Comparison = asset.Comparison
const (
	ComparisonNever          Comparison = asset.ComparisonNever
	ComparisonLess           Comparison = asset.ComparisonLess
	ComparisonEqual          Comparison = asset.ComparisonEqual
	ComparisonLessOrEqual    Comparison = asset.ComparisonLessOrEqual
	ComparisonGreater        Comparison = asset.ComparisonGreater
	ComparisonNotEqual       Comparison = asset.ComparisonNotEqual
	ComparisonGreaterOrEqual Comparison = asset.ComparisonGreaterOrEqual
	ComparisonAlways         Comparison = asset.ComparisonAlways
)

type ConeEmitter

type ConeEmitter interface {
	EmitAngleOuter() dprec.Angle
	SetEmitAngleOuter(angle dprec.Angle)
	EmitAngleInner() dprec.Angle
	SetEmitAngleInner(angle dprec.Angle)
}

type Converter

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

func NewConverter

func NewConverter(model *Model) *Converter

func (*Converter) Convert

func (c *Converter) Convert() (asset.Model, error)

type CubeImage

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

func BuildIrradianceCubeImage

func BuildIrradianceCubeImage(srcImage *CubeImage, sampleCount int, minDot float64) *CubeImage

func NewCubeImage

func NewCubeImage(size int) *CubeImage

func (*CubeImage) MapTexels added in v0.21.0

func (i *CubeImage) MapTexels(fn func(texel Color) Color) *CubeImage

func (*CubeImage) Scale

func (i *CubeImage) Scale(newSize int) *CubeImage

func (*CubeImage) SetSide

func (i *CubeImage) SetSide(side CubeSide, image *Image)

func (*CubeImage) Side

func (i *CubeImage) Side(side CubeSide) *Image

func (CubeImage) TexelUVW

func (i CubeImage) TexelUVW(uvw dprec.Vec3) Color

func (CubeImage) TexelUVWBilinear

func (i CubeImage) TexelUVWBilinear(uvw dprec.Vec3) Color

type CubeSide

type CubeSide uint8
const (
	CubeSideFront CubeSide = iota
	CubeSideRear
	CubeSideLeft
	CubeSideRight
	CubeSideTop
	CubeSideBottom
)

func UVWToCubeUV

func UVWToCubeUV(uvw dprec.Vec3) (CubeSide, dprec.Vec2)

type CullMode

type CullMode = asset.CullMode
const (
	CullModeNone         CullMode = asset.CullModeNone
	CullModeFront        CullMode = asset.CullModeFront
	CullModeBack         CullMode = asset.CullModeBack
	CullModeFrontAndBack CullMode = asset.CullModeFrontAndBack
)

type DirectionalLight

type DirectionalLight struct {
	BaseColorEmitter
	BaseShadowCaster
}

func NewDirectionalLight

func NewDirectionalLight() *DirectionalLight

type DistanceEmitter

type DistanceEmitter interface {
	EmitDistance() float64
	SetEmitDistance(distance float64)
}

type FaceOrientation

type FaceOrientation = asset.FaceOrientation
const (
	FaceOrientationCCW FaceOrientation = asset.FaceOrientationCCW
	FaceOrientationCW  FaceOrientation = asset.FaceOrientationCW
)

type FilterMode

type FilterMode = asset.FilterMode
const (
	FilterModeNearest     FilterMode = asset.FilterModeNearest
	FilterModeLinear      FilterMode = asset.FilterModeLinear
	FilterModeAnisotropic FilterMode = asset.FilterModeAnisotropic
)

type Filterable

type Filterable interface {
	FilterMode() FilterMode
	SetFilterMode(mode FilterMode)
}

type Fragment

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

func NewFragment

func NewFragment() *Fragment

func (*Fragment) IndexCount

func (f *Fragment) IndexCount() int

func (*Fragment) IndexOffset

func (f *Fragment) IndexOffset() int

func (*Fragment) Metadata

func (f *Fragment) Metadata() Metadata

func (*Fragment) Name

func (f *Fragment) Name() string

func (*Fragment) SetIndexCount

func (f *Fragment) SetIndexCount(count int)

func (*Fragment) SetIndexOffset

func (f *Fragment) SetIndexOffset(offset int)

func (*Fragment) SetMetadata

func (f *Fragment) SetMetadata(metadata Metadata)

func (*Fragment) SetName

func (f *Fragment) SetName(name string)

func (*Fragment) SetTopology

func (f *Fragment) SetTopology(topology Topology)

func (*Fragment) Topology

func (f *Fragment) Topology() Topology

type Geometry

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

func NewGeometry

func NewGeometry() *Geometry

func (*Geometry) AddFragment

func (g *Geometry) AddFragment(fragment *Fragment)

func (*Geometry) AddIndex

func (g *Geometry) AddIndex(index int)

func (*Geometry) AddVertex

func (g *Geometry) AddVertex(vertex Vertex)

func (*Geometry) Format

func (g *Geometry) Format() VertexFormat

func (*Geometry) Fragments

func (g *Geometry) Fragments() []*Fragment

func (*Geometry) Index

func (g *Geometry) Index(at int) int

func (*Geometry) IndexOffset

func (g *Geometry) IndexOffset() int

func (*Geometry) Indices

func (g *Geometry) Indices() []int

func (*Geometry) MaxDistance

func (g *Geometry) MaxDistance() float64

func (*Geometry) Metadata

func (g *Geometry) Metadata() Metadata

func (*Geometry) MinDistance

func (g *Geometry) MinDistance() float64

func (*Geometry) Name

func (g *Geometry) Name() string

func (*Geometry) SetFormat

func (g *Geometry) SetFormat(format VertexFormat)

func (*Geometry) SetMaxDistance

func (g *Geometry) SetMaxDistance(distance float64)

func (*Geometry) SetMetadata

func (g *Geometry) SetMetadata(metadata Metadata)

func (*Geometry) SetMinDistance

func (g *Geometry) SetMinDistance(distance float64)

func (*Geometry) SetName

func (g *Geometry) SetName(name string)

func (*Geometry) Vertex

func (g *Geometry) Vertex(at int) Vertex

func (*Geometry) VertexOffset

func (g *Geometry) VertexOffset() int

func (*Geometry) Vertices

func (g *Geometry) Vertices() []Vertex

type Image

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

func BuildCubeSideFromEquirectangular

func BuildCubeSideFromEquirectangular(side CubeSide, srcImage *Image) *Image

func BuildImageResource

func BuildImageResource(img image.Image) *Image

func NewImage

func NewImage(width, height int) *Image

func ParseImage

func ParseImage(in io.Reader) (*Image, error)

func (*Image) CopyFrom

func (i *Image) CopyFrom(src *Image)

func (*Image) DataRGBA16F

func (i *Image) DataRGBA16F() []byte

func (*Image) DataRGBA32F

func (i *Image) DataRGBA32F() []byte

func (*Image) DataRGBA8

func (i *Image) DataRGBA8() []byte

func (*Image) Height

func (i *Image) Height() int

func (*Image) IsEqualSize

func (i *Image) IsEqualSize(other *Image) bool

func (*Image) IsSquare

func (i *Image) IsSquare() bool

func (*Image) Name

func (i *Image) Name() string

func (*Image) Scale

func (i *Image) Scale(newWidth, newHeight int) *Image

func (*Image) SetName

func (i *Image) SetName(name string)

func (*Image) SetTexel

func (i *Image) SetTexel(x, y int, texel Color)

func (*Image) Texel

func (i *Image) Texel(x, y int) Color

func (*Image) TexelUV

func (i *Image) TexelUV(uv dprec.Vec2) Color

func (*Image) TexelUVBilinear

func (i *Image) TexelUVBilinear(uv dprec.Vec2) Color

func (*Image) Width

func (i *Image) Width() int

type Joint

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

func NewJoint

func NewJoint() *Joint

func (*Joint) InverseBindMatrix

func (j *Joint) InverseBindMatrix() sprec.Mat4

func (*Joint) Node

func (j *Joint) Node() *Node

func (*Joint) SetInverseBindMatrix

func (j *Joint) SetInverseBindMatrix(matrix sprec.Mat4)

func (*Joint) SetNode

func (j *Joint) SetNode(node *Node)

type Keyframe

type Keyframe[T any] struct {
	Timestamp float64
	Value     T
}

type Material

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

func (*Material) AddForwardPass

func (m *Material) AddForwardPass(pass *MaterialPass)

func (*Material) AddGeometryPass

func (m *Material) AddGeometryPass(pass *MaterialPass)

func (*Material) AddPostprocessPass

func (m *Material) AddPostprocessPass(pass *MaterialPass)

func (*Material) AddShadowPass

func (m *Material) AddShadowPass(pass *MaterialPass)

func (*Material) AddSkyPass

func (m *Material) AddSkyPass(pass *MaterialPass)

func (*Material) Clear

func (m *Material) Clear()

func (*Material) ForwardPasses

func (m *Material) ForwardPasses() []*MaterialPass

func (*Material) GeometryPasses

func (m *Material) GeometryPasses() []*MaterialPass

func (*Material) Metadata

func (m *Material) Metadata() Metadata

func (*Material) Name

func (m *Material) Name() string

func (*Material) PostprocessPasses

func (m *Material) PostprocessPasses() []*MaterialPass

func (*Material) Property

func (m *Material) Property(name string) any

func (*Material) Sampler

func (m *Material) Sampler(name string) *Sampler

func (*Material) SetMetadata

func (m *Material) SetMetadata(metadata Metadata)

func (*Material) SetName

func (m *Material) SetName(name string)

func (*Material) SetProperty

func (m *Material) SetProperty(name string, value any)

func (*Material) SetSampler

func (m *Material) SetSampler(name string, sampler *Sampler)

func (*Material) ShadowPasses

func (m *Material) ShadowPasses() []*MaterialPass

func (*Material) SkyPasses

func (m *Material) SkyPasses() []*MaterialPass

type MaterialPass

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

func NewMaterialPass

func NewMaterialPass() *MaterialPass

func (*MaterialPass) Blending

func (m *MaterialPass) Blending() bool

func (*MaterialPass) Culling

func (m *MaterialPass) Culling() CullMode

func (*MaterialPass) DepthComparison

func (m *MaterialPass) DepthComparison() Comparison

func (*MaterialPass) DepthTest

func (m *MaterialPass) DepthTest() bool

func (*MaterialPass) DepthWrite

func (m *MaterialPass) DepthWrite() bool

func (*MaterialPass) FrontFace

func (m *MaterialPass) FrontFace() FaceOrientation

func (*MaterialPass) Layer

func (m *MaterialPass) Layer() int

func (*MaterialPass) SetBlending

func (m *MaterialPass) SetBlending(blending bool)

func (*MaterialPass) SetCulling

func (m *MaterialPass) SetCulling(culling CullMode)

func (*MaterialPass) SetDepthComparison

func (m *MaterialPass) SetDepthComparison(depthComparison Comparison)

func (*MaterialPass) SetDepthTest

func (m *MaterialPass) SetDepthTest(depthTest bool)

func (*MaterialPass) SetDepthWrite

func (m *MaterialPass) SetDepthWrite(depthWrite bool)

func (*MaterialPass) SetFrontFace

func (m *MaterialPass) SetFrontFace(frontFace FaceOrientation)

func (*MaterialPass) SetLayer

func (m *MaterialPass) SetLayer(layer int)

func (*MaterialPass) SetShader

func (m *MaterialPass) SetShader(shader *Shader)

func (*MaterialPass) Shader

func (m *MaterialPass) Shader() *Shader

type Mesh

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

func NewMesh

func NewMesh() *Mesh

func (*Mesh) Armature

func (m *Mesh) Armature() *Armature

func (*Mesh) Definition

func (m *Mesh) Definition() *MeshDefinition

func (*Mesh) SetArmature

func (m *Mesh) SetArmature(armature *Armature)

func (*Mesh) SetDefinition

func (m *Mesh) SetDefinition(definition *MeshDefinition)

type MeshDefinition

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

func (*MeshDefinition) BindMaterial

func (m *MeshDefinition) BindMaterial(name string, material *Material)

func (*MeshDefinition) Geometry

func (m *MeshDefinition) Geometry() *Geometry

func (*MeshDefinition) Materials

func (m *MeshDefinition) Materials() []*Material

func (*MeshDefinition) Name

func (m *MeshDefinition) Name() string

func (*MeshDefinition) SetGeometry

func (m *MeshDefinition) SetGeometry(geometry *Geometry)

func (*MeshDefinition) SetName

func (m *MeshDefinition) SetName(name string)

type Metadata

type Metadata map[string]string

func (Metadata) FloatProperty

func (m Metadata) FloatProperty(key string) (float64, bool)

func (Metadata) HasCollision

func (m Metadata) HasCollision() bool

func (Metadata) HasMaxDistance

func (m Metadata) HasMaxDistance() (float64, bool)

func (Metadata) HasMinDistance

func (m Metadata) HasMinDistance() (float64, bool)

func (Metadata) HasSkipCollision

func (m Metadata) HasSkipCollision() bool

func (Metadata) IsInvisible

func (m Metadata) IsInvisible() bool

func (Metadata) IsSet

func (m Metadata) IsSet(key string) bool

type MipmapLayer added in v0.21.0

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

func (*MipmapLayer) Depth added in v0.21.0

func (l *MipmapLayer) Depth() int

func (*MipmapLayer) Height added in v0.21.0

func (l *MipmapLayer) Height() int

func (*MipmapLayer) Layers added in v0.21.0

func (l *MipmapLayer) Layers() []TextureLayer

func (*MipmapLayer) Width added in v0.21.0

func (l *MipmapLayer) Width() int

type Mipmappable

type Mipmappable interface {
	Mipmapping() bool
	SetMipmapping(mipmapping bool)
}

type Model

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

func (*Model) AddAnimation

func (s *Model) AddAnimation(animation *Animation)

func (*Model) AddNode

func (s *Model) AddNode(node *Node)

func (*Model) Animations

func (s *Model) Animations() []*Animation

func (*Model) FlattenNodes

func (s *Model) FlattenNodes() []*Node

func (*Model) Name

func (s *Model) Name() string

func (*Model) Nodes

func (s *Model) Nodes() []*Node

func (*Model) RemoveNode

func (s *Model) RemoveNode(node *Node)

func (*Model) SetName

func (s *Model) SetName(name string)

type Node

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

func NewNode

func NewNode(name string) *Node

func (*Node) AddNode

func (n *Node) AddNode(node *Node)

func (*Node) Name

func (n *Node) Name() string

func (*Node) Nodes

func (n *Node) Nodes() []*Node

func (*Node) Parent

func (n *Node) Parent() *Node

func (*Node) RemoveNode

func (n *Node) RemoveNode(node *Node)

func (*Node) Rotation

func (n *Node) Rotation() dprec.Quat

func (*Node) Scale

func (n *Node) Scale() dprec.Vec3

func (*Node) SetMetadata

func (n *Node) SetMetadata(metadata Metadata)

func (*Node) SetName

func (n *Node) SetName(name string)

func (*Node) SetParent

func (n *Node) SetParent(parent *Node)

func (*Node) SetRotation

func (n *Node) SetRotation(rotation dprec.Quat)

func (*Node) SetScale

func (n *Node) SetScale(scale dprec.Vec3)

func (*Node) SetSource

func (n *Node) SetSource(source any)

func (*Node) SetTarget

func (n *Node) SetTarget(target any)

func (*Node) SetTranslation

func (n *Node) SetTranslation(translation dprec.Vec3)

func (*Node) Source

func (n *Node) Source() any

func (*Node) Target

func (n *Node) Target() any

func (*Node) Translation

func (n *Node) Translation() dprec.Vec3

type PointLight

func NewPointLight

func NewPointLight() *PointLight

type RotationKeyframe

type RotationKeyframe = Keyframe[dprec.Quat]

type ScaleKeyframe

type ScaleKeyframe = Keyframe[dprec.Vec3]

type Shader

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

func NewShader

func NewShader(shaderType ShaderType) *Shader

func (*Shader) SetShaderType

func (s *Shader) SetShaderType(shaderType ShaderType)

func (*Shader) SetSourceCode

func (s *Shader) SetSourceCode(sourceCode string)

func (*Shader) ShaderType

func (s *Shader) ShaderType() ShaderType

func (*Shader) SourceCode

func (s *Shader) SourceCode() string

type ShaderType

type ShaderType = asset.ShaderType
const (
	ShaderTypeGeometry    ShaderType = asset.ShaderTypeGeometry
	ShaderTypeShadow      ShaderType = asset.ShaderTypeShadow
	ShaderTypeForward     ShaderType = asset.ShaderTypeForward
	ShaderTypeSky         ShaderType = asset.ShaderTypeSky
	ShaderTypePostprocess ShaderType = asset.ShaderTypePostprocess
)

type ShadowCaster

type ShadowCaster interface {
	CastShadow() bool
	SetCastShadow(castShadow bool)
}

type Sky

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

func NewSky

func NewSky() *Sky

func (*Sky) Material

func (s *Sky) Material() *Material

func (*Sky) SetMaterial

func (s *Sky) SetMaterial(material *Material)

type SpotLight

func NewSpotLight

func NewSpotLight() *SpotLight

type Texture

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

func Create2DTexture added in v0.21.0

func Create2DTexture(width, height, mipmaps int, format TextureFormat) *Texture

func CreateCubeTexture added in v0.21.0

func CreateCubeTexture(dimension, mipmaps int, format TextureFormat) *Texture

func (*Texture) Format

func (t *Texture) Format() TextureFormat

func (*Texture) GenerateMipmaps

func (t *Texture) GenerateMipmaps() bool

func (*Texture) Kind

func (t *Texture) Kind() TextureKind

func (*Texture) Linear added in v0.21.0

func (t *Texture) Linear() bool

func (*Texture) Name

func (t *Texture) Name() string

func (*Texture) SetGenerateMipmaps

func (t *Texture) SetGenerateMipmaps(generateMipmaps bool)

func (*Texture) SetLayerImage

func (t *Texture) SetLayerImage(mipmap, index int, image *Image)

func (*Texture) SetLinear added in v0.21.0

func (t *Texture) SetLinear(isLinear bool)

func (*Texture) SetName

func (t *Texture) SetName(name string)

type TextureFormat

type TextureFormat = asset.TexelFormat
const (
	TextureFormatR8       TextureFormat = asset.TexelFormatR8
	TextureFormatR16      TextureFormat = asset.TexelFormatR16
	TextureFormatR16F     TextureFormat = asset.TexelFormatR16F
	TextureFormatR32F     TextureFormat = asset.TexelFormatR32F
	TextureFormatRG8      TextureFormat = asset.TexelFormatRG8
	TextureFormatRG16     TextureFormat = asset.TexelFormatRG16
	TextureFormatRG16F    TextureFormat = asset.TexelFormatRG16F
	TextureFormatRG32F    TextureFormat = asset.TexelFormatRG32F
	TextureFormatRGB8     TextureFormat = asset.TexelFormatRGB8
	TextureFormatRGB16    TextureFormat = asset.TexelFormatRGB16
	TextureFormatRGB16F   TextureFormat = asset.TexelFormatRGB16F
	TextureFormatRGB32F   TextureFormat = asset.TexelFormatRGB32F
	TextureFormatRGBA8    TextureFormat = asset.TexelFormatRGBA8
	TextureFormatRGBA16   TextureFormat = asset.TexelFormatRGBA16
	TextureFormatRGBA16F  TextureFormat = asset.TexelFormatRGBA16F
	TextureFormatRGBA32F  TextureFormat = asset.TexelFormatRGBA32F
	TextureFormatDepth16F TextureFormat = asset.TexelFormatDepth16F
	TextureFormatDepth32F TextureFormat = asset.TexelFormatDepth32F
)

type TextureKind

type TextureKind uint8
const (
	TextureKind2D TextureKind = iota
	TextureKind2DArray
	TextureKind3D
	TextureKindCube
)

type TextureLayer

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

func (*TextureLayer) Data

func (l *TextureLayer) Data() []byte

type TextureReferrer

type TextureReferrer interface {
	Texture() *Texture
	SetTexture(texture *Texture)
}

type Topology

type Topology = asset.Topology
const (
	TopologyPoints        Topology = asset.TopologyPoints
	TopologyLineList      Topology = asset.TopologyLineList
	TopologyLineStrip     Topology = asset.TopologyLineStrip
	TopologyTriangleList  Topology = asset.TopologyTriangleList
	TopologyTriangleStrip Topology = asset.TopologyTriangleStrip
)

type TranslationKeyframe

type TranslationKeyframe = Keyframe[dprec.Vec3]

type Vertex

type Vertex struct {
	Coord    sprec.Vec3
	Normal   sprec.Vec3
	Tangent  sprec.Vec3
	TexCoord sprec.Vec2
	Color    sprec.Vec4
	Weights  sprec.Vec4
	Joints   [4]uint8
}

func (Vertex) Rotate

func (v Vertex) Rotate(rotation sprec.Quat) Vertex

func (Vertex) Scale

func (v Vertex) Scale(factor sprec.Vec3) Vertex

func (Vertex) Translate

func (v Vertex) Translate(offset sprec.Vec3) Vertex

type VertexFormat

type VertexFormat uint8
const (
	VertexFormatCoord VertexFormat = 1 << iota
	VertexFormatNormal
	VertexFormatTangent
	VertexFormatTexCoord
	VertexFormatColor
	VertexFormatWeights
	VertexFormatJoints
)

type WrapMode

type WrapMode = asset.WrapMode
const (
	WrapModeClamp          WrapMode = asset.WrapModeClamp
	WrapModeRepeat         WrapMode = asset.WrapModeRepeat
	WrapModeMirroredRepeat WrapMode = asset.WrapModeMirroredRepeat
)

type Wrappable

type Wrappable interface {
	WrapMode() WrapMode
	SetWrapMode(mode WrapMode)
}

Jump to

Keyboard shortcuts

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