mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
remove cruft: unused function arguments
This commit is contained in:
parent
87bdaae05a
commit
b3e336de3d
4 changed files with 14 additions and 17 deletions
|
@ -37,7 +37,7 @@ int SoftAttachmentModel::getJointIndexOverride(int i) const {
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
// use the _rigOverride matrices instead of the Model::_rig
|
// use the _rigOverride matrices instead of the Model::_rig
|
||||||
void SoftAttachmentModel::updateClusterMatrices(glm::vec3 modelPosition, glm::quat modelOrientation) {
|
void SoftAttachmentModel::updateClusterMatrices() {
|
||||||
if (!_needsUpdateClusterMatrices) {
|
if (!_needsUpdateClusterMatrices) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,6 @@ void SoftAttachmentModel::updateClusterMatrices(glm::vec3 modelPosition, glm::qu
|
||||||
|
|
||||||
const FBXGeometry& geometry = getFBXGeometry();
|
const FBXGeometry& geometry = getFBXGeometry();
|
||||||
|
|
||||||
glm::mat4 modelToWorld = glm::mat4_cast(modelOrientation);
|
|
||||||
for (int i = 0; i < _meshStates.size(); i++) {
|
for (int i = 0; i < _meshStates.size(); i++) {
|
||||||
MeshState& state = _meshStates[i];
|
MeshState& state = _meshStates[i];
|
||||||
const FBXMesh& mesh = geometry.meshes.at(i);
|
const FBXMesh& mesh = geometry.meshes.at(i);
|
||||||
|
@ -53,7 +52,7 @@ void SoftAttachmentModel::updateClusterMatrices(glm::vec3 modelPosition, glm::qu
|
||||||
for (int j = 0; j < mesh.clusters.size(); j++) {
|
for (int j = 0; j < mesh.clusters.size(); j++) {
|
||||||
const FBXCluster& cluster = mesh.clusters.at(j);
|
const FBXCluster& cluster = mesh.clusters.at(j);
|
||||||
|
|
||||||
// TODO: cache these look ups as an optimization
|
// TODO: cache these look-ups as an optimization
|
||||||
int jointIndexOverride = getJointIndexOverride(cluster.jointIndex);
|
int jointIndexOverride = getJointIndexOverride(cluster.jointIndex);
|
||||||
glm::mat4 jointMatrix;
|
glm::mat4 jointMatrix;
|
||||||
if (jointIndexOverride >= 0 && jointIndexOverride < _rigOverride->getJointStateCount()) {
|
if (jointIndexOverride >= 0 && jointIndexOverride < _rigOverride->getJointStateCount()) {
|
||||||
|
@ -61,7 +60,13 @@ void SoftAttachmentModel::updateClusterMatrices(glm::vec3 modelPosition, glm::qu
|
||||||
} else {
|
} else {
|
||||||
jointMatrix = _rig->getJointTransform(cluster.jointIndex);
|
jointMatrix = _rig->getJointTransform(cluster.jointIndex);
|
||||||
}
|
}
|
||||||
state.clusterMatrices[j] = modelToWorld * jointMatrix * cluster.inverseBindMatrix;
|
#if GLM_ARCH & GLM_ARCH_SSE2
|
||||||
|
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
||||||
|
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
||||||
|
state.clusterMatrices[j] = out;
|
||||||
|
#else
|
||||||
|
state.clusterMatrices[j] = jointMatrix * cluster.inverseBindMatrix;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once computed the cluster matrices, update the buffer(s)
|
// Once computed the cluster matrices, update the buffer(s)
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
~SoftAttachmentModel();
|
~SoftAttachmentModel();
|
||||||
|
|
||||||
virtual void updateRig(float deltaTime, glm::mat4 parentTransform) override;
|
virtual void updateRig(float deltaTime, glm::mat4 parentTransform) override;
|
||||||
virtual void updateClusterMatrices(glm::vec3 modelPosition, glm::quat modelOrientation) override;
|
virtual void updateClusterMatrices() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int getJointIndexOverride(int i) const;
|
int getJointIndexOverride(int i) const;
|
||||||
|
|
|
@ -222,19 +222,11 @@ void Model::updateRenderItems() {
|
||||||
Transform scaledModelTransform(modelTransform);
|
Transform scaledModelTransform(modelTransform);
|
||||||
scaledModelTransform.setScale(scale);
|
scaledModelTransform.setScale(scale);
|
||||||
|
|
||||||
Transform modelMeshOffset;
|
|
||||||
if (self->isLoaded()) {
|
|
||||||
// includes model offset and unitScale.
|
|
||||||
modelMeshOffset = Transform(self->_rig->getGeometryToRigTransform());
|
|
||||||
} else {
|
|
||||||
modelMeshOffset.postTranslate(self->_offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t deleteGeometryCounter = self->_deleteGeometryCounter;
|
uint32_t deleteGeometryCounter = self->_deleteGeometryCounter;
|
||||||
|
|
||||||
render::PendingChanges pendingChanges;
|
render::PendingChanges pendingChanges;
|
||||||
foreach (auto itemID, self->_modelMeshRenderItems.keys()) {
|
foreach (auto itemID, self->_modelMeshRenderItems.keys()) {
|
||||||
pendingChanges.updateItem<ModelMeshPartPayload>(itemID, [modelTransform, modelMeshOffset, deleteGeometryCounter](ModelMeshPartPayload& data) {
|
pendingChanges.updateItem<ModelMeshPartPayload>(itemID, [modelTransform, deleteGeometryCounter](ModelMeshPartPayload& data) {
|
||||||
if (data._model && data._model->isLoaded()) {
|
if (data._model && data._model->isLoaded()) {
|
||||||
if (!data.hasStartedFade() && data._model->getGeometry()->areTexturesLoaded()) {
|
if (!data.hasStartedFade() && data._model->getGeometry()->areTexturesLoaded()) {
|
||||||
data.startFade();
|
data.startFade();
|
||||||
|
@ -242,7 +234,7 @@ void Model::updateRenderItems() {
|
||||||
// Ensure the model geometry was not reset between frames
|
// Ensure the model geometry was not reset between frames
|
||||||
if (deleteGeometryCounter == data._model->_deleteGeometryCounter) {
|
if (deleteGeometryCounter == data._model->_deleteGeometryCounter) {
|
||||||
// lazy update of cluster matrices used for rendering. We need to update them here, so we can correctly update the bounding box.
|
// lazy update of cluster matrices used for rendering. We need to update them here, so we can correctly update the bounding box.
|
||||||
data._model->updateClusterMatrices(modelTransform.getTranslation(), modelTransform.getRotation());
|
data._model->updateClusterMatrices();
|
||||||
|
|
||||||
// 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);
|
||||||
|
@ -1157,7 +1149,7 @@ void Model::simulateInternal(float deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
void Model::updateClusterMatrices(glm::vec3 modelPosition, glm::quat modelOrientation) {
|
void Model::updateClusterMatrices() {
|
||||||
PerformanceTimer perfTimer("Model::updateClusterMatrices");
|
PerformanceTimer perfTimer("Model::updateClusterMatrices");
|
||||||
|
|
||||||
if (!_needsUpdateClusterMatrices || !isLoaded()) {
|
if (!_needsUpdateClusterMatrices || !isLoaded()) {
|
||||||
|
|
|
@ -126,7 +126,7 @@ public:
|
||||||
bool getSnapModelToRegistrationPoint() { return _snapModelToRegistrationPoint; }
|
bool getSnapModelToRegistrationPoint() { return _snapModelToRegistrationPoint; }
|
||||||
|
|
||||||
virtual void simulate(float deltaTime, bool fullUpdate = true);
|
virtual void simulate(float deltaTime, bool fullUpdate = true);
|
||||||
virtual void updateClusterMatrices(glm::vec3 modelPosition, glm::quat modelOrientation);
|
virtual void updateClusterMatrices();
|
||||||
|
|
||||||
/// Returns a reference to the shared geometry.
|
/// Returns a reference to the shared geometry.
|
||||||
const Geometry::Pointer& getGeometry() const { return _renderGeometry; }
|
const Geometry::Pointer& getGeometry() const { return _renderGeometry; }
|
||||||
|
|
Loading…
Reference in a new issue