Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Boeckel
iMSTK
Commits
ff19d1a0
Commit
ff19d1a0
authored
5 years ago
by
Sreekanth Arikatla
Browse files
Options
Downloads
Patches
Plain Diff
REFAC: Remove redundant geometry maps in examples
parent
943ecc3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/PBDCollision/PBDCollisionExample.cpp
+7
-27
7 additions, 27 deletions
Examples/PBDCollision/PBDCollisionExample.cpp
Examples/PBDFluids/PBDFluidsExample.cpp
+0
-19
0 additions, 19 deletions
Examples/PBDFluids/PBDFluidsExample.cpp
with
7 additions
and
46 deletions
Examples/PBDCollision/PBDCollisionExample.cpp
+
7
−
27
View file @
ff19d1a0
...
...
@@ -107,18 +107,16 @@ int main()
scene
->
addSceneObject
(
deformableObj
);
bool
clothTest
=
0
;
bool
volumetric
=
!
clothTest
;
// Build floor geometry
StdVectorOfVec3d
vertList
;
double
width
=
100.0
;
double
height
=
100.0
;
size_t
nRows
=
2
;
size_t
nCols
=
2
;
vertList
.
resize
(
nRows
*
nCols
);
const
double
width
=
100.0
;
const
double
height
=
100.0
;
const
size_t
nRows
=
2
;
const
size_t
nCols
=
2
;
const
double
dy
=
width
/
static_cast
<
double
>
(
nCols
-
1
);
const
double
dx
=
height
/
static_cast
<
double
>
(
nRows
-
1
);
StdVectorOfVec3d
vertList
;
vertList
.
resize
(
nRows
*
nCols
);
for
(
size_t
i
=
0
;
i
<
nRows
;
++
i
)
{
for
(
size_t
j
=
0
;
j
<
nCols
;
j
++
)
...
...
@@ -151,28 +149,10 @@ int main()
auto
floorMeshModel
=
std
::
make_shared
<
VisualModel
>
(
floorMesh
);
floorMeshModel
->
setRenderMaterial
(
materialFloor
);
auto
floorMapP2V
=
std
::
make_shared
<
OneToOneMap
>
();
floorMapP2V
->
setMaster
(
floorMesh
);
floorMapP2V
->
setSlave
(
floorMesh
);
floorMapP2V
->
compute
();
auto
floorMapP2C
=
std
::
make_shared
<
OneToOneMap
>
();
floorMapP2C
->
setMaster
(
floorMesh
);
floorMapP2C
->
setSlave
(
floorMesh
);
floorMapP2C
->
compute
();
auto
floorMapC2V
=
std
::
make_shared
<
OneToOneMap
>
();
floorMapC2V
->
setMaster
(
floorMesh
);
floorMapC2V
->
setSlave
(
floorMesh
);
floorMapC2V
->
compute
();
auto
floor
=
std
::
make_shared
<
PbdObject
>
(
"Floor"
);
floor
->
setCollidingGeometry
(
floorMesh
);
floor
->
setVisualGeometry
(
floorMesh
);
floor
->
setPhysicsGeometry
(
floorMesh
);
floor
->
setPhysicsToCollidingMap
(
floorMapP2C
);
floor
->
setPhysicsToVisualMap
(
floorMapP2V
);
floor
->
setCollidingToVisualMap
(
floorMapC2V
);
auto
pbdModel2
=
std
::
make_shared
<
PbdModel
>
();
pbdModel2
->
setModelGeometry
(
floorMesh
);
...
...
This diff is collapsed.
Click to expand it.
Examples/PBDFluids/PBDFluidsExample.cpp
+
0
−
19
View file @
ff19d1a0
...
...
@@ -24,7 +24,6 @@
#include
"imstkPbdModel.h"
#include
"imstkPbdObject.h"
#include
"imstkPbdSolver.h"
#include
"imstkOneToOneMap.h"
#include
"imstkAPIUtilities.h"
#include
"imstkMeshToMeshBruteforceCD.h"
#include
"imstkPBDCollisionHandling.h"
...
...
@@ -204,28 +203,10 @@ int main()
auto
floorMeshPhysics
=
std
::
make_shared
<
SurfaceMesh
>
();
floorMeshPhysics
->
initialize
(
vertList
,
triangles
);
auto
floorMapP2V
=
std
::
make_shared
<
OneToOneMap
>
();
floorMapP2V
->
setMaster
(
floorMeshPhysics
);
floorMapP2V
->
setSlave
(
floorMeshVisual
);
floorMapP2V
->
compute
();
auto
floorMapP2C
=
std
::
make_shared
<
OneToOneMap
>
();
floorMapP2C
->
setMaster
(
floorMeshPhysics
);
floorMapP2C
->
setSlave
(
floorMeshColliding
);
floorMapP2C
->
compute
();
auto
floorMapC2V
=
std
::
make_shared
<
OneToOneMap
>
();
floorMapC2V
->
setMaster
(
floorMeshColliding
);
floorMapC2V
->
setSlave
(
floorMeshVisual
);
floorMapC2V
->
compute
();
auto
floor
=
std
::
make_shared
<
PbdObject
>
(
"Floor"
);
floor
->
setCollidingGeometry
(
floorMeshColliding
);
floor
->
setVisualGeometry
(
floorMeshVisual
);
floor
->
setPhysicsGeometry
(
floorMeshPhysics
);
floor
->
setPhysicsToCollidingMap
(
floorMapP2C
);
floor
->
setPhysicsToVisualMap
(
floorMapP2V
);
floor
->
setCollidingToVisualMap
(
floorMapC2V
);
auto
pbdModel2
=
std
::
make_shared
<
PbdModel
>
();
pbdModel2
->
setModelGeometry
(
floorMeshPhysics
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment