Skip to content

package load_result

import "kaiju/rendering/loaders/load_result"

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

type AnimKeyFrame struct {
    Bones []AnimBone
    Time  float32
}

Animation

struct

type Animation struct {
    Name   string
    Frames []AnimKeyFrame
}

AnimationInterpolation

int

type AnimationInterpolation = int

const ( AnimInterpolateInvalid AnimationInterpolation = iota - 1 AnimInterpolateLinear AnimInterpolateStep AnimInterpolateCubicSpline )

AnimationPathType

int

type AnimationPathType = int

const ( AnimPathInvalid AnimationPathType = iota - 1 AnimPathTranslation AnimPathRotation AnimPathScale AnimPathWeights )

Joint

struct

type Joint struct {
    Id   int32
    Skin matrix.Mat4
}

Mesh

struct

type Mesh struct {
    Name     string
    MeshName string
    Verts    []rendering.Vertex
    Indexes  []uint32
}

Mesh.ScaledRadius

func (mesh *Mesh) ScaledRadius(scale matrix.Vec3) matrix.Float

Node

struct

type Node struct {
    Name      string
    Parent    int
    Transform matrix.Transform
}

Result

struct

type Result struct {
    Nodes      []Node
    Meshes     []Mesh
    Textures   []string
    Animations []Animation
    Joints     []Joint
}

NewResult

func NewResult() Result

Result.Add

func (r *Result) Add(name, meshName string, verts []rendering.Vertex,

indexes []uint32, textures []string)

Result.IsValid

func (r *Result) IsValid() bool