Documentation ¶
Index ¶
- Variables
- func EncodeSc3dProperty(prop Sc3dProperty, writer *Writer)
- type Camera3D
- type File
- type Geometry
- type Header
- type IndexArray
- type InstanceMaterial
- type KeyFrame
- type Material
- type Matrix4x4
- type Node
- type NodeInstance
- type Quaternion
- type RGBA
- type Reader
- func (r *Reader) Read(n int) ([]byte, error)
- func (r *Reader) ReadBool() (bool, error)
- func (r *Reader) ReadFloat() (float32, error)
- func (r *Reader) ReadI16() (int16, error)
- func (r *Reader) ReadU16() (uint16, error)
- func (r *Reader) ReadU32() (uint32, error)
- func (r *Reader) ReadU8() (uint8, error)
- func (r *Reader) ReadUTF() (string, error)
- func (r *Reader) ReadUTFWithLength(length uint16) (string, error)
- func (r *Reader) Seek(n int)
- type Sc3dProperty
- type Scene
- type SourceArray
- type Variable
- type Vector3
- type Weight
- type Wend
- type Writer
- func (w *Writer) WriteBool(value bool)
- func (w *Writer) WriteBytes(bytes []byte)
- func (w *Writer) WriteFloat(value float32)
- func (w *Writer) WriteI16(value int16)
- func (w *Writer) WriteStringChars(str string)
- func (w *Writer) WriteStringUTF(str string)
- func (w *Writer) WriteU16(value uint16)
- func (w *Writer) WriteU32(value uint32)
- func (w *Writer) WriteU8(b byte)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidSCWMagic expected magic is to be SC3D (first 4 bytes of the File) ErrInvalidSCWMagic = errors.New("invalid scw file magic") )
Functions ¶
func EncodeSc3dProperty ¶
func EncodeSc3dProperty(prop Sc3dProperty, writer *Writer)
Types ¶
type Camera3D ¶
type File ¶
type File struct { Header Materials []*Material Geometries []*Geometry Scene Cameras []*Camera3D MinorVersion int // used for versions under 2 // contains filtered or unexported fields }
type Geometry ¶
type Geometry struct { SCWFile *File `json:"-"` Name string Group string // this was used in older versions of scw format IgnoredMatrix Matrix4x4 Vertices []SourceArray HasBindMatrix bool BindMatrix Matrix4x4 Skins struct { Joints []string InverseBindMatrices []Matrix4x4 } SkinWeights []Weight Materials []IndexArray }
type Header ¶
type IndexArray ¶
type IndexArray struct { Name string IndexBufferSize byte IndexBuffer []uint32 TrianglesCount uint32 InputsCount byte }
func (*IndexArray) Decode ¶
func (i *IndexArray) Decode(reader *Reader) (err error)
func (*IndexArray) Encode ¶
func (i *IndexArray) Encode(writer *Writer)
type InstanceMaterial ¶
type InstanceMaterial struct {
Name, Target string
}
func (*InstanceMaterial) Decode ¶
func (i *InstanceMaterial) Decode(reader *Reader) (err error)
func (*InstanceMaterial) Encode ¶
func (i *InstanceMaterial) Encode(writer *Writer)
type KeyFrame ¶
type KeyFrame struct { ID uint16 Rotation Quaternion Translation, Scale Vector3 }
type Material ¶
type Material struct { SCWFile *File `json:"-"` Name string ShaderFile string BlendMode byte Variables struct { Ambient Variable Diffuse Variable Specular Variable StencilTex2D string NormalTex2D string Colorize Variable Emission Variable OpacityTex2D string Opacity, Unk float32 LightmapTex2D, LightmapSpecularTex2D, Unk2 string } ShaderConfig uint32 StencilScaleOffset [4]float32 }
type Node ¶
type Node struct { SCWFile *File `json:"-"` Name, ParentName string Instances []NodeInstance Frames []KeyFrame FramesFlags byte }
type NodeInstance ¶
type NodeInstance struct {
Type, Target string
CameraTarget string
Materials []InstanceMaterial
}
func (*NodeInstance) Decode ¶
func (n *NodeInstance) Decode(reader *Reader) (err error)
func (*NodeInstance) Encode ¶
func (n *NodeInstance) Encode(writer *Writer)
type Quaternion ¶
Quaternion q= w + xi + yj + zk
w is the scalar component
x, y and z are the vector components
func (*Quaternion) Equals ¶
func (q *Quaternion) Equals(other *Quaternion) bool
type Reader ¶
type Reader struct { SkipBytes int // contains filtered or unexported fields }
func (*Reader) ReadUTFWithLength ¶
type Sc3dProperty ¶
type SourceArray ¶
type SourceArray struct { Name string Index byte SourceIndex byte // uh, it is used for TEXTCOORD I think? Stride byte // stride(Color) / element size Scale float32 // this can always be 0?? (not saying it is) Data []float64 // vertex/coordinate data? }
func (*SourceArray) Decode ¶
func (s *SourceArray) Decode(reader *Reader) (err error)
func (*SourceArray) Encode ¶
func (s *SourceArray) Encode(writer *Writer)
type Writer ¶
func (*Writer) WriteBytes ¶
func (*Writer) WriteFloat ¶
func (*Writer) WriteStringChars ¶
func (*Writer) WriteStringUTF ¶
Click to show internal directories.
Click to hide internal directories.