Commit 90147313 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

BUG: Clear rebase errors

parent abfcc445
......@@ -38,7 +38,7 @@ using namespace imstk;
///
int main()
{
auto sdk = std::make_shared<SimulationManager>(false);
auto sdk = std::make_shared<SimulationManager>(SimulationManager::Mode::runInBackground);
auto scene = sdk->createNewScene("NoRendering");
// Create surface mesh
......
......@@ -26,15 +26,13 @@
using namespace imstk;
const bool runSimWithoutRendering = false;
///
/// \brief This example demonstrates the cloth simulation
/// using Position based dynamics
///
int main()
{
auto sdk = std::make_shared<SimulationManager>(runSimWithoutRendering);
auto sdk = std::make_shared<SimulationManager>();
auto scene = sdk->createNewScene("PBDCloth");
// Create surface mesh
......
......@@ -36,7 +36,7 @@ using namespace imstk;
///
int main()
{
auto sdk = std::make_shared<SimulationManager>(0);
auto sdk = std::make_shared<SimulationManager>();
auto scene = sdk->createNewScene("PBDFluid");
scene->getCamera()->setPosition(0, 10.0, 15.0);
......
......@@ -39,7 +39,7 @@ std::vector<std::shared_ptr<CollidingObject>> generateSolids(const std::shared_p
int main(int argc, char* argv[])
{
// SimulationManager must be created first
auto sdk = std::make_shared<SimulationManager>(0);
auto sdk = std::make_shared<SimulationManager>();
int threads = -1;
double particleRadius = 0.1;
......
......@@ -25,7 +25,6 @@
#include "imstkDebugGeometry.h"
#include "imstkPbdObject.h"
#include "imstkDeformableObject.h"
#include "imstkVirtualCouplingPBDObject.h"
#include "imstkTimer.h"
#include "imstkPbdSolver.h"
......@@ -67,15 +66,6 @@ Scene::launchModules()
{
m_threadMap[camController->getName()] = std::thread([camController] { camController->start(); });
}
// Init virtual coupling objects offsets
for (auto obj : this->getSceneObjects())
{
if (auto virtualCouplingPBD = std::dynamic_pointer_cast<VirtualCouplingPBDObject>(obj))
{
virtualCouplingPBD->initOffsets();
}
}
}
bool
......@@ -325,12 +315,6 @@ Scene::advance()
{
collidingObj->resetForce();
}
// todo: refactor pbd
// description: so that the transform obtained from device can be applied
if (auto virtualCouplingPBD = std::dynamic_pointer_cast<VirtualCouplingPBDObject>(obj))
{
virtualCouplingPBD->resetCollidingGeometry();
}
}
// Update objects controlled by the device controllers
......@@ -343,56 +327,30 @@ Scene::advance()
for (auto intPair : this->getCollisionGraph()->getInteractionPairList())
{
intPair->computeCollisionData();
intPair->computeContactForces();
}
// Apply forces on device
for (auto controller : this->getSceneObjectControllers())
// Process collision data per interaction pair
for (auto intPair : this->getCollisionGraph()->getInteractionPairList())
{
controller->applyForces();
intPair->processCollisionData();
}
// Update the solvers
// Run the solvers
for (auto solvers : this->getSolvers())
{
solvers->solve();
auto xx = std::dynamic_pointer_cast<PbdSolver>(solvers);
}
// Apply the geometry and apply maps to all the objects
for (auto obj : this->getSceneObjects())
{
obj->updateGeometries();
}
// Do collision detection and response for pbd objects
for (auto intPair : this->getCollisionGraph()->getPbdPairList())
{
intPair->resetConstraints();
if (intPair->doBroadPhaseCollision())
{
intPair->doNarrowPhaseCollision();
}
intPair->resolveCollision();
}
// Update velocity of PBD objects
for (auto obj : this->getSceneObjects())
// Apply updated forces on device
for (auto controller : this->getSceneObjectControllers())
{
if (auto pbdObj = std::dynamic_pointer_cast<PbdObject>(obj))
{
pbdObj->updateVelocity();
}
controller->applyForces();
}
// Set the trackers of virtual coupling PBD objects to out-of-date
// Apply the geometry and apply maps to all the objects
for (auto obj : this->getSceneObjects())
{
if (auto virtualCouplingPBD = std::dynamic_pointer_cast<VirtualCouplingPBDObject>(obj))
{
virtualCouplingPBD->setTrackerToOutOfDate();
}
obj->updateGeometries();
}
// Set the trackers of the scene object controllers to out-of-date
......@@ -428,6 +386,6 @@ Scene::advance()
}
}
this->setFPS((size_t)(1. / wwt.getTimeElapsed(StopWatch::TimeUnitType::seconds)));
this->setFPS(1. / wwt.getTimeElapsed(StopWatch::TimeUnitType::seconds));
}
} // imstk
\ No newline at end of file
......@@ -55,12 +55,6 @@ SimulationManager::SimulationManager(const SimulationManager::Mode mode, const b
}
}
const SimulationStatus&
SimulationManager::getStatus() const
{
return m_status;
}
void
SimulationManager::setThreadPoolSize(const int nThreads)
{
......
......@@ -43,7 +43,6 @@ namespace imstk
{
using SimulationStatus = ModuleStatus;
///
/// \class SimulationManager
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment