Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
iMSTK
iMSTK
Commits
521aa1cd
Commit
521aa1cd
authored
Jul 27, 2019
by
Nghia Truong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: Fix collision data during brute-force CD, changing from triangle-vertex to vertex-triangle
parent
e4089bb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
Source/Collision/CollisionDetection/imstkMeshToMeshBruteforceCD.cpp
...lision/CollisionDetection/imstkMeshToMeshBruteforceCD.cpp
+3
-3
Source/Collision/CollisionHandling/imstkPBDCollisionHandling.cpp
...Collision/CollisionHandling/imstkPBDCollisionHandling.cpp
+4
-3
No files found.
Source/Collision/CollisionDetection/imstkMeshToMeshBruteforceCD.cpp
View file @
521aa1cd
...
...
@@ -80,7 +80,7 @@ MeshToMeshBruteForceCD::computeCollisionData()
m_proximityTolerance
,
m_proximityTolerance
))
{
m_colData
->
T
VColData
.
safeAppend
({
static_cast
<
unsigned
int
>
(
j
),
static_cast
<
unsigned
int
>
(
i
),
0.0
});
m_colData
->
V
T
ColData
.
safeAppend
({
static_cast
<
unsigned
int
>
(
i
),
static_cast
<
unsigned
int
>
(
j
),
0.0
});
}
}
}
...
...
@@ -167,7 +167,7 @@ MeshToMeshBruteForceCD::computeCollisionData()
p1
[
0
],
p1
[
1
],
p1
[
2
],
p2
[
0
],
p2
[
1
],
p2
[
2
],
m_proximityTolerance
,
m_proximityTolerance
))
{
m_colData
->
T
VColData
.
safeAppend
({
static_cast
<
unsigned
int
>
(
j
),
static_cast
<
unsigned
int
>
(
i
),
0.0
});
m_colData
->
V
T
ColData
.
safeAppend
({
static_cast
<
unsigned
int
>
(
i
),
static_cast
<
unsigned
int
>
(
j
),
0.0
});
}
}
}
...
...
@@ -195,7 +195,7 @@ MeshToMeshBruteForceCD::computeCollisionData()
p1
[
0
],
p1
[
1
],
p1
[
2
],
p2
[
0
],
p2
[
1
],
p2
[
2
],
m_proximityTolerance
,
m_proximityTolerance
))
{
m_colData
->
T
VColData
.
safeAppend
({
static_cast
<
unsigned
int
>
(
j
),
static_cast
<
unsigned
int
>
(
i
),
0.0
});
m_colData
->
V
T
ColData
.
safeAppend
({
static_cast
<
unsigned
int
>
(
i
),
static_cast
<
unsigned
int
>
(
j
),
0.0
});
}
}
}
...
...
Source/Collision/CollisionHandling/imstkPBDCollisionHandling.cpp
View file @
521aa1cd
...
...
@@ -113,10 +113,10 @@ PBDCollisionHandling::generatePBDConstraints()
m_PBDConstraints
.
push_back
(
c
);
}
// Generate triangle
-vertex
pbd constraints
for
(
size_t
i
=
0
;
i
<
m_colData
->
T
VColData
.
getSize
();
++
i
)
// Generate
vertex-
triangle pbd constraints
for
(
size_t
i
=
0
;
i
<
m_colData
->
V
T
ColData
.
getSize
();
++
i
)
{
const
auto
&
colData
=
m_colData
->
T
VColData
[
i
];
const
auto
&
colData
=
m_colData
->
V
T
ColData
[
i
];
const
auto
&
triVerts
=
colGeo2
->
getTrianglesVertices
()[
colData
.
triIdx
];
const
auto
c
=
std
::
make_shared
<
PbdPointTriangleConstraint
>
();
...
...
@@ -144,6 +144,7 @@ PBDCollisionHandling::generatePBDConstraints()
m_PBDConstraints
.
push_back
(
c
);
}
//TODO: generating PbdPointTriangleConstraint from the VTColData should be added
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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