Skip to content

Commit

Permalink
add stage scaling from configured scale values. (#2543)
Browse files Browse the repository at this point in the history
  • Loading branch information
aclegg3 authored Feb 7, 2025
1 parent e6f0561 commit 00f0541
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/esp/assets/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,9 @@ bool ResourceManager::loadStage(
renderInfo.filepath, Cr::Containers::NullOpt, flags, renderLightSetupKey);
ESP_DEBUG() << "Start load render asset" << renderInfo.filepath << ".";

// Set the stage scale from the config
renderCreation.scale = stageAttributes->getScale();

bool renderMeshSuccess = loadStageInternal(renderInfo, // AssetInfo
&renderCreation,
&rootNode, // parent scene node
Expand Down
5 changes: 4 additions & 1 deletion src/esp/physics/bullet/BulletRigidStage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ void BulletRigidStage::constructAndAddCollisionObjects() {
const assets::MeshMetaData& metaData =
resMgr_.getMeshMetaData(collisionAssetHandle);

constructBulletSceneFromMeshes(Magnum::Matrix4{}, meshGroup, metaData.root);
// set the configured scaling as the initial transform for collision mesh
// construction
auto initial_transform = Magnum::Matrix4::scaling(initAttr->getScale());
constructBulletSceneFromMeshes(initial_transform, meshGroup, metaData.root);

for (auto& object : bStaticCollisionObjects_) {
object->setFriction(initAttr->getFrictionCoefficient());
Expand Down

0 comments on commit 00f0541

Please sign in to comment.