package kaiju_mesh
Types
AnimBone
struct
type AnimBone struct {
NodeIndex int
PathType AnimationPathType
Interpolation AnimationInterpolation
// Could be Vec3 or Quaternion, doing this because Go doesn't have a union
Data [4]matrix.Float
}
AnimKeyFrame
struct
AnimationInterpolation
const ( AnimInterpolateInvalid AnimationInterpolation = iota - 1 AnimInterpolateLinear AnimInterpolateStep AnimInterpolateCubicSpline )
AnimationPathType
const ( AnimPathInvalid AnimationPathType = iota - 1 AnimPathTranslation AnimPathRotation AnimPathScale AnimPathWeights )
KaijuMesh
struct
type KaijuMesh struct {
Name string
Verts []rendering.Vertex
Indexes []uint32
Animations []KaijuMeshAnimation
Joints []KaijuMeshJoint
}
KaijuMesh is a base primitive representing a single mesh. This is the archived format of the authored meshes. Typically this structure is created by loading in a mesh using something like [loaders.GLTF] and then converting the result of that using LoadedResultToKaijuMesh. From this point, it is typically serialized and stored into the content database. When reading a mesh from the content database, it will return a KaijuMesh.
Deserialize
Deserialize will construct a KaijuMesh from the given array of bytes. This deserialization uses the built-in gob.Decoder
LoadedResultToKaijuMesh
LoadedResultToKaijuMesh will take in a load_result.Result and convert every mesh contained within the structure to our built in version known as KaijuMesh. This is typically used for the editor, but games/applications may find some use for it.
ReadMesh
KaijuMesh.GenerateBVH
func (k KaijuMesh) GenerateBVH(threads *concurrent.Threads, transform *matrix.Transform, data any) *collision.BVH
KaijuMesh.Serialize
Serialize will convert a KaijuMesh into a byte array for saving to the database or later use. This serialization uses the built-in gob.Encoder
KaijuMeshAnimation
struct
KaijuMeshJoint
struct