-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
In NvCloth, the following implement is wrong:
// skip continuous collision if the (un-clamped) particle
// trajectory only touches the outer skin of the cone.
T4f rMin = prevRadius + halfB * minusA * (curRadius - prevRadius);
collisionMask = collisionMask & (discriminant > minusA * rMin * rMin * sSkeletonWidth);
The definition of quadratic polynomial $ y = at^2 + b^2 + c $ actually represent difference between relative distance
$$
y(t) := d'^2 - r^2(t)
$$
where
$$
r(t) := r_0 + t\left( r_1 - r_0\right)
$$
The minimum of
$$
y_{\min} = y\left(-\frac{b}{2a}\right) = \frac{4ac - b^2}{4a} \doteq -\frac{d}{4a}
$$
where
-
$s$ is a ratio of distance where particle penetrates cone of sphere trajectory. in NvCloth, it is$-0.36$ :sSkeletonWidth = simd4f(cloth::sqr(1 - 0.2f) - 1);
-
$r_{\min}$ is radius of sphere at$t = -b / 2a$ :
$$
r_{\min} = r\left(-\frac{b}{2a} \right) = r_0 -{\color{blue}\frac{b}{2a}}\left( r_1 - r_0 \right)
$$
So the fact is
$$
\begin{align*}
& y_{\min} \ge s r^2_{\min} \
& \frac{d}{4} \ge -a r^2_{\min} s
\end{align*}
$$
Far from today, @lchut raise a question about this issue.
Metadata
Metadata
Assignees
Labels
No labels