scene

package
v0.0.0-...-ddc071b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scene

type Scene struct {
	Root     *gltf.GlTF
	Filepath string
	Buffers  [][]byte
	BaseURI  string
}

func InitScene

func InitScene(filepath string) (Scene, error)

InitScene Creates empty Scene struct

func (*Scene) ExportGLTF

func (scene *Scene) ExportGLTF() error

ExportGLTF () marshals scene graph of the GLTF node object

func (*Scene) GetAccessorBufferView

func (scene *Scene) GetAccessorBufferView(accessor_index int) (*gltf.Accessor, *gltf.BufferView, error)

GetAccessorBufferView returns and accessor and its associated buffer view as a tuple + the error state Error states return empty objects

func (*Scene) GetAccessorIx

func (scene *Scene) GetAccessorIx(index int) (*gltf.Accessor, error)

GetSceneIx gets the scene object at the specified index

func (*Scene) GetAccessors

func (scene *Scene) GetAccessors() []*gltf.Accessor

func (*Scene) GetBufferDataIx

func (scene *Scene) GetBufferDataIx(buffer_view_index int) ([]byte, error)

GetBufferDataIx gets the Buffer Views data reference as a slice pointer

func (*Scene) GetBufferIx

func (scene *Scene) GetBufferIx(index int) (*gltf.Buffer, error)

GetBufferIx gets the buffer descr at the specified index - note this isn't the actual scene buffer data storage component just the description with the URI/Bytelengths

func (*Scene) GetBufferViewIx

func (scene *Scene) GetBufferViewIx(index int) (*gltf.BufferView, error)

GetBufferViewIx gets the buffer descr at the specified index - note this isn't the actual scene buffer data storage component just the description with the URI/Bytelengths

func (*Scene) GetBufferViews

func (scene *Scene) GetBufferViews() []*gltf.BufferView

GetBufferViews gets the list of buffer views

func (*Scene) GetBuffers

func (scene *Scene) GetBuffers() []*gltf.Buffer

GetBuffers returns list of buffers associated with scene

func (*Scene) GetDefaultScene

func (scene *Scene) GetDefaultScene() int

GetScene () gets default scene node

func (*Scene) GetImageIx

func (scene *Scene) GetImageIx(index int) (*gltf.Image, error)

func (*Scene) GetImages

func (scene *Scene) GetImages() []*gltf.Image

func (*Scene) GetMaterialIx

func (scene *Scene) GetMaterialIx(index int) (*gltf.Material, error)

func (*Scene) GetMaterials

func (scene *Scene) GetMaterials() []*gltf.Material

func (*Scene) GetMeshIx

func (scene *Scene) GetMeshIx(index int) (*gltf.Mesh, error)

GetBufferIx gets the buffer descr at the specified index - note this isn't the actual scene buffer data storage component just the description with the URI/Bytelengths

func (*Scene) GetMeshPrimitives

func (scene *Scene) GetMeshPrimitives(index int) ([]*gltf.MeshPrimitive, error)

GetBufferIx gets the buffer descr at the specified index - note this isn't the actual scene buffer data storage component just the description with the URI/Bytelengths

func (*Scene) GetMeshes

func (scene *Scene) GetMeshes() []*gltf.Mesh

GetMeshes returns list of buffers associated with scene

func (*Scene) GetNodeChildren

func (scene *Scene) GetNodeChildren(index int) ([]int, error)

func (*Scene) GetNodeIx

func (scene *Scene) GetNodeIx(index int) (*gltf.Node, error)

func (*Scene) GetNodes

func (scene *Scene) GetNodes() []*gltf.Node

func (*Scene) GetSamplerIx

func (scene *Scene) GetSamplerIx(index int) (*gltf.Sampler, error)

func (*Scene) GetSamplers

func (scene *Scene) GetSamplers() []*gltf.Sampler

func (*Scene) GetSceneIx

func (scene *Scene) GetSceneIx(index int) (*gltf.Scene, error)

GetSceneIx gets the scene object at the specified index

func (*Scene) GetScenes

func (scene *Scene) GetScenes() []*gltf.Scene

GetScenes get the scene array

func (*Scene) GetTextures

func (scene *Scene) GetTextures() []*gltf.Texture

GetScenes get the scene array

func (*Scene) ImportGLTF

func (scene *Scene) ImportGLTF() error

ImportGLTF () reads scene graph of the GLTF node object and sets up a few properties for the scene such as the camera and Buffers

func (*Scene) Info

func (scene *Scene) Info() error

func (*Scene) LoadURIBuffer

func (scene *Scene) LoadURIBuffer(uri string, bufferIndex int, bufferLength int) error

Jump to

Keyboard shortcuts

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