texturetransform

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

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

func Unmarshal

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

Unmarshal decodes the json data into the correct type.

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.

Jump to

Keyboard shortcuts

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