unit

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Unk00                [8]byte
	Bones                stingray.Hash
	Unk01                [8]byte
	UnkHash00            stingray.Hash
	StateMachine         stingray.Hash
	Unk02                [8]byte
	LODGroupListOffset   uint32
	JointListOffset      uint32
	UnkOffset01          uint32
	UnkOffset02          uint32
	Unk03                [12]byte
	UnkOffset03          uint32
	UnkOffset04          uint32
	Unk04                [4]byte
	UnkOffset05          uint32
	MeshLayoutListOffset uint32
	MeshDataOffset       uint32
	MeshInfoListOffset   uint32
	Unk05                [8]byte
	MaterialListOffset   uint32
}

type JointListHeader

type JointListHeader struct {
	NumJoints uint32
	Unk00     [12]byte
}

type JointTransform

type JointTransform struct {
	Rotation    [3][3]float32
	Translation [3]float32
	Scale       [3]float32
	Skew        float32
}

type LODEntry added in v0.3.0

type LODEntry struct {
	Detail struct {
		Max float32
		Min float32
	}
	Indices []uint32
}

type LODGroup added in v0.3.0

type LODGroup struct {
	Header struct {
		Unk00     uint32
		UnkHash00 stingray.ThinHash
		Unk01     uint32
		Unk02     uint32
	}
	Entries []LODEntry
	Footer  struct {
		UnkFloats00 [7]float32
		Unk00       uint32
		UnkFloat00  float32
		Unk01       uint32
	}
}

type Mesh

type Mesh struct {
	Info      MeshInfo
	Positions [][3]float32
	UVCoords  [][2]float32
	Colors    [][4]float32
	Indices   []uint32
}

type MeshGroup

type MeshGroup struct {
	Unk00        [4]byte
	VertexOffset uint32
	NumVertices  uint32
	IndexOffset  uint32
	NumIndices   uint32
	Unk01        [4]byte
}

type MeshHeader

type MeshHeader struct {
	Unk00          [60]byte
	LayoutIdx      int32
	Unk01          [40]byte
	NumMaterials   uint32
	MaterialOffset uint32
	Unk02          [8]byte
	NumGroups      uint32
	GroupOffset    uint32
}

type MeshInfo

type MeshInfo struct {
	Header    MeshHeader
	Materials []stingray.ThinHash
	Groups    []MeshGroup
}

type MeshLayout

type MeshLayout struct {
	MagicNum0 [4]byte
	Unk00     [4]byte
	Items     [16]struct {
		Type   MeshLayoutItemType
		Format MeshLayoutItemFormat
		Layer  uint32
		Unk00  [8]byte
	}
	NumItems      uint32
	Unk01         [4]byte
	MagicNum1     [4]byte
	Unk02         [12]byte
	NumVertices   uint32
	VertexStride  uint32
	Unk03         [16]byte
	MagicNum2     [4]byte
	Unk04         [12]byte
	NumIndices    uint32
	Unk05         [20]byte
	VertexOffset  uint32
	PositionsSize uint32
	IndexOffset   uint32
	IndicesSize   uint32
	Unk06         [16]byte
}

type MeshLayoutItemFormat

type MeshLayoutItemFormat uint32
const (
	FormatF32     MeshLayoutItemFormat = 0
	FormatVec2F   MeshLayoutItemFormat = 1
	FormatVec3F   MeshLayoutItemFormat = 2
	FormatVec4F   MeshLayoutItemFormat = 3
	FormatVec4U8  MeshLayoutItemFormat = 26
	FormatF16     MeshLayoutItemFormat = 28
	FormatVec2F16 MeshLayoutItemFormat = 29
	FormatVec3F16 MeshLayoutItemFormat = 30
	FormatVec4F16 MeshLayoutItemFormat = 31
)

func (MeshLayoutItemFormat) String

func (v MeshLayoutItemFormat) String() string

type MeshLayoutItemType

type MeshLayoutItemType uint32
const (
	ItemPosition   MeshLayoutItemType = 0
	ItemColor      MeshLayoutItemType = 1
	ItemUVCoords   MeshLayoutItemType = 4
	ItemBoneWeight MeshLayoutItemType = 6
	ItemBoneIdx    MeshLayoutItemType = 7
)

func (MeshLayoutItemType) String

func (v MeshLayoutItemType) String() string

type Unit

type Unit struct {
	LODGroups              []LODGroup
	JointTransforms        []JointTransform
	JointTransformMatrices [][4][4]float32
	Materials              map[stingray.ThinHash]stingray.Hash
	Meshes                 []Mesh
}

func Load

func Load(mainR io.ReadSeeker, gpuR io.ReadSeeker) (*Unit, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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