Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
skeleton.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
10
//------------------------------------------------------------------------------
11
#include "
resources/resourceid.h
"
12
#include "
util/fixedarray.h
"
13
#include "
math/vector.h
"
14
namespace
Characters
15
{
16
17
ID_24_8_TYPE
(
SkeletonId
);
18
19
struct
CharacterJoint
20
{
21
IndexT
parentJointIndex
;
22
const
CharacterJoint
*
parentJoint
;
23
#if NEBULA_DEBUG
24
Util::StringAtom
name;
25
#endif
26
};
27
28
struct
SkeletonCreateInfo
29
{
30
Util::FixedArray<CharacterJoint>
joints
;
31
Util::FixedArray<Math::mat4>
bindPoses
;
32
Util::HashTable<Util::StringAtom, IndexT>
jointIndexMap
;
33
Util::FixedArray<Math::vec4>
idleSamples
;
34
};
35
37
const
SkeletonId
CreateSkeleton
(
const
SkeletonCreateInfo
& info);
39
void
DestroySkeleton
(
const
SkeletonId
id
);
40
42
const
SizeT
SkeletonGetNumJoints
(
const
SkeletonId
id
);
44
const
Util::FixedArray<CharacterJoint>
&
SkeletonGetJoints
(
const
SkeletonId
id
);
45
47
const
Util::FixedArray<Math::mat4>
&
SkeletonGetBindPose
(
const
SkeletonId
id
);
49
const
IndexT
SkeletonGetJointIndex
(
const
SkeletonId
id
,
const
Util::StringAtom
& name);
51
const
Util::FixedArray<Math::vec4>
&
SkeletonGetIdleSamples
(
const
SkeletonId
id
);
52
53
enum
54
{
55
Skeleton_Joints
,
56
Skeleton_BindPose
,
57
Skeleton_JointNameMap
,
58
Skeleton_IdleSamples
59
};
60
61
typedef
Ids::IdAllocator
<
62
Util::FixedArray<CharacterJoint>
,
63
Util::FixedArray<Math::mat4>
,
64
Util::HashTable<Util::StringAtom, IndexT>
,
65
Util::FixedArray<Math::vec4>
66
>
SkeletonAllocator
;
67
extern
SkeletonAllocator
skeletonAllocator
;
68
69
}
// namespace Characters
Ids::IdAllocator
An ID allocator associates an id with a slice in an N number of arrays.
Definition
idallocator.h:39
Util::FixedArray
Implements a fixed size one-dimensional array.
Definition
fixedarray.h:20
Util::HashTable
Organizes key/value pairs by a hash code.
Definition
hashtable.h:42
Util::StringAtom
A StringAtom.
Definition
stringatom.h:22
fixedarray.h
ID_24_8_TYPE
#define ID_24_8_TYPE(x)
Definition
id.h:132
Characters
A character encapsulates a skeleton resource, an animation resource, and the ability to instantiate s...
Definition
charactercontext.cc:21
Characters::CreateSkeleton
const SkeletonId CreateSkeleton(const SkeletonCreateInfo &info)
create model (resource)
Definition
skeleton.cc:15
Characters::SkeletonGetIdleSamples
const Util::FixedArray< Math::vec4 > & SkeletonGetIdleSamples(const SkeletonId id)
Get idle samples.
Definition
skeleton.cc:76
Characters::SkeletonGetJointIndex
const IndexT SkeletonGetJointIndex(const SkeletonId id, const Util::StringAtom &name)
get joint index
Definition
skeleton.cc:67
Characters::skeletonAllocator
SkeletonAllocator skeletonAllocator
Definition
skeleton.cc:10
Characters::SkeletonAllocator
Ids::IdAllocator< Util::FixedArray< CharacterJoint >, Util::FixedArray< Math::mat4 >, Util::HashTable< Util::StringAtom, IndexT >, Util::FixedArray< Math::vec4 > > SkeletonAllocator
Definition
skeleton.h:66
Characters::SkeletonGetBindPose
const Util::FixedArray< Math::mat4 > & SkeletonGetBindPose(const SkeletonId id)
get bind pose
Definition
skeleton.cc:58
Characters::SkeletonGetNumJoints
const SizeT SkeletonGetNumJoints(const SkeletonId id)
get number of joints from skeleton
Definition
skeleton.cc:40
Characters::Skeleton_IdleSamples
@ Skeleton_IdleSamples
Definition
skeleton.h:58
Characters::Skeleton_JointNameMap
@ Skeleton_JointNameMap
Definition
skeleton.h:57
Characters::Skeleton_BindPose
@ Skeleton_BindPose
Definition
skeleton.h:56
Characters::Skeleton_Joints
@ Skeleton_Joints
Definition
skeleton.h:55
Characters::SkeletonGetJoints
const Util::FixedArray< CharacterJoint > & SkeletonGetJoints(const SkeletonId id)
get joints from skeleton
Definition
skeleton.cc:49
Characters::DestroySkeleton
void DestroySkeleton(const SkeletonId id)
discard model (resource)
Definition
skeleton.cc:31
resourceid.h
Characters::CharacterJoint
Definition
skeleton.h:20
Characters::CharacterJoint::parentJointIndex
IndexT parentJointIndex
Definition
skeleton.h:21
Characters::CharacterJoint::parentJoint
const CharacterJoint * parentJoint
Definition
skeleton.h:22
Characters::SkeletonCreateInfo
Definition
skeleton.h:29
Characters::SkeletonCreateInfo::idleSamples
Util::FixedArray< Math::vec4 > idleSamples
Definition
skeleton.h:33
Characters::SkeletonCreateInfo::jointIndexMap
Util::HashTable< Util::StringAtom, IndexT > jointIndexMap
Definition
skeleton.h:32
Characters::SkeletonCreateInfo::bindPoses
Util::FixedArray< Math::mat4 > bindPoses
Definition
skeleton.h:31
Characters::SkeletonCreateInfo::joints
Util::FixedArray< CharacterJoint > joints
Definition
skeleton.h:30
Characters::SkeletonId
Definition
skeleton.h:17
SizeT
int SizeT
Definition
types.h:42
IndexT
int IndexT
Definition
types.h:41
vector.h
code
render
characters
skeleton.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.