Merge pull request #261 from SHADE-DP/SP3-2-Physics

Fixed bug where rigidbody setters in the first frame causes a crash
This commit is contained in:
XiaoQiDigipen 2022-11-23 15:33:17 +08:00 committed by GitHub
commit 13ed36655e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -185,6 +185,7 @@ namespace SHADE
objectManager.commandQueue.pop(); objectManager.commandQueue.pop();
sceneGraph.Traverse(BUILD_NEW_SCENE_PHYSICS_OBJECT); sceneGraph.Traverse(BUILD_NEW_SCENE_PHYSICS_OBJECT);
objectManager.UpdateCommands();
} }
void SHPhysicsSystem::ForceUpdate() void SHPhysicsSystem::ForceUpdate()
@ -443,6 +444,7 @@ namespace SHADE
// Build scene // Build scene
SHSceneManager::GetCurrentSceneGraph().Traverse(BUILD_PHYSICS_OBJECT); SHSceneManager::GetCurrentSceneGraph().Traverse(BUILD_PHYSICS_OBJECT);
objectManager.UpdateCommands();
return onPlayEvent->handle; return onPlayEvent->handle;
} }