aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/src/scalar
diff options
context:
space:
mode:
authorMarijn Tamis <[email protected]>2018-05-03 18:22:48 +0200
committerMarijn Tamis <[email protected]>2018-05-03 18:22:48 +0200
commitca32c59a58d37c1822e185a2d5f3d0d3e8943593 (patch)
treeb06b9eec03f34344ef8fc31aa147b2714d3962ee /NvCloth/src/scalar
parentForced rename of platform folders in cmake dir. Git didn't pick this up before. (diff)
downloadnvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz
nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'NvCloth/src/scalar')
-rw-r--r--NvCloth/src/scalar/SwCollisionHelpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/NvCloth/src/scalar/SwCollisionHelpers.h b/NvCloth/src/scalar/SwCollisionHelpers.h
index 3ab756f..c86d939 100644
--- a/NvCloth/src/scalar/SwCollisionHelpers.h
+++ b/NvCloth/src/scalar/SwCollisionHelpers.h
@@ -69,13 +69,17 @@ struct Gather<Scalar4i>
Gather<Scalar4i>::Gather(const Scalar4i& index)
{
+ //index are grid positions
+
uint32_t mask = /* sGridSize */ 8 - 1;
+ // Get grid index (forced within range)
mIndex.u4[0] = index.u4[0] & mask;
mIndex.u4[1] = index.u4[1] & mask;
mIndex.u4[2] = index.u4[2] & mask;
mIndex.u4[3] = index.u4[3] & mask;
+ // true (filled with all ones = -1) when gridSize <= index || index < 0
mOutOfRange.i4[0] = index.u4[0] & ~mask ? 0 : -1;
mOutOfRange.i4[1] = index.u4[1] & ~mask ? 0 : -1;
mOutOfRange.i4[2] = index.u4[2] & ~mask ? 0 : -1;
@@ -84,6 +88,7 @@ Gather<Scalar4i>::Gather(const Scalar4i& index)
Scalar4i Gather<Scalar4i>::operator()(const Scalar4i* ptr) const
{
+ //ptr points to the cone/sphere grid
const int32_t* base = ptr->i4;
const int32_t* index = mIndex.i4;
const int32_t* mask = mOutOfRange.i4;