draco

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ExtensionName defines the KHR_draco_mesh_compression unique key.
	ExtensionName = "KHR_draco_mesh_compression"
)

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte) (interface{}, error)

Unmarshal decodes the json data into the correct type.

Types

type Mesh

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

Mesh contains the necessary information to process a draco-encoded in a gltf context.

func UnmarshalMesh

func UnmarshalMesh(doc *gltf.Document, bv *gltf.BufferView) (*Mesh, error)

UnmarshalMesh unmarshal the draco-encoded mesh from a gltf.BufferView

func (Mesh) ReadAttr

func (m Mesh) ReadAttr(p *gltf.Primitive, name string, buffer interface{}) (interface{}, error)

ReadAttr reads the named attribute of a gltf.Primitive. If the attribute is defined in the primitive but not in the mesh it fallbacks to modeler.ReadAccessor. buffer can be nil.

func (Mesh) ReadIndices

func (m Mesh) ReadIndices(buffer []uint32) []uint32

ReadIndices reads the faces of the Mesh. buffer can be nil.

type PrimitiveExt

type PrimitiveExt struct {
	Extensions gltf.Extensions `json:"extensions,omitempty"`
	Extras     interface{}     `json:"extras,omitempty"`
	BufferView uint32          `json:"bufferView"`
	Attributes gltf.Attribute  `json:"attributes"`
}

PrimitiveExt extends the gltf.Primtive info to handle draco compressed meshes.

func GetPrimitiveExt

func GetPrimitiveExt(p *gltf.Primitive) *PrimitiveExt

GetPrimitiveExt retrieve a PrimitiveExt from p. If p does not contain the draco extensions it returns nil.

Jump to

Keyboard shortcuts

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