|
Atoms Crowd
4.1.0
|
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);
155 return m_pelvises.size() > 0 ? &m_joints[m_pelvises[id]] : &m_joints[0];
160 return m_pelvises.size() > 0 ? &m_joints[m_pelvises[id]] : &m_joints[0];
165 if (m_pelvisChains.size() >
id)
166 return static_cast<unsigned int>(m_pelvisChains[id].size());
173 std::unordered_map<std::string, int>::const_iterator it = m_jointNameIdMap.find(name);
174 if (it != m_jointNameIdMap.end())
186 m_jointNameIdMap.clear();
187 m_jointMetadata.clear();
195 return m_jointMetadata[index];
200 m_jointMetadata[index] = data;
205 m_jointMetadata[index].addEntry(key, data);
210 m_jointMetadata[index].addEntry(key, data);
215 m_jointMetadata.clear();
220 return m_detachedJoints;
JointPtr footTip(unsigned short id)
Get foot tip.
Definition: Skeleton.impl.h:78
unsigned short numJoints() const
Gets the number of joints.
Definition: Skeleton.impl.h:11
void addJointMetadata(unsigned short index, const std::string &key, Metadata *data)
Adds joint metadata.
Definition: Skeleton.impl.h:208
Joint & operator[](unsigned short index)
Gets the joint.
Definition: Skeleton.impl.h:16
JointPtr pelvis(unsigned short id)
Gets a pelvis.
Definition: Skeleton.impl.h:153
const std::vector< unsigned short > & legJoints(unsigned short id) const
Get leg joints.
Definition: Skeleton.impl.h:118
void setRoot(unsigned short id)
Sets the root joint.
Definition: Skeleton.impl.h:36
const std::vector< unsigned short > & detachedJoints() const
Get joints without a parent.
Definition: Skeleton.impl.h:218
void setJointMetadata(unsigned short index, const MapMetadata &data)
Adds joint metadata.
Definition: Skeleton.impl.h:198
JointCPtr root() const
Gets the root joint.
Definition: Skeleton.impl.h:26
void addFoot(unsigned short footIK, unsigned short footRoot, unsigned short footTip)
Adds a foot.
Definition: Skeleton.impl.h:52
unsigned short numFeet() const
Gets the number of feet.
Definition: Skeleton.impl.h:42
bool footHasPoleVector(unsigned short id) const
Returns true if the foot at the given id has a pole vector.
Definition: Skeleton.impl.h:88
void setFootPoleVector(unsigned short id, const AtomsCore::Vector3 &value)
Set the foto pole vector.
Definition: Skeleton.impl.h:98
void clearJointsMetadata()
Clears all joint metadata.
Definition: Skeleton.impl.h:213
JointPtr footIK(unsigned short id)
Gets the foot IK.
Definition: Skeleton.impl.h:58
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
std::vector< SkeletonLod > & lods()
Get sim lod info.
Definition: Skeleton.impl.h:223
Joint class.
Definition: Joint.h:30
void clear()
Clears all joints and metadatas.
Definition: Skeleton.impl.h:181
AtomsCore namespace.
Definition: AtomsMath.h:24
unsigned int numPelvisChains(unsigned int id) const
Get number of pelvis chains.
Definition: Skeleton.impl.h:163
MapMetadata & jointMetadata(unsigned short index)
Gets joint metadata.
Definition: Skeleton.impl.h:193
const std::vector< unsigned short > & midJoints(unsigned short id) const
Get leg mid joints.
Definition: Skeleton.impl.h:113
unsigned short footPelvis(unsigned short id) const
Get foot pelvis.
Definition: Skeleton.impl.h:108
AtomsCore::Vector3 footPoleVector(unsigned short id) const
Returns the foot pole vector.
Definition: Skeleton.impl.h:93
void addPelvis(unsigned short pelvisJoint)
Adds a pelvis.
Definition: Skeleton.impl.h:133
JointPtr footRoot(unsigned short id)
Get foot root.
Definition: Skeleton.impl.h:68
unsigned short numPelvises() const
Gets the number of pelvises.
Definition: Skeleton.impl.h:123
void clearPelvises()
Clears all pelvises.
Definition: Skeleton.impl.h:128
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:171