Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ExtensionName defines the ExtTextureTransform unique key.
ExtensionName = "KHR_texture_transform"
)
Variables ¶
View Source
var ( // DefaultScale defines a scaling that does not modify the size of the object. DefaultScale = [2]float32{1, 1} )
Functions ¶
Types ¶
type TextureTranform ¶
type TextureTranform struct { Offset [2]float32 `json:"offset"` Rotation float32 `json:"rotation,omitempty"` Scale [2]float32 `json:"scale"` TexCoord *uint32 `json:"texCoord,omitempty"` }
TextureTranform can be used in textureInfo to pack many low-res texture into a single large texture atlas.
func (*TextureTranform) MarshalJSON ¶
func (t *TextureTranform) MarshalJSON() ([]byte, error)
MarshalJSON marshal the pbr with the correct default values.
func (*TextureTranform) ScaleOrDefault ¶
func (t *TextureTranform) ScaleOrDefault() [2]float32
ScaleOrDefault returns the node scale if it represents a valid scale factor, else return the default one.
func (*TextureTranform) UnmarshalJSON ¶
func (t *TextureTranform) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshal the pbr with the correct default values.
Click to show internal directories.
Click to hide internal directories.