Merge branch 'daft' of https://github.com/samcake/hifi into punk

This commit is contained in:
Sam Gateau 2015-06-19 17:48:07 +02:00
commit 2920197e88
2 changed files with 9 additions and 5 deletions

View file

@ -41,6 +41,7 @@ SkeletonModel::SkeletonModel(Avatar* owningAvatar, QObject* parent) :
_headClipDistance(DEFAULT_NEAR_CLIP)
{
assert(_owningAvatar);
_enableShapes = true;
}
SkeletonModel::~SkeletonModel() {
@ -254,9 +255,12 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) {
}
void SkeletonModel::updateJointState(int index) {
if (index > _jointStates.size()) {
return; // bail
}
JointState& state = _jointStates[index];
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 FBXGeometry& geometry = _geometry->getFBXGeometry();
if (index == geometry.leanJointIndex) {

View file

@ -506,7 +506,7 @@ FBXNode parseFBX(QIODevice* device) {
QVector<glm::vec4> createVec4Vector(const QVector<double>& doubleVector) {
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 y = *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> 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 y = *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> 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 y = *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> 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 t = *it++;
values.append(glm::vec2(s, -t));