Documentation ¶
Index ¶
- type Accessor
- type AccessorSparse
- type AccessorSparseIndices
- type AccessorSparseValues
- type Animation
- type AnimationChannel
- type AnimationChannelTarget
- type AnimationSampler
- type Anonymous1
- type Buffer
- type BufferView
- type Camera
- type CameraOrthographic
- type CameraPerspective
- type Extension
- type Extras
- type GlTF
- type GlTFChildOfRootProperty
- type GlTFId
- type GlTFProperty
- type Image
- type Material
- type MaterialNormalTextureInfo
- type MaterialOcclusionTextureInfo
- type MaterialPBRMetallicRoughness
- type Mesh
- type MeshPrimitive
- type Meta
- type Node
- type Sampler
- type Scene
- type Skin
- type Texture
- type TextureInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessor ¶
type Accessor struct { // The index of the bufferView. BufferView int `json:"bufferView,omitempty"` // The offset relative to the start of the bufferView in bytes. ByteOffset int `json:"byteOffset,omitempty"` // The datatype of components in the attribute. ComponentType int `json:"componentType"` // The number of attributes referenced by this accessor. Count int `json:"count"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // Maximum value of each component in this attribute. Max []float64 `json:"max,omitempty"` // Minimum value of each component in this attribute. Min []float64 `json:"min,omitempty"` Name string `json:"name,omitempty"` // Specifies whether integer data values should be normalized. Normalized bool `json:"normalized,omitempty"` // Sparse storage of attributes that deviate from their initialization value. Sparse interface{} `json:"sparse,omitempty"` // Specifies if the attribute is a scalar, vector, or matrix. Type string `json:"type"` }
Accessor A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.
func (*Accessor) MarshalJSON ¶
func (*Accessor) UnmarshalJSON ¶
type AccessorSparse ¶
type AccessorSparse struct { // Number of entries stored in the sparse array. Count int `json:"count"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase. Indices interface{} `json:"indices"` // Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor. Values interface{} `json:"values"` }
AccessorSparse Sparse storage of attributes that deviate from their initialization value.
func (*AccessorSparse) MarshalJSON ¶
func (strct *AccessorSparse) MarshalJSON() ([]byte, error)
func (*AccessorSparse) UnmarshalJSON ¶
func (strct *AccessorSparse) UnmarshalJSON(b []byte) error
type AccessorSparseIndices ¶
type AccessorSparseIndices struct { // The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target. BufferView interface{} `json:"bufferView"` // The offset relative to the start of the bufferView in bytes. Must be aligned. ByteOffset int `json:"byteOffset,omitempty"` // The indices data type. ComponentType interface{} `json:"componentType"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` }
AccessorSparseIndices Indices of those attributes that deviate from their initialization value.
func (*AccessorSparseIndices) MarshalJSON ¶
func (strct *AccessorSparseIndices) MarshalJSON() ([]byte, error)
func (*AccessorSparseIndices) UnmarshalJSON ¶
func (strct *AccessorSparseIndices) UnmarshalJSON(b []byte) error
type AccessorSparseValues ¶
type AccessorSparseValues struct { // The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target. BufferView interface{} `json:"bufferView"` // The offset relative to the start of the bufferView in bytes. Must be aligned. ByteOffset int `json:"byteOffset,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` }
AccessorSparseValues Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.
func (*AccessorSparseValues) MarshalJSON ¶
func (strct *AccessorSparseValues) MarshalJSON() ([]byte, error)
func (*AccessorSparseValues) UnmarshalJSON ¶
func (strct *AccessorSparseValues) UnmarshalJSON(b []byte) error
type Animation ¶
type Animation struct { // An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets. Channels []*AnimationChannel `json:"channels"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name interface{} `json:"name,omitempty"` // An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target). Samplers []*AnimationSampler `json:"samplers"` }
Animation A keyframe animation.
func (*Animation) MarshalJSON ¶
func (*Animation) UnmarshalJSON ¶
type AnimationChannel ¶
type AnimationChannel struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The index of a sampler in this animation used to compute the value for the target. Sampler interface{} `json:"sampler"` // The index of the node and TRS property to target. Target interface{} `json:"target"` }
AnimationChannel Targets an animation's sampler at a node's property.
func (*AnimationChannel) MarshalJSON ¶
func (strct *AnimationChannel) MarshalJSON() ([]byte, error)
func (*AnimationChannel) UnmarshalJSON ¶
func (strct *AnimationChannel) UnmarshalJSON(b []byte) error
type AnimationChannelTarget ¶
type AnimationChannelTarget struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The index of the node to target. Node interface{} `json:"node,omitempty"` // The name of the node's TRS property to modify, or the "weights" of the Morph Targets it instantiates. For the "translation" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the "rotation" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the "scale" property, the values are the scaling factors along the x, y, and z axes. Path interface{} `json:"path"` }
AnimationChannelTarget The index of the node and TRS property that an animation channel targets.
func (*AnimationChannelTarget) MarshalJSON ¶
func (strct *AnimationChannelTarget) MarshalJSON() ([]byte, error)
func (*AnimationChannelTarget) UnmarshalJSON ¶
func (strct *AnimationChannelTarget) UnmarshalJSON(b []byte) error
type AnimationSampler ¶
type AnimationSampler struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The index of an accessor containing keyframe input values, e.g., time. Input interface{} `json:"input"` // Interpolation algorithm. Interpolation interface{} `json:"interpolation,omitempty"` // The index of an accessor, containing keyframe output values. Output interface{} `json:"output"` }
AnimationSampler Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
func (*AnimationSampler) MarshalJSON ¶
func (strct *AnimationSampler) MarshalJSON() ([]byte, error)
func (*AnimationSampler) UnmarshalJSON ¶
func (strct *AnimationSampler) UnmarshalJSON(b []byte) error
type Buffer ¶
type Buffer struct { // The length of the buffer in bytes. ByteLength int `json:"byteLength"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name interface{} `json:"name,omitempty"` // The uri of the buffer. Uri string `json:"uri,omitempty"` }
Buffer A buffer points to binary geometry, animation, or skins.
func (*Buffer) MarshalJSON ¶
func (*Buffer) UnmarshalJSON ¶
type BufferView ¶
type BufferView struct { // The index of the buffer. Buffer int `json:"buffer"` // The length of the bufferView in bytes. ByteLength int `json:"byteLength"` // The offset into the buffer in bytes. ByteOffset int `json:"byteOffset,omitempty"` // The stride, in bytes. ByteStride int `json:"byteStride,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name string `json:"name,omitempty"` // The target that the GPU buffer should be bound to. Target int `json:"target,omitempty"` }
BufferView A view into a buffer generally representing a subset of the buffer.
func (*BufferView) MarshalJSON ¶
func (strct *BufferView) MarshalJSON() ([]byte, error)
func (*BufferView) UnmarshalJSON ¶
func (strct *BufferView) UnmarshalJSON(b []byte) error
type Camera ¶
type Camera struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name string `json:"name,omitempty"` // An orthographic camera containing properties to create an orthographic projection matrix. Orthographic CameraOrthographic `json:"orthographic,omitempty"` // A perspective camera containing properties to create a perspective projection matrix. Perspective CameraPerspective `json:"perspective,omitempty"` // Specifies if the camera uses a perspective or orthographic projection. Type string `json:"type"` }
Camera A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.
func (*Camera) MarshalJSON ¶
func (*Camera) UnmarshalJSON ¶
type CameraOrthographic ¶
type CameraOrthographic struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The floating-point horizontal magnification of the view. Must not be zero. Xmag float64 `json:"xmag"` // The floating-point vertical magnification of the view. Must not be zero. Ymag float64 `json:"ymag"` // The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`. Zfar float64 `json:"zfar"` // The floating-point distance to the near clipping plane. Znear float64 `json:"znear"` }
CameraOrthographic An orthographic camera containing properties to create an orthographic projection matrix.
func (*CameraOrthographic) MarshalJSON ¶
func (strct *CameraOrthographic) MarshalJSON() ([]byte, error)
func (*CameraOrthographic) UnmarshalJSON ¶
func (strct *CameraOrthographic) UnmarshalJSON(b []byte) error
type CameraPerspective ¶
type CameraPerspective struct { // The floating-point aspect ratio of the field of view. AspectRatio float64 `json:"aspectRatio,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The floating-point vertical field of view in radians. Yfov float64 `json:"yfov"` // The floating-point distance to the far clipping plane. Zfar float64 `json:"zfar,omitempty"` // The floating-point distance to the near clipping plane. Znear float64 `json:"znear"` }
CameraPerspective A perspective camera containing properties to create a perspective projection matrix.
func (*CameraPerspective) MarshalJSON ¶
func (strct *CameraPerspective) MarshalJSON() ([]byte, error)
func (*CameraPerspective) UnmarshalJSON ¶
func (strct *CameraPerspective) UnmarshalJSON(b []byte) error
type GlTF ¶
type GlTF struct { // An array of accessors. Accessors []*Accessor `json:"accessors,omitempty"` // An array of keyframe animations. Animations []*Animation `json:"animations,omitempty"` // Metadata about the glTF asset. Asset Meta `json:"asset"` // An array of bufferViews. BufferViews []*BufferView `json:"bufferViews,omitempty"` // An array of buffers. Buffers []*Buffer `json:"buffers,omitempty"` // An array of cameras. Cameras []*Camera `json:"cameras,omitempty"` Extensions interface{} `json:"extensions,omitempty"` // Names of glTF extensions required to properly load this asset. ExtensionsRequired []string `json:"extensionsRequired,omitempty"` // Names of glTF extensions used somewhere in this asset. ExtensionsUsed []string `json:"extensionsUsed,omitempty"` Extras interface{} `json:"extras,omitempty"` // An array of images. Images []*Image `json:"images,omitempty"` // An array of materials. Materials []*Material `json:"materials,omitempty"` // An array of meshes. Meshes []*Mesh `json:"meshes,omitempty"` // An array of nodes. Nodes []*Node `json:"nodes,omitempty"` // An array of samplers. Samplers []*Sampler `json:"samplers,omitempty"` // The index of the default scene. Scene int `json:"scene,omitempty"` // An array of scenes. Scenes []*Scene `json:"scenes,omitempty"` // An array of skins. Skins []*Skin `json:"skins,omitempty"` // An array of textures. Textures []*Texture `json:"textures,omitempty"` }
GlTF The root object for a glTF asset.
func (*GlTF) MarshalJSON ¶
func (*GlTF) UnmarshalJSON ¶
type GlTFChildOfRootProperty ¶
type GlTFChildOfRootProperty struct { // The user-defined name of this object. Name string `json:"name,omitempty"` }
GlTFChildOfRootProperty
type GlTFProperty ¶
type GlTFProperty struct { Extensions *Extension `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` }
GlTFProperty
type Image ¶
type Image struct { // The index of the bufferView that contains the image. Use this instead of the image's uri property. BufferView int `json:"bufferView,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The image's MIME type. Required if `bufferView` is defined. MimeType string `json:"mimeType,omitempty"` Name string `json:"name,omitempty"` // The uri of the image. Uri string `json:"uri,omitempty"` }
Image Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.
type Material ¶
type Material struct { // The alpha cutoff value of the material. AlphaCutoff float64 `json:"alphaCutoff,omitempty"` // The alpha rendering mode of the material. AlphaMode int `json:"alphaMode,omitempty"` // Specifies whether the material is double sided. DoubleSided bool `json:"doubleSided,omitempty"` // The emissive color of the material. EmissiveFactor []float64 `json:"emissiveFactor,omitempty"` // The emissive map texture. EmissiveTexture int `json:"emissiveTexture,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name string `json:"name,omitempty"` // The normal map texture. NormalTexture MaterialNormalTextureInfo `json:"normalTexture,omitempty"` // The occlusion map texture. OcclusionTexture MaterialOcclusionTextureInfo `json:"occlusionTexture,omitempty"` // A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply. PbrMetallicRoughness MaterialPBRMetallicRoughness `json:"pbrMetallicRoughness,omitempty"` }
Material The material appearance of a primitive.
type MaterialNormalTextureInfo ¶
type MaterialNormalTextureInfo struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Index int `json:"index,omitempty"` // The scalar multiplier applied to each normal vector of the normal texture. Scale float64 `json:"scale,omitempty"` TexCoord int `json:"texCoord,omitempty"` }
MaterialNormalTextureInfo
type MaterialOcclusionTextureInfo ¶
type MaterialOcclusionTextureInfo struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Index int `json:"index,omitempty"` // A scalar multiplier controlling the amount of occlusion applied. Strength float64 `json:"strength,omitempty"` TexCoord int `json:"texCoord,omitempty"` }
MaterialOcclusionTextureInfo
type MaterialPBRMetallicRoughness ¶
type MaterialPBRMetallicRoughness struct { // The material's base color factor. BaseColorFactor []float64 `json:"baseColorFactor,omitempty"` // The base color texture. BaseColorTexture TextureInfo `json:"baseColorTexture,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The metalness of the material. MetallicFactor float64 `json:"metallicFactor,omitempty"` // The metallic-roughness texture. MetallicRoughnessTexture TextureInfo `json:"metallicRoughnessTexture,omitempty"` // The roughness of the material. RoughnessFactor float64 `json:"roughnessFactor,omitempty"` }
MaterialPBRMetallicRoughness A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.
type Mesh ¶
type Mesh struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name string `json:"name,omitempty"` // An array of primitives, each defining geometry to be rendered with a material. Primitives []*MeshPrimitive `json:"primitives"` // Array of weights to be applied to the Morph Targets. Weights []float64 `json:"weights,omitempty"` }
Mesh A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.
func (*Mesh) MarshalJSON ¶
func (*Mesh) UnmarshalJSON ¶
type MeshPrimitive ¶
type MeshPrimitive struct { // A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data. Attributes map[string]int `json:"attributes"` Extensions string `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The index of the accessor that contains the indices. Indices int `json:"indices,omitempty"` // The index of the material to apply to this primitive when rendering. Material int `json:"material,omitempty"` // Name of material key Name string `json:"name,omitempty"` // The type of primitives to render. Mode int `json:"mode,omitempty"` // An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target. Targets []map[string]int `json:"targets,omitempty"` }
MeshPrimitive Geometry to be rendered with the given material.
func (*MeshPrimitive) MarshalJSON ¶
func (strct *MeshPrimitive) MarshalJSON() ([]byte, error)
func (*MeshPrimitive) UnmarshalJSON ¶
func (strct *MeshPrimitive) UnmarshalJSON(b []byte) error
type Meta ¶
type Meta struct { // A copyright message suitable for display to credit the content creator. Copyright string `json:"copyright,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // Tool that generated this glTF model. Useful for debugging. Generator string `json:"generator,omitempty"` // The minimum glTF version that this asset targets. MinVersion string `json:"minVersion,omitempty"` // The glTF version that this asset targets. Version string `json:"version"` }
Asset Metadata about the glTF asset.
func (*Meta) MarshalJSON ¶
func (*Meta) UnmarshalJSON ¶
type Node ¶
type Node struct { // The index of the camera referenced by this node. Camera int `json:"camera,omitempty"` // The indices of this node's children. Children []int `json:"children,omitempty"` Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // A floating-point 4x4 transformation matrix stored in column-major order. Matrix []float64 `json:"matrix,omitempty"` // The index of the mesh in this node. Mesh int `json:"mesh,omitempty"` Name string `json:"name,omitempty"` // The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar. Rotation []float32 `json:"rotation,omitempty"` // The node's non-uniform scale, given as the scaling factors along the x, y, and z axes. Scale []float32 `json:"scale,omitempty"` // The index of the skin referenced by this node. Skin int `json:"skin,omitempty"` // The node's translation along the x, y, and z axes. Translation []float32 `json:"translation,omitempty"` // The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh. Weights []float32 `json:"weights,omitempty"` }
Node A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.
type Sampler ¶
type Sampler struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // Magnification filter. MagFilter int `json:"magFilter,omitempty"` // Minification filter. MinFilter int `json:"minFilter,omitempty"` Name string `json:"name,omitempty"` // s wrapping mode. WrapS int `json:"wrapS,omitempty"` // t wrapping mode. WrapT int `json:"wrapT,omitempty"` }
Sampler Texture sampler properties for filtering and wrapping modes.
type Scene ¶
type Scene struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name string `json:"name,omitempty"` // The indices of each root node. Nodes []int `json:"nodes,omitempty"` }
Scene The root nodes of a scene.
type Skin ¶
type Skin struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied. InverseBindMatrices int `json:"inverseBindMatrices,omitempty"` // Indices of skeleton nodes, used as joints in this skin. Joints []int `json:"joints"` Name string `json:"name,omitempty"` // The index of the node used as a skeleton root. Skeleton int `json:"skeleton,omitempty"` }
Skin Joints and matrices defining a skin.
func (*Skin) MarshalJSON ¶
func (*Skin) UnmarshalJSON ¶
type Texture ¶
type Texture struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` Name string `json:"name,omitempty"` // The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used. Sampler int `json:"sampler,omitempty"` SamplerProperties Sampler // The index of the image used by this texture. When undefined, it is expected that an extension or other mechanism will supply an alternate texture source, otherwise behavior is undefined. Source interface{} `json:"source,omitempty"` }
Texture A texture and its sampler.
type TextureInfo ¶
type TextureInfo struct { Extensions interface{} `json:"extensions,omitempty"` Extras interface{} `json:"extras,omitempty"` // The index of the texture. Index int `json:"index"` // The name of the texture Name string `json:"name,omitempty"` // The set index of texture's TEXCOORD attribute used for texture coordinate mapping. TexCoord int `json:"texCoord,omitempty"` }
TextureInfo Reference to a texture.
func (*TextureInfo) MarshalJSON ¶
func (strct *TextureInfo) MarshalJSON() ([]byte, error)
func (*TextureInfo) UnmarshalJSON ¶
func (strct *TextureInfo) UnmarshalJSON(b []byte) error