mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 00:53:17 +02:00
Merge branch 'daft' of https://github.com/samcake/hifi into punk
This commit is contained in:
commit
2920197e88
2 changed files with 9 additions and 5 deletions
|
@ -41,6 +41,7 @@ SkeletonModel::SkeletonModel(Avatar* owningAvatar, QObject* parent) :
|
||||||
_headClipDistance(DEFAULT_NEAR_CLIP)
|
_headClipDistance(DEFAULT_NEAR_CLIP)
|
||||||
{
|
{
|
||||||
assert(_owningAvatar);
|
assert(_owningAvatar);
|
||||||
|
_enableShapes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkeletonModel::~SkeletonModel() {
|
SkeletonModel::~SkeletonModel() {
|
||||||
|
@ -254,9 +255,12 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonModel::updateJointState(int index) {
|
void SkeletonModel::updateJointState(int index) {
|
||||||
|
if (index > _jointStates.size()) {
|
||||||
|
return; // bail
|
||||||
|
}
|
||||||
JointState& state = _jointStates[index];
|
JointState& state = _jointStates[index];
|
||||||
const FBXJoint& joint = state.getFBXJoint();
|
const FBXJoint& joint = state.getFBXJoint();
|
||||||
if (joint.parentIndex != -1) {
|
if (joint.parentIndex != -1 && joint.parentIndex <= _jointStates.size()) {
|
||||||
const JointState& parentState = _jointStates.at(joint.parentIndex);
|
const JointState& parentState = _jointStates.at(joint.parentIndex);
|
||||||
const FBXGeometry& geometry = _geometry->getFBXGeometry();
|
const FBXGeometry& geometry = _geometry->getFBXGeometry();
|
||||||
if (index == geometry.leanJointIndex) {
|
if (index == geometry.leanJointIndex) {
|
||||||
|
|
|
@ -506,7 +506,7 @@ FBXNode parseFBX(QIODevice* device) {
|
||||||
|
|
||||||
QVector<glm::vec4> createVec4Vector(const QVector<double>& doubleVector) {
|
QVector<glm::vec4> createVec4Vector(const QVector<double>& doubleVector) {
|
||||||
QVector<glm::vec4> values;
|
QVector<glm::vec4> values;
|
||||||
for (const double* it = doubleVector.constData(), *end = it + (doubleVector.size() / 4 * 4); it != end; ) {
|
for (const double* it = doubleVector.constData(), *end = it + ((doubleVector.size() / 4) * 4); it != end; ) {
|
||||||
float x = *it++;
|
float x = *it++;
|
||||||
float y = *it++;
|
float y = *it++;
|
||||||
float z = *it++;
|
float z = *it++;
|
||||||
|
@ -519,7 +519,7 @@ QVector<glm::vec4> createVec4Vector(const QVector<double>& doubleVector) {
|
||||||
|
|
||||||
QVector<glm::vec4> createVec4VectorRGBA(const QVector<double>& doubleVector, glm::vec4& average) {
|
QVector<glm::vec4> createVec4VectorRGBA(const QVector<double>& doubleVector, glm::vec4& average) {
|
||||||
QVector<glm::vec4> values;
|
QVector<glm::vec4> values;
|
||||||
for (const double* it = doubleVector.constData(), *end = it + (doubleVector.size() / 4 * 4); it != end; ) {
|
for (const double* it = doubleVector.constData(), *end = it + ((doubleVector.size() / 4) * 4); it != end; ) {
|
||||||
float x = *it++;
|
float x = *it++;
|
||||||
float y = *it++;
|
float y = *it++;
|
||||||
float z = *it++;
|
float z = *it++;
|
||||||
|
@ -536,7 +536,7 @@ QVector<glm::vec4> createVec4VectorRGBA(const QVector<double>& doubleVector, glm
|
||||||
|
|
||||||
QVector<glm::vec3> createVec3Vector(const QVector<double>& doubleVector) {
|
QVector<glm::vec3> createVec3Vector(const QVector<double>& doubleVector) {
|
||||||
QVector<glm::vec3> values;
|
QVector<glm::vec3> values;
|
||||||
for (const double* it = doubleVector.constData(), *end = it + (doubleVector.size() / 3 * 3); it != end; ) {
|
for (const double* it = doubleVector.constData(), *end = it + ((doubleVector.size() / 3) * 3); it != end; ) {
|
||||||
float x = *it++;
|
float x = *it++;
|
||||||
float y = *it++;
|
float y = *it++;
|
||||||
float z = *it++;
|
float z = *it++;
|
||||||
|
@ -547,7 +547,7 @@ QVector<glm::vec3> createVec3Vector(const QVector<double>& doubleVector) {
|
||||||
|
|
||||||
QVector<glm::vec2> createVec2Vector(const QVector<double>& doubleVector) {
|
QVector<glm::vec2> createVec2Vector(const QVector<double>& doubleVector) {
|
||||||
QVector<glm::vec2> values;
|
QVector<glm::vec2> values;
|
||||||
for (const double* it = doubleVector.constData(), *end = it + (doubleVector.size() / 2 * 2); it != end; ) {
|
for (const double* it = doubleVector.constData(), *end = it + ((doubleVector.size() / 2) * 2); it != end; ) {
|
||||||
float s = *it++;
|
float s = *it++;
|
||||||
float t = *it++;
|
float t = *it++;
|
||||||
values.append(glm::vec2(s, -t));
|
values.append(glm::vec2(s, -t));
|
||||||
|
|
Loading…
Reference in a new issue