Merge remote-tracking branch 'upstream/stable' into RC-33

Conflicts:
	libraries/render-utils/src/MeshPartPayload.cpp
	libraries/render-utils/src/MeshPartPayload.h
	scripts/system/controllers/handControllerGrab.js
This commit is contained in:
Brad Davis 2017-02-07 09:31:41 -08:00
commit d1fc30435b
3 changed files with 13 additions and 3 deletions

View file

@ -370,14 +370,22 @@ void ModelMeshPartPayload::notifyLocationChanged() {
} }
void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& transform, const QVector<glm::mat4>& clusterMatrices) { void ModelMeshPartPayload::updateTransformForSkinnedMesh(const Transform& transform,
const QVector<glm::mat4>& clusterMatrices,
const QVector<glm::mat4>& cauterizedClusterMatrices) {
_transform = transform; _transform = transform;
_cauterizedTransform = transform;
if (clusterMatrices.size() > 0) { if (clusterMatrices.size() > 0) {
_worldBound = _adjustedLocalBound; _worldBound = _adjustedLocalBound;
_worldBound.transform(_transform); _worldBound.transform(_transform);
if (clusterMatrices.size() == 1) { if (clusterMatrices.size() == 1) {
_transform = _transform.worldTransform(Transform(clusterMatrices[0])); _transform = _transform.worldTransform(Transform(clusterMatrices[0]));
if (cauterizedClusterMatrices.size() != 0) {
_cauterizedTransform = _cauterizedTransform.worldTransform(Transform(cauterizedClusterMatrices[0]));
} else {
_cauterizedTransform = _transform;
}
} }
} else { } else {
_worldBound = _localBound; _worldBound = _localBound;

View file

@ -90,7 +90,8 @@ public:
void notifyLocationChanged() override; void notifyLocationChanged() override;
void updateTransformForSkinnedMesh(const Transform& transform, void updateTransformForSkinnedMesh(const Transform& transform,
const QVector<glm::mat4>& clusterMatrices); const QVector<glm::mat4>& clusterMatrices,
const QVector<glm::mat4>& cauterizedClusterMatrices);
float computeFadeAlpha() const; float computeFadeAlpha() const;
@ -110,6 +111,7 @@ public:
Model* _model; Model* _model;
Transform _cauterizedTransform;
int _meshIndex; int _meshIndex;
int _shapeID; int _shapeID;

View file

@ -248,7 +248,7 @@ void Model::updateRenderItems() {
// update the model transform and bounding box for this render item. // update the model transform and bounding box for this render item.
const Model::MeshState& state = data._model->_meshStates.at(data._meshIndex); const Model::MeshState& state = data._model->_meshStates.at(data._meshIndex);
data.updateTransformForSkinnedMesh(modelTransform, state.clusterMatrices); data.updateTransformForSkinnedMesh(modelTransform, state.clusterMatrices, state.cauterizedClusterMatrices);
} }
} }
}); });