You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think FeaturePair.value is used to distinguish contacts. While in Collide.cpp where contacts are computed, the only place to set value is in ClipVertex's constructor which set value=0.
I have been doing some work on Box2D-Lite and your ticket caught my attention.
It also looked to me that fp.value is only ever set to 0 but thats not the case.
If you look at the definition of FeaturePair we can see that its actually a union type so setting inEdge1, etc will also affect value. This seems like just a way to speed up comparisons between all of these char members using type punning.
union FeaturePair
{
struct Edges
{
char inEdge1;
char outEdge1;
char inEdge2;
char outEdge2;
} e;
int value;
};
Hi Erin, Thank you for your great illustrative code, it is very good for learning rigid body dynamics.
From Arbiter::Update,
box2d-lite/src/Arbiter.cpp
Lines 40 to 50 in 227b71b
I think FeaturePair.value is used to distinguish contacts. While in Collide.cpp where contacts are computed, the only place to set value is in ClipVertex's constructor which set value=0.
box2d-lite/src/Collide.cpp
Lines 44 to 49 in 227b71b
Does it seem like this value is not correctly assigned for its purpose?
Thank you.
The text was updated successfully, but these errors were encountered: