bin

package
v0.0.0-...-6fc7a22 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 14 Imported by: 0

README

rbxfile/bin

GoDoc

Package bin implements a decoder and encoder for Roblox's binary file format.

This package registers the formats "rbxl" and "rbxm" to the rbxfile package.

The easiest way to decode and encode files is through the functions DeserializePlace, SerializePlace, DeserializeModel, and SerializeModel. These decode and encode directly between byte streams and Root structures specified by the rbxfile package. For most purposes, this is all that is required to read and write Roblox binary files. Further documentation gives an overview of how the package works internally.

Overview

A Serializer is used to transform data from byte streams to Root structures and back. A serializer specifies a decoder and encoder. Both a decoder and encoder combined is referred to as a "codec".

Codecs transform data between a generic rbxfile.Root structure, and this package's "format model" structure. Custom codecs can be implemented. For example, you might wish to decode files normally, but encode them in an alternative way:

serializer := NewSerializer(nil, CustomEncoder)

Custom codecs can be used with a Serializer by implementing the Decoder and Encoder interfaces. Both do not need to be implemented. In the example above, passing nil as an argument causes the serializer to use the default "RobloxCodec", which implements both a default decoder and encoder. This codec attempts to emulate how Roblox decodes and encodes its files.

A FormatModel is the representation of the file format itself, rather than the data it contains. The FormatModel is like a buffer between the byte stream and the Root structure. FormatModels can be encoded (and rarely, decoded) to and from Root structures in multiple ways, which is specified by codecs. However, there is only one way to encode and decode to and from a byte stream, which is handled by the FormatModel.

Documentation

Overview

Package bin implements a decoder and encoder for Roblox's binary file format.

The easiest way to decode and encode files is through the functions DeserializePlace, SerializePlace, DeserializeModel, and SerializeModel. These decode and encode directly between byte streams and Root structures specified by the rbxfile package. For most purposes, this is all that is required to read and write Roblox binary files. Further documentation gives an overview of how the package works internally.

Overview

A Serializer is used to transform data from byte streams to Root structures and back. A serializer specifies a decoder and encoder. Both a decoder and encoder combined is referred to as a "codec".

Codecs transform data between a generic rbxfile.Root structure, and this package's "format model" structure. Custom codecs can be implemented. For example, you might wish to decode files normally, but encode them in an alternative way:

serializer := NewSerializer(nil, CustomEncoder)

Custom codecs can be used with a Serializer by implementing the Decoder and Encoder interfaces. Both do not need to be implemented. In the example above, passing nil as an argument causes the serializer to use the default "RobloxCodec", which implements both a default decoder and encoder. This codec attempts to emulate how Roblox decodes and encodes its files.

A FormatModel is the representation of the file format itself, rather than the data it contains. The FormatModel is like a buffer between the byte stream and the Root structure. FormatModels can be encoded (and rarely, decoded) to and from Root structures in multiple ways, which is specified by codecs. However, there is only one way to encode and decode to and from a byte stream, which is handled by the FormatModel.

Index

Constants

View Source
const BinaryHeader = "\x89\xff\r\n\x1a\n"

BinaryHeader is the header magic of a binary file.

View Source
const BinaryMarker = "!"

BinaryMarker indicates the start of a binary file, rather than an XML file.

View Source
const RobloxSig = "<roblox"

RobloxSig is the signature a Roblox file (binary or XML).

Variables

View Source
var (
	ErrInvalidSig       = errors.New("invalid signature")
	ErrCorruptHeader    = errors.New("the file header is corrupted")
	ErrChunkParentArray = errors.New("length of parent array does not match children array")
)
View Source
var (
	WarnReserveNonZero     = errors.New("reserved space in file header is non-zero")
	WarnEndChunkCompressed = errors.New("end chunk is compressed")
	WarnEndChunkContent    = errors.New("end chunk content is not `</roblox>`")
	WarnEndChunkNotLast    = errors.New("end chunk is not the last chunk")
)

Functions

func DeserializeModel

func DeserializeModel(r io.Reader, api rbxapi.Root) (root *rbxfile.Root, err error)

Deserialize decodes data from r into a Root structure using the default decoder. Data is interpreted as a Roblox model file. An optional API can be given to ensure more correct data.

func DeserializePlace

func DeserializePlace(r io.Reader, api rbxapi.Root) (root *rbxfile.Root, err error)

Deserialize decodes data from r into a Root structure using the default decoder. Data is interpreted as a Roblox place file. An optional API can be given to ensure more correct data.

func SerializeModel

func SerializeModel(w io.Writer, api rbxapi.Root, root *rbxfile.Root) (err error)

Serialize encodes data from a Root structure to w using the default encoder. Data is interpreted as a Roblox model file. An optional API can be given to ensure more correct data.

func SerializePlace

func SerializePlace(w io.Writer, api rbxapi.Root, root *rbxfile.Root) (err error)

Serialize encodes data from a Root structure to w using the default encoder. Data is interpreted as a Roblox place file. An optional API can be given to ensure more correct data.

Types

type Chunk

type Chunk interface {
	// Signature returns a signature used to identify the chunk's type.
	Signature() [4]byte

	// Compressed returns whether the chunk was compressed when decoding, or
	// whether thed chunk should be compressed when encoding.
	Compressed() bool

	// SetCompressed sets whether the chunk should be compressed when
	// encoding.
	SetCompressed(bool)

	// ReadFrom processes the payload of a decompressed chunk.
	ReadFrom(r io.Reader) (n int64, err error)

	// WriteTo writes the data from a chunk to an uncompressed payload. The
	// payload will be compressed afterward depending on the chunk's
	// compression settings.
	WriteTo(w io.Writer) (n int64, err error)
}

Chunk is a portion of the model that contains distinct data.

type ChunkEnd

type ChunkEnd struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	// The raw decompressed content of the chunk. For maximum compatibility,
	// the content should be "</roblox>", and the chunk should be
	// uncompressed. The decoder will emit warnings indicating such, if this
	// is not the case.
	Content []byte
}

ChunkEnd is a Chunk that signals the end of the file. It causes the decoder to stop reading chunks, so it should be the last chunk.

func (*ChunkEnd) Compressed

func (c *ChunkEnd) Compressed() bool

func (*ChunkEnd) ReadFrom

func (c *ChunkEnd) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkEnd) SetCompressed

func (c *ChunkEnd) SetCompressed(b bool)

func (ChunkEnd) Signature

func (ChunkEnd) Signature() [4]byte

func (*ChunkEnd) WriteTo

func (c *ChunkEnd) WriteTo(w io.Writer) (n int64, err error)

type ChunkInstance

type ChunkInstance struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	// TypeID is a number identifying the instance group.
	TypeID int32

	// ClassName indicates the ClassName property of each instance in the
	// group.
	ClassName string

	// InstanceIDs is a list of numbers that identify each instance in the
	// group, which can be referred to in other chunks. The length of the
	// array indicates how many instances are in the group.
	InstanceIDs []int32

	// IsService indicates the chunk has GetService flags.
	IsService bool

	// GetService is a list of flags indicating how to treat each instance in
	// the group. Each byte in the list corresponds to the instance in
	// InstanceIDs.
	//
	// A value of 0x0 will treat the instance normally, using Instance.new()
	// to create the instance.
	//
	// A value of 0x1 will treat the instance as a service, using
	// game:GetService() to get the instance.
	GetService []byte
}

ChunkInstance is a Chunk that contains information about the instances in the file. Instances of the same ClassName are grouped together into this kind of chunk, which are called "instance groups".

func (*ChunkInstance) Compressed

func (c *ChunkInstance) Compressed() bool

func (*ChunkInstance) ReadFrom

func (c *ChunkInstance) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkInstance) SetCompressed

func (c *ChunkInstance) SetCompressed(b bool)

func (ChunkInstance) Signature

func (ChunkInstance) Signature() [4]byte

func (*ChunkInstance) WriteTo

func (c *ChunkInstance) WriteTo(w io.Writer) (n int64, err error)

type ChunkMeta

type ChunkMeta struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	Values [][2]string
}

ChunkMeta is a Chunk that contains file metadata.

func (*ChunkMeta) Compressed

func (c *ChunkMeta) Compressed() bool

func (*ChunkMeta) ReadFrom

func (c *ChunkMeta) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkMeta) SetCompressed

func (c *ChunkMeta) SetCompressed(b bool)

func (ChunkMeta) Signature

func (ChunkMeta) Signature() [4]byte

func (*ChunkMeta) WriteTo

func (c *ChunkMeta) WriteTo(w io.Writer) (n int64, err error)

type ChunkParent

type ChunkParent struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	// Version is the version of the chunk. Reserved so that the format of the
	// parent chunk can be changed without changing the version of the entire
	// file format.
	Version uint8

	// Children is a list of instances referred to by instance ID. The length
	// of this array should be equal to InstanceCount.
	Children []int32

	// Parents is a list of instances, referred to by instance ID, that
	// indicate the Parent of the corresponding instance in the Children
	// array. The length of this array should be equal to the length of
	// Children.
	Parents []int32
}

ChunkParent is a Chunk that contains information about the parent-child relationships between instances in the model.

func (*ChunkParent) Compressed

func (c *ChunkParent) Compressed() bool

func (*ChunkParent) ReadFrom

func (c *ChunkParent) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkParent) SetCompressed

func (c *ChunkParent) SetCompressed(b bool)

func (ChunkParent) Signature

func (ChunkParent) Signature() [4]byte

func (*ChunkParent) WriteTo

func (c *ChunkParent) WriteTo(w io.Writer) (n int64, err error)

type ChunkProperty

type ChunkProperty struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	// TypeID is the ID of an instance group contained in a ChunkInstance.
	TypeID int32

	// PropertyName is the name of a valid property in each instance of the
	// corresponding instance group.
	PropertyName string

	// DataType is a number indicating the type of the property.
	DataType Type

	// Properties is a list of Values of the given DataType. Each value in the
	// array corresponds to the property of an instance in the specified
	// group.
	Properties []Value
}

ChunkProperty is a Chunk that contains information about the properties of a group of instances.

func (*ChunkProperty) Compressed

func (c *ChunkProperty) Compressed() bool

func (*ChunkProperty) ReadFrom

func (c *ChunkProperty) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkProperty) SetCompressed

func (c *ChunkProperty) SetCompressed(b bool)

func (ChunkProperty) Signature

func (ChunkProperty) Signature() [4]byte

func (*ChunkProperty) WriteTo

func (c *ChunkProperty) WriteTo(w io.Writer) (n int64, err error)

type ChunkSharedStrings

type ChunkSharedStrings struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	Version uint32
	Values  []SharedString
}

ChunkSharedStrings is a Chunk that contains shared strings.

func (*ChunkSharedStrings) Compressed

func (c *ChunkSharedStrings) Compressed() bool

func (*ChunkSharedStrings) ReadFrom

func (c *ChunkSharedStrings) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkSharedStrings) SetCompressed

func (c *ChunkSharedStrings) SetCompressed(b bool)

func (ChunkSharedStrings) Signature

func (ChunkSharedStrings) Signature() [4]byte

func (*ChunkSharedStrings) WriteTo

func (c *ChunkSharedStrings) WriteTo(w io.Writer) (n int64, err error)

type ChunkUnknown

type ChunkUnknown struct {
	// Whether the chunk is compressed.
	IsCompressed bool

	// The signature of the chunk.
	Sig [4]byte

	// The raw content of the chunk.
	Bytes []byte
}

ChunkUnknown is a Chunk that is not known by the format.

func (*ChunkUnknown) Compressed

func (c *ChunkUnknown) Compressed() bool

func (*ChunkUnknown) Error

func (c *ChunkUnknown) Error() string

func (*ChunkUnknown) ReadFrom

func (c *ChunkUnknown) ReadFrom(r io.Reader) (n int64, err error)

func (*ChunkUnknown) SetCompressed

func (c *ChunkUnknown) SetCompressed(b bool)

func (*ChunkUnknown) Signature

func (c *ChunkUnknown) Signature() [4]byte

func (*ChunkUnknown) WriteTo

func (c *ChunkUnknown) WriteTo(w io.Writer) (n int64, err error)

type Decoder

type Decoder interface {
	Decode(model *FormatModel) (root *rbxfile.Root, err error)
}

Decoder decodes a FormatModel to a generic rbxfile.Root structure.

type Encoder

type Encoder interface {
	Encode(root *rbxfile.Root) (model *FormatModel, err error)
}

Encoder encodes a rbxfile.Root structure to a FormatModel.

type ErrChunk

type ErrChunk struct {
	Sig [4]byte
	Err error
}

ErrChunk is an error produced by a chunk of a certain type.

func (ErrChunk) Error

func (err ErrChunk) Error() string

type ErrInvalidType

type ErrInvalidType struct {
	Chunk *ChunkProperty
	Bytes []byte
}

func (*ErrInvalidType) Error

func (err *ErrInvalidType) Error() string

type ErrUnrecognizedVersion

type ErrUnrecognizedVersion uint16

func (ErrUnrecognizedVersion) Error

func (err ErrUnrecognizedVersion) Error() string

type ErrValue

type ErrValue struct {
	Type  Type
	Bytes []byte
	Err   error
}

ErrValue is an error that is produced by a Value of a certain Type.

func (ErrValue) Error

func (err ErrValue) Error() string

type FormatModel

type FormatModel struct {
	// Version indicates the version of the format model.
	Version uint16

	// TypeCount is the number of instance types in the model.
	TypeCount uint32

	// InstanceCount is the number of unique instances in the model.
	InstanceCount uint32

	// Chunks is a list of Chunks present in the model.
	Chunks []Chunk

	// If Strict is true, certain errors normally emitted as warnings are
	// instead emitted as errors.
	Strict bool

	// Warnings is a list of non-fatal problems that have occurred. This will
	// be cleared and populated when calling either ReadFrom and WriteTo.
	// Codecs may also clear and populate this when decoding or encoding.
	Warnings []error
}

FormatModel models Roblox's binary file format. Directly, it can be used to control exactly how a file is encoded.

func (*FormatModel) ReadFrom

func (f *FormatModel) ReadFrom(r io.Reader) (n int64, err error)

ReadFrom decodes data from r into the FormatModel.

If an error occurs while reading a chunk, the error is emitted as a ErrChunk to FormatModel.Warnings, unless FormatModel.Strict is true.

func (*FormatModel) WriteTo

func (f *FormatModel) WriteTo(w io.Writer) (n int64, err error)

WriteTo encodes the FormatModel as bytes to w.

type Mode

type Mode uint8

Mode indicates how RobloxCodec should interpret data.

const (
	ModePlace Mode = iota // Data is decoded and encoded as a Roblox place (RBXL) file.
	ModeModel             // Data is decoded and encoded as a Roblox model (RBXM) file.
)

type RobloxCodec

type RobloxCodec struct {
	// API can be set to yield a more correct encoding or decoding by
	// providing information about each class. If API is nil, the codec will
	// try to use other available information, but may not be fully accurate.
	API rbxapi.Root

	Mode Mode

	// ExcludeInvalidAPI determines whether invalid items are excluded when
	// encoding or decoding. An invalid item is an instance or property that
	// does not exist or has incorrect information, according to a provided
	// rbxapi.Root.
	//
	// If true, then warnings will be emitted for invalid items, and the items
	// will not be included in the output. If false, then warnings are still
	// emitted, but invalid items are handled as if they were valid. This
	// applies when decoding from a FormatModel, and when encoding from a
	// rbxfile.Root.
	//
	// Since an API may exclude some items even though they're correct, it is
	// generally preferred to set ExcludeInvalidAPI to false, so that false
	// negatives do not lead to lost data.
	ExcludeInvalidAPI bool
}

RobloxCodec implements Decoder and Encoder to emulate Roblox's internal codec as closely as possible.

func (RobloxCodec) Decode

func (c RobloxCodec) Decode(model *FormatModel) (root *rbxfile.Root, err error)

func (RobloxCodec) Encode

func (c RobloxCodec) Encode(root *rbxfile.Root) (model *FormatModel, err error)

type Serializer

type Serializer struct {
	Decoder Decoder
	Encoder Encoder

	// DecoderXML is used to decode the legacy XML format. If DecoderXML is
	// not nil, then the serializer will attempt to detect if the stream is in
	// the XML format. If so, then it will be decoded using an xml.Serializer
	// with the given decoder.
	DecoderXML xml.Decoder
}

Serializer implements functions that decode and encode directly between byte streams and rbxfile Root structures.

func NewSerializer

func NewSerializer(d Decoder, e Encoder) Serializer

NewSerializer returns a new Serializer with a specified decoder and encoder. If either value is nil, the default RobloxCodec will be used in its place. DecoderXML is set to xml.RobloxCodec.

func (Serializer) Deserialize

func (s Serializer) Deserialize(r io.Reader) (root *rbxfile.Root, err error)

Deserialize decodes data from r into a Root structure using the specified decoder. An optional API can be given to ensure more correct data.

func (Serializer) Serialize

func (s Serializer) Serialize(w io.Writer, root *rbxfile.Root) (err error)

Serialize encodes data from a Root structure to w using the specified encoder.

type SharedString

type SharedString struct {
	Hash  [16]byte
	Value []byte
}

type Type

type Type byte

Type indicates the type of a Value.

const (
	TypeInvalid      Type = 0x0
	TypeString       Type = 0x1
	TypeBool         Type = 0x2
	TypeInt          Type = 0x3
	TypeFloat        Type = 0x4
	TypeDouble       Type = 0x5
	TypeUDim         Type = 0x6
	TypeUDim2        Type = 0x7
	TypeRay          Type = 0x8
	TypeFaces        Type = 0x9
	TypeAxes         Type = 0xA
	TypeBrickColor   Type = 0xB
	TypeColor3       Type = 0xC
	TypeVector2      Type = 0xD
	TypeVector3      Type = 0xE
	TypeVector2int16 Type = 0xF
	TypeCFrame       Type = 0x10
	//TypeCFrameQuat Type = 0x11
	TypeToken              Type = 0x12
	TypeReference          Type = 0x13
	TypeVector3int16       Type = 0x14
	TypeNumberSequence     Type = 0x15
	TypeColorSequence      Type = 0x16
	TypeNumberRange        Type = 0x17
	TypeRect2D             Type = 0x18
	TypePhysicalProperties Type = 0x19
	TypeColor3uint8        Type = 0x1A
	TypeInt64              Type = 0x1B
	TypeSharedString       Type = 0x1C
)

func (Type) String

func (t Type) String() string

String returns a string representation of the type. If the type is not valid, then the returned value will be "Invalid".

type Value

type Value interface {
	// Type returns an identifier indicating the type.
	Type() Type

	// FromBytes receives the value of the type from a byte array.
	FromBytes([]byte) error

	// Bytes returns the encoded value of the type as a byte array.
	Bytes() []byte

	// FromArrayBytes receives an array of values of the type from a byte
	// array.
	FromArrayBytes([]byte) ([]Value, error)

	// ArrayBytes returns an array of values of the type encoded as a byte
	// array.
	ArrayBytes([]Value) ([]byte, error)
}

Value is a property value of a certain Type.

func NewValue

func NewValue(typ Type) Value

NewValue returns new Value of the given Type. The initial value will not necessarily be the zero for the type. If the given type is invalid, then a nil value is returned.

type ValueAxes

type ValueAxes struct {
	X, Y, Z bool
}

func (*ValueAxes) ArrayBytes

func (v *ValueAxes) ArrayBytes(a []Value) (b []byte, err error)

func (ValueAxes) Bytes

func (v ValueAxes) Bytes() []byte

func (ValueAxes) FromArrayBytes

func (v ValueAxes) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueAxes) FromBytes

func (v *ValueAxes) FromBytes(b []byte) error

func (ValueAxes) Type

func (ValueAxes) Type() Type

type ValueBool

type ValueBool bool

func (*ValueBool) ArrayBytes

func (v *ValueBool) ArrayBytes(a []Value) (b []byte, err error)

func (ValueBool) Bytes

func (v ValueBool) Bytes() []byte

func (ValueBool) FromArrayBytes

func (v ValueBool) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueBool) FromBytes

func (v *ValueBool) FromBytes(b []byte) error

func (ValueBool) Type

func (ValueBool) Type() Type

type ValueBrickColor

type ValueBrickColor uint32

func (*ValueBrickColor) ArrayBytes

func (v *ValueBrickColor) ArrayBytes(a []Value) (b []byte, err error)

func (ValueBrickColor) Bytes

func (v ValueBrickColor) Bytes() []byte

func (ValueBrickColor) FromArrayBytes

func (v ValueBrickColor) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueBrickColor) FromBytes

func (v *ValueBrickColor) FromBytes(b []byte) error

func (ValueBrickColor) Type

func (ValueBrickColor) Type() Type

type ValueCFrame

type ValueCFrame struct {
	Special  uint8
	Rotation [9]float32
	Position ValueVector3
}

func (*ValueCFrame) ArrayBytes

func (v *ValueCFrame) ArrayBytes(a []Value) (b []byte, err error)

func (ValueCFrame) Bytes

func (v ValueCFrame) Bytes() []byte

func (ValueCFrame) FromArrayBytes

func (v ValueCFrame) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueCFrame) FromBytes

func (v *ValueCFrame) FromBytes(b []byte) error

func (ValueCFrame) Type

func (ValueCFrame) Type() Type

type ValueColor3

type ValueColor3 struct {
	R, G, B ValueFloat
}

func (ValueColor3) ArrayBytes

func (v ValueColor3) ArrayBytes(a []Value) (b []byte, err error)

func (ValueColor3) Bytes

func (v ValueColor3) Bytes() []byte

func (ValueColor3) FromArrayBytes

func (v ValueColor3) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueColor3) FromBytes

func (v *ValueColor3) FromBytes(b []byte) error

func (ValueColor3) Type

func (ValueColor3) Type() Type

type ValueColor3uint8

type ValueColor3uint8 struct {
	R, G, B byte
}

func (ValueColor3uint8) ArrayBytes

func (v ValueColor3uint8) ArrayBytes(a []Value) (b []byte, err error)

func (ValueColor3uint8) Bytes

func (v ValueColor3uint8) Bytes() []byte

func (ValueColor3uint8) FromArrayBytes

func (v ValueColor3uint8) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueColor3uint8) FromBytes

func (v *ValueColor3uint8) FromBytes(b []byte) error

func (ValueColor3uint8) Type

func (ValueColor3uint8) Type() Type

type ValueColorSequence

type ValueColorSequence []ValueColorSequenceKeypoint

func (*ValueColorSequence) ArrayBytes

func (v *ValueColorSequence) ArrayBytes(a []Value) (b []byte, err error)

func (ValueColorSequence) Bytes

func (v ValueColorSequence) Bytes() []byte

func (ValueColorSequence) FromArrayBytes

func (v ValueColorSequence) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueColorSequence) FromBytes

func (v *ValueColorSequence) FromBytes(b []byte) error

func (ValueColorSequence) Type

func (ValueColorSequence) Type() Type

type ValueColorSequenceKeypoint

type ValueColorSequenceKeypoint struct {
	Time     float32
	Value    ValueColor3
	Envelope float32
}

type ValueDouble

type ValueDouble float64

func (*ValueDouble) ArrayBytes

func (v *ValueDouble) ArrayBytes(a []Value) (b []byte, err error)

func (ValueDouble) Bytes

func (v ValueDouble) Bytes() []byte

func (ValueDouble) FromArrayBytes

func (v ValueDouble) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueDouble) FromBytes

func (v *ValueDouble) FromBytes(b []byte) error

func (ValueDouble) Type

func (ValueDouble) Type() Type

type ValueFaces

type ValueFaces struct {
	Right, Top, Back, Left, Bottom, Front bool
}

func (*ValueFaces) ArrayBytes

func (v *ValueFaces) ArrayBytes(a []Value) (b []byte, err error)

func (ValueFaces) Bytes

func (v ValueFaces) Bytes() []byte

func (ValueFaces) FromArrayBytes

func (v ValueFaces) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueFaces) FromBytes

func (v *ValueFaces) FromBytes(b []byte) error

func (ValueFaces) Type

func (ValueFaces) Type() Type

type ValueFloat

type ValueFloat float32

func (*ValueFloat) ArrayBytes

func (v *ValueFloat) ArrayBytes(a []Value) (b []byte, err error)

func (ValueFloat) Bytes

func (v ValueFloat) Bytes() []byte

func (ValueFloat) FromArrayBytes

func (v ValueFloat) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueFloat) FromBytes

func (v *ValueFloat) FromBytes(b []byte) error

func (ValueFloat) Type

func (ValueFloat) Type() Type

type ValueInt

type ValueInt int32

func (*ValueInt) ArrayBytes

func (v *ValueInt) ArrayBytes(a []Value) (b []byte, err error)

func (ValueInt) Bytes

func (v ValueInt) Bytes() []byte

func (ValueInt) FromArrayBytes

func (v ValueInt) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueInt) FromBytes

func (v *ValueInt) FromBytes(b []byte) error

func (ValueInt) Type

func (ValueInt) Type() Type

type ValueInt64

type ValueInt64 int64

func (*ValueInt64) ArrayBytes

func (v *ValueInt64) ArrayBytes(a []Value) (b []byte, err error)

func (ValueInt64) Bytes

func (v ValueInt64) Bytes() []byte

func (ValueInt64) FromArrayBytes

func (v ValueInt64) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueInt64) FromBytes

func (v *ValueInt64) FromBytes(b []byte) error

func (ValueInt64) Type

func (ValueInt64) Type() Type

type ValueNumberRange

type ValueNumberRange struct {
	Min, Max float32
}

func (*ValueNumberRange) ArrayBytes

func (v *ValueNumberRange) ArrayBytes(a []Value) (b []byte, err error)

func (ValueNumberRange) Bytes

func (v ValueNumberRange) Bytes() []byte

func (ValueNumberRange) FromArrayBytes

func (v ValueNumberRange) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueNumberRange) FromBytes

func (v *ValueNumberRange) FromBytes(b []byte) error

func (ValueNumberRange) Type

func (ValueNumberRange) Type() Type

type ValueNumberSequence

type ValueNumberSequence []ValueNumberSequenceKeypoint

func (*ValueNumberSequence) ArrayBytes

func (v *ValueNumberSequence) ArrayBytes(a []Value) (b []byte, err error)

func (ValueNumberSequence) Bytes

func (v ValueNumberSequence) Bytes() []byte

func (ValueNumberSequence) FromArrayBytes

func (v ValueNumberSequence) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueNumberSequence) FromBytes

func (v *ValueNumberSequence) FromBytes(b []byte) error

func (ValueNumberSequence) Type

func (ValueNumberSequence) Type() Type

type ValueNumberSequenceKeypoint

type ValueNumberSequenceKeypoint struct {
	Time, Value, Envelope float32
}

type ValuePhysicalProperties

type ValuePhysicalProperties struct {
	CustomPhysics    byte
	Density          float32
	Friction         float32
	Elasticity       float32
	FrictionWeight   float32
	ElasticityWeight float32
}

func (*ValuePhysicalProperties) ArrayBytes

func (v *ValuePhysicalProperties) ArrayBytes(a []Value) (b []byte, err error)

func (ValuePhysicalProperties) Bytes

func (v ValuePhysicalProperties) Bytes() []byte

func (ValuePhysicalProperties) FromArrayBytes

func (v ValuePhysicalProperties) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValuePhysicalProperties) FromBytes

func (v *ValuePhysicalProperties) FromBytes(b []byte) error

func (ValuePhysicalProperties) Type

type ValueRay

type ValueRay struct {
	OriginX    float32
	OriginY    float32
	OriginZ    float32
	DirectionX float32
	DirectionY float32
	DirectionZ float32
}

func (*ValueRay) ArrayBytes

func (v *ValueRay) ArrayBytes(a []Value) (b []byte, err error)

func (ValueRay) Bytes

func (v ValueRay) Bytes() []byte

func (ValueRay) FromArrayBytes

func (v ValueRay) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueRay) FromBytes

func (v *ValueRay) FromBytes(b []byte) error

func (ValueRay) Type

func (ValueRay) Type() Type

type ValueRect2D

type ValueRect2D struct {
	Min, Max ValueVector2
}

func (ValueRect2D) ArrayBytes

func (v ValueRect2D) ArrayBytes(a []Value) (b []byte, err error)

func (ValueRect2D) Bytes

func (v ValueRect2D) Bytes() []byte

func (ValueRect2D) FromArrayBytes

func (v ValueRect2D) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueRect2D) FromBytes

func (v *ValueRect2D) FromBytes(b []byte) error

func (ValueRect2D) Type

func (ValueRect2D) Type() Type

type ValueReference

type ValueReference int32

func (*ValueReference) ArrayBytes

func (v *ValueReference) ArrayBytes(a []Value) (b []byte, err error)

func (ValueReference) Bytes

func (v ValueReference) Bytes() []byte

func (ValueReference) FromArrayBytes

func (v ValueReference) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueReference) FromBytes

func (v *ValueReference) FromBytes(b []byte) error

func (ValueReference) Type

func (ValueReference) Type() Type

type ValueSharedString

type ValueSharedString uint32

func (*ValueSharedString) ArrayBytes

func (v *ValueSharedString) ArrayBytes(a []Value) (b []byte, err error)

func (ValueSharedString) Bytes

func (v ValueSharedString) Bytes() []byte

func (ValueSharedString) FromArrayBytes

func (v ValueSharedString) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueSharedString) FromBytes

func (v *ValueSharedString) FromBytes(b []byte) error

func (ValueSharedString) Type

func (ValueSharedString) Type() Type

type ValueString

type ValueString []byte

func (*ValueString) ArrayBytes

func (v *ValueString) ArrayBytes(a []Value) (b []byte, err error)

func (ValueString) Bytes

func (v ValueString) Bytes() []byte

func (ValueString) FromArrayBytes

func (v ValueString) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueString) FromBytes

func (v *ValueString) FromBytes(b []byte) error

func (ValueString) Type

func (ValueString) Type() Type

type ValueToken

type ValueToken uint32

func (*ValueToken) ArrayBytes

func (v *ValueToken) ArrayBytes(a []Value) (b []byte, err error)

func (ValueToken) Bytes

func (v ValueToken) Bytes() []byte

func (ValueToken) FromArrayBytes

func (v ValueToken) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueToken) FromBytes

func (v *ValueToken) FromBytes(b []byte) error

func (ValueToken) Type

func (ValueToken) Type() Type

type ValueUDim

type ValueUDim struct {
	Scale  ValueFloat
	Offset ValueInt
}

func (ValueUDim) ArrayBytes

func (v ValueUDim) ArrayBytes(a []Value) (b []byte, err error)

func (ValueUDim) Bytes

func (v ValueUDim) Bytes() []byte

func (ValueUDim) FromArrayBytes

func (v ValueUDim) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueUDim) FromBytes

func (v *ValueUDim) FromBytes(b []byte) error

func (ValueUDim) Type

func (ValueUDim) Type() Type

type ValueUDim2

type ValueUDim2 struct {
	ScaleX  ValueFloat
	ScaleY  ValueFloat
	OffsetX ValueInt
	OffsetY ValueInt
}

func (ValueUDim2) ArrayBytes

func (v ValueUDim2) ArrayBytes(a []Value) (b []byte, err error)

func (ValueUDim2) Bytes

func (v ValueUDim2) Bytes() []byte

func (ValueUDim2) FromArrayBytes

func (v ValueUDim2) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueUDim2) FromBytes

func (v *ValueUDim2) FromBytes(b []byte) error

func (ValueUDim2) Type

func (ValueUDim2) Type() Type

type ValueVector2

type ValueVector2 struct {
	X, Y ValueFloat
}

func (ValueVector2) ArrayBytes

func (v ValueVector2) ArrayBytes(a []Value) (b []byte, err error)

func (ValueVector2) Bytes

func (v ValueVector2) Bytes() []byte

func (ValueVector2) FromArrayBytes

func (v ValueVector2) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueVector2) FromBytes

func (v *ValueVector2) FromBytes(b []byte) error

func (ValueVector2) Type

func (ValueVector2) Type() Type

type ValueVector2int16

type ValueVector2int16 struct {
	X, Y int16
}

func (*ValueVector2int16) ArrayBytes

func (v *ValueVector2int16) ArrayBytes(a []Value) (b []byte, err error)

func (ValueVector2int16) Bytes

func (v ValueVector2int16) Bytes() []byte

func (ValueVector2int16) FromArrayBytes

func (v ValueVector2int16) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueVector2int16) FromBytes

func (v *ValueVector2int16) FromBytes(b []byte) error

func (ValueVector2int16) Type

func (ValueVector2int16) Type() Type

type ValueVector3

type ValueVector3 struct {
	X, Y, Z ValueFloat
}

func (ValueVector3) ArrayBytes

func (v ValueVector3) ArrayBytes(a []Value) (b []byte, err error)

func (ValueVector3) Bytes

func (v ValueVector3) Bytes() []byte

func (ValueVector3) FromArrayBytes

func (v ValueVector3) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueVector3) FromBytes

func (v *ValueVector3) FromBytes(b []byte) error

func (ValueVector3) Type

func (ValueVector3) Type() Type

type ValueVector3int16

type ValueVector3int16 struct {
	X, Y, Z int16
}

func (*ValueVector3int16) ArrayBytes

func (v *ValueVector3int16) ArrayBytes(a []Value) (b []byte, err error)

func (ValueVector3int16) Bytes

func (v ValueVector3int16) Bytes() []byte

func (ValueVector3int16) FromArrayBytes

func (v ValueVector3int16) FromArrayBytes(b []byte) (a []Value, err error)

func (*ValueVector3int16) FromBytes

func (v *ValueVector3int16) FromBytes(b []byte) error

func (ValueVector3int16) Type

func (ValueVector3int16) Type() Type

Jump to

Keyboard shortcuts

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