Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
iMSTK
iMSTK
Commits
90147313
Commit
90147313
authored
Jun 21, 2019
by
Sreekanth Arikatla
Browse files
BUG: Clear rebase errors
parent
abfcc445
Changes
7
Hide whitespace changes
Inline
Side-by-side
Examples/NoRendering/noRenderingExample.cpp
View file @
90147313
...
...
@@ -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
...
...
Examples/PBDCloth/pbdClothExample.cpp
View file @
90147313
...
...
@@ -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
...
...
Examples/PBDFluids/PBDFluidsExample.cpp
View file @
90147313
...
...
@@ -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
);
...
...
Examples/SPHFluid/SPHFluidExample.hpp
View file @
90147313
...
...
@@ -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
;
...
...
Source/Scene/imstkScene.cpp
View file @
90147313
...
...
@@ -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 for
ces
on device
for
(
auto
controlle
r
:
this
->
get
SceneObje
ct
C
on
trollers
())
//
Pro
ces
s
collision data per interaction pair
for
(
auto
intPai
r
:
this
->
get
CollisionGraph
()
->
getIntera
ct
i
on
PairList
())
{
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
->
getSceneObject
Controller
s
())
{
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
Source/SimulationManager/imstkSimulationManager.cpp
View file @
90147313
...
...
@@ -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
)
{
...
...
Source/SimulationManager/imstkSimulationManager.h
View file @
90147313
...
...
@@ -43,7 +43,6 @@ namespace imstk
{
using
SimulationStatus
=
ModuleStatus
;
///
/// \class SimulationManager
///
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment