A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Julio Jerez » Thu Nov 03, 2011 4:18 pm
did you test the check in? hwo did it worked?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Julio Jerez » Thu Nov 03, 2011 7:27 pm
Oh I forget to tell you this, I beleive thsi one is a bug in your size.
I beleive it happens when the code find two normals.
I guess tha you are checking if the nomber of contact is equal one and if it not, then you asume not collision, but that is not the case.
Im I inbcorrect on sayoin that?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Julio Jerez » Thu Nov 03, 2011 8:06 pm
Ok I think I fix that problem now, but that does not take care problem when there are more than on legitimate contact.
for example if a ball hit a corner it is at some point the ball will rest in tree contacts, one on each wall.
the bug I fixed is that if the ball hit an edge of two adjacent faces then only one contact must be valid. the wcode l eliminate duplicate contacts before returning.
The solver can deal wih that bu the collision user collision does not.
anyway you fix that "more than on conctact bug", then it should be prefect now.
I hope this fixes that problem.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Fri Nov 04, 2011 1:08 am
I tried your code, and it works great for all those problematic areas. The only remaining issue is when the sphere hits a corner between three edges. I don't understand what you meant. How should I deal with this?
Thanks!
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Fri Nov 04, 2011 8:31 am
did you try when it hit a corners with three walls? the probability of that happen is almost zero,
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Fri Nov 04, 2011 2:15 pm
If you hit a corner like in the image below, no collision is detected:

- Image2.jpg (43.61 KiB) Viewed 4745 times
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Fri Nov 04, 2011 2:19 pm
Umm, Ok I will investigate
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Fri Nov 04, 2011 3:10 pm
It should be okay if more than one contact is generated. Even if the time of impact is the same, it doesn't matter if (penetration * normal) gives you the same position for the sphere. Right?
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Fri Nov 04, 2011 3:20 pm
there are two cases, more than one contact, one coming from each face, but all at the same position.
bu the conatct can be at the same position like on that corner, of diffrent position if teh corent is concave.
that si just an ideal syatuation.
In reality in all case teh concat coem at diffrent position and at diffrent time step.
so it is a very difcut problem to detrmine whi oen ar treh valid contacts.
what the code does is that ir only keep teh concats wi the smallest time, and remove all o fteh concat whic posiition are close by small amound.
the missing at teh end of and edge, is the same problem of missin at the edge of a face.
basically for a face I thought that is the ball misses the inside of the plane, then the closest hit wiould be the hit point but that is not true.
so I added and function to ge the closest point from a moving shaper to an edge.
Maybe ther is still a bug whn eth ball hi teh edge of the edge. I have will find out.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Sat Nov 05, 2011 3:25 am
Did you happen to change it so that TreeCollisions cannot have a convex hull modifier created for them? I added a breakpoint in this file and it's being triggered with a tree collision:
- Code: Select all
dgCollision* dgWorld::CreateConvexModifier(dgCollision* convexCollision)
{
dgCollision* collision;
collision = NULL;
if (convexCollision->IsType(dgCollision::dgConvexCollision_RTTI))
{
// if (!convexCollision->IsType (dgCollision::dgCollisionCompound_RTTI) && !convexCollision->IsType (m_nullType)) {
if (!convexCollision->IsType(dgCollision::dgCollisionNull_RTTI))
{
collision = new (m_allocator) dgCollisionConvexModifier(
(dgCollisionConvex*) convexCollision, this);
}
}
else
{
//Breakpoint here
int k=1;
}
return collision;
}
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Sat Nov 05, 2011 6:58 am
no you can not add a colllsion tree to a convex modifier, no was never part of the api.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Sat Nov 05, 2011 3:12 pm
Oh okay, I thought they worked for everything except compound collisions. I'll deal with it.

-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by pHySiQuE » Mon Nov 07, 2011 2:12 pm
Do you need another demo to show the problem with the corners? I'll make one if you want.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by pHySiQuE » Wed Nov 09, 2011 8:24 pm
I tried the newest update. It seems to work for smaller objects, and hits corners,

but it still passes right through the corners of bigger objects.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Thu Nov 10, 2011 12:41 am
Le us work on that bug over the weekend
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests