18 return m_joints[index];
23 return m_joints[index];
28 return &m_joints[m_root];
33 return &m_joints[m_root];
44 return static_cast<unsigned short>(m_feet.size());
52 void Skeleton::addFoot(
unsigned short footIK,
unsigned short footRoot,
unsigned short footTip)
60 return &m_joints[m_feet[id].footIK];
65 return &m_joints[m_feet[id].footIK];
70 return &m_joints[m_feet[id].footRoot];
75 return &m_joints[m_feet[id].footRoot];
80 return &m_joints[m_feet[id].footTip];
85 return &m_joints[m_feet[id].footTip];
90 return m_feet[id].hasPoleVector;
95 return m_feet[id].poleVector;
100 if (
id < m_feet.size())
102 auto& foot = m_feet[id];
103 foot.poleVector = value;
104 foot.hasPoleVector =
true;
110 return m_feet[id].pelvis;
115 return m_feet[id].midJoints;
120 return m_feet[id].legJoints;
125 return static_cast<unsigned short>(std::max(m_pelvises.size(),
static_cast<size_t>(1)));
135 if (pelvisJoint < m_numJoints)
137 bool alreadyExists =
false;
138 for (
auto&
id : m_pelvises)
140 if (
id == pelvisJoint)
142 alreadyExists =
true;
148 m_pelvises.push_back(pelvisJoint);
150 std::sort(m_pelvises.begin(), m_pelvises.end());
158 return m_pelvises.size() > 0 ? &m_joints[m_pelvises[id]] : &m_joints[0];
163 return m_pelvises.size() > 0 ? &m_joints[m_pelvises[id]] : &m_joints[0];
168 if (m_pelvisChains.size() >
id)
169 return static_cast<unsigned int>(m_pelvisChains[id].size());
176 std::unordered_map<std::string, int>::const_iterator it = m_jointNameIdMap.find(name);
177 if (it != m_jointNameIdMap.end())
189 m_jointNameIdMap.clear();
190 m_jointMetadata.clear();
198 return m_jointMetadata[index];
203 m_jointMetadata[index] = data;
208 m_jointMetadata[index].addEntry(key, data);
213 m_jointMetadata[index].addEntry(key, data);
218 m_jointMetadata.clear();
223 return m_detachedJoints;
Joint class.
Definition: Joint.h:30
unsigned short numPelvises() const
Gets the number of pelvises.
Definition: Skeleton.impl.h:123
JointPtr footTip(unsigned short id)
Get foot tip.
Definition: Skeleton.impl.h:78
bool footHasPoleVector(unsigned short id) const
Returns true if the foot at the given id has a pole vector.
Definition: Skeleton.impl.h:88
const std::vector< unsigned short > & legJoints(unsigned short id) const
Get leg joints.
Definition: Skeleton.impl.h:118
const std::vector< unsigned short > & midJoints(unsigned short id) const
Get leg mid joints.
Definition: Skeleton.impl.h:113
JointPtr footRoot(unsigned short id)
Get foot root.
Definition: Skeleton.impl.h:68
JointCPtr root() const
Gets the root joint.
Definition: Skeleton.impl.h:26
unsigned int numPelvisChains(unsigned int id) const
Get number of pelvis chains.
Definition: Skeleton.impl.h:166
MapMetadata & jointMetadata(unsigned short index)
Gets joint metadata.
Definition: Skeleton.impl.h:196
void clear()
Clears all joints and metadatas.
Definition: Skeleton.impl.h:184
Joint & operator[](unsigned short index)
Gets the joint.
Definition: Skeleton.impl.h:16
void setFootPoleVector(unsigned short id, const AtomsCore::Vector3 &value)
Set the foto pole vector.
Definition: Skeleton.impl.h:98
AtomsCore::Vector3 footPoleVector(unsigned short id) const
Returns the foot pole vector.
Definition: Skeleton.impl.h:93
void setJointMetadata(unsigned short index, const MapMetadata &data)
Adds joint metadata.
Definition: Skeleton.impl.h:201
void clearPelvises()
Clears all pelvises.
Definition: Skeleton.impl.h:128
unsigned short footPelvis(unsigned short id) const
Get foot pelvis.
Definition: Skeleton.impl.h:108
const std::vector< unsigned short > & detachedJoints() const
Get joints without a parent.
Definition: Skeleton.impl.h:221
void clearJointsMetadata()
Clears all joint metadata.
Definition: Skeleton.impl.h:216
void addPelvis(unsigned short pelvisJoint)
Adds a pelvis.
Definition: Skeleton.impl.h:133
std::vector< SkeletonLod > & lods()
Get sim lod info.
Definition: Skeleton.impl.h:226
JointPtr footIK(unsigned short id)
Gets the foot IK.
Definition: Skeleton.impl.h:58
unsigned short numJoints() const
Gets the number of joints.
Definition: Skeleton.impl.h:11
void clearFeet()
Clears all the feet.
Definition: Skeleton.impl.h:47
int jointId(const std::string &name) const
Gets the joint id.
Definition: Skeleton.impl.h:174
JointPtr pelvis(unsigned short id)
Gets a pelvis.
Definition: Skeleton.impl.h:156
unsigned short numFeet() const
Gets the number of feet.
Definition: Skeleton.impl.h:42
void setRoot(unsigned short id)
Sets the root joint.
Definition: Skeleton.impl.h:36
void addJointMetadata(unsigned short index, const std::string &key, Metadata *data)
Adds joint metadata.
Definition: Skeleton.impl.h:211
void addFoot(unsigned short footIK, unsigned short footRoot, unsigned short footTip)
Adds a foot.
Definition: Skeleton.impl.h:52
AtomsCore namespace.
Definition: Agent.h:344
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57