New btInternalEdgeUtility has been added
Re: New btInternalEdgeUtility has been added
I use the default vehicleDemo to modify as this program,after initialization, drive the car inside the tunnel , press "w" to show the wireframe, move the car slowly along the wall. Crash the triangular dense point, sometimes, it suddenly mad.
There is also a problem, when I put this InternalEdge patch used in a large scene,the program just crash after it starts, and I am still checking what 's the problem.
InternalEdge patch is very important, when the scene goes big,when the cars across the shape edge, 50% chance would make car go mad or get a big impulse.
There is also a problem, when I put this InternalEdge patch used in a large scene,the program just crash after it starts, and I am still checking what 's the problem.
InternalEdge patch is very important, when the scene goes big,when the cars across the shape edge, 50% chance would make car go mad or get a big impulse.
- Attachments
-
- VehicleDemo.7z
- (12.19 KiB) Downloaded 640 times
-
- car_.GIF (18.73 KiB) Viewed 20184 times
Re: New btInternalEdgeUtility has been added
and more,in debug mode, the quaternion value can be zero value.
it cause some trouble
this is the call stack
it cause some trouble
this is the call stack
- Attachments
-
- qut_zero.GIF (15.5 KiB) Viewed 20179 times
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: New btInternalEdgeUtility has been added
Maybe the quaternion is not a bug. It depends where the axis comes from. You could construct an identity quaternion in this case well, but it depends on the context.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: New btInternalEdgeUtility has been added
Thanks a lot for the reproduction case.
The current btInternalEdgeUtility tries to deal with double sided triangles, but that can cause troubles with the heuristic that is used. I'm going to simplify the utility to only work with single sided triangles, that should make it more robust.
The btQuaternion assert is likely a zero-area / degenerate triangle (two vertices are very close or identical). Can you check this?
Thanks,
Erwin
The current btInternalEdgeUtility tries to deal with double sided triangles, but that can cause troubles with the heuristic that is used. I'm going to simplify the utility to only work with single sided triangles, that should make it more robust.
The btQuaternion assert is likely a zero-area / degenerate triangle (two vertices are very close or identical). Can you check this?
Thanks,
Erwin
Re: New btInternalEdgeUtility has been added
i think you are right, i have two scene,a big one,and another simple small one,the small one didn't encounter this problem.Dirk Gregorius wrote:Maybe the quaternion is not a bug. It depends where the axis comes from. You could construct an identity quaternion in this case well, but it depends on the context.
waitting for your single sided mode .Erwin Coumans wrote:Thanks a lot for the reproduction case.
The current btInternalEdgeUtility tries to deal with double sided triangles, but that can cause troubles with the heuristic that is used. I'm going to simplify the utility to only work with single sided triangles, that should make it more robust.
The btQuaternion assert is likely a zero-area / degenerate triangle (two vertices are very close or identical). Can you check this?
Thanks,
Erwin
I have a temporary ignore this problem,the artists making the scene(a very big scene,contain a lot of elements),i have tried ,and found it seems not very easy to find the problem, and i have a lots of work to do , so i abandoned....at least, the release mode is ok....(do not laugh at me lazy )
-
- Posts: 508
- Joined: Fri May 30, 2008 2:51 am
- Location: Ossining, New York
- Contact:
Re: New btInternalEdgeUtility has been added
It'd be good if there was an option to keep the 2-sided behaviour. Has it been established that there is a serious problem in the absence of degenerate triangles? If you have to penetrate the mesh then it could be the same bug as I was reporting with the cylinder spawning slightly within the mesh. So if you do add a single-sided mode I'll test it out too.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: New btInternalEdgeUtility has been added
Can you please provide instructions how to reproduce this cylinder issue? A video doesn't help fixing the issue.sparkprime wrote:It'd be good if there was an option to keep the 2-sided behaviour. Has it been established that there is a serious problem in the absence of degenerate triangles? If you have to penetrate the mesh then it could be the same bug as I was reporting with the cylinder spawning slightly within the mesh. So if you do add a single-sided mode I'll test it out too.
Thanks a lot,
Erwin
-
- Posts: 508
- Joined: Fri May 30, 2008 2:51 am
- Location: Ossining, New York
- Contact:
Re: New btInternalEdgeUtility has been added
I will try but i'm buried at the moment
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: New btInternalEdgeUtility has been added
I improved the btInternalEdgeUtility, hopefully it works better now, in particular for single sided triangle meshes.
edl, can you please test latest trunk with your race track? By default the btAdjustInternalEdgeContacts favors front facing triangles normals. It has some optional settings for BT_TRIANGLE_CONVEX_BACKFACE_MODE.
@sparkprime: it is best to use single sided triangles, consistently front facing or backfacing. There is some experimental support for double sided triangles, enable it using BT_TRIANGLE_CONCAVE_DOUBLE_SIDED+BT_TRIANGLE_CONVEX_DOUBLE_SIDED.
Thanks for the help,
Erwin
edl, can you please test latest trunk with your race track? By default the btAdjustInternalEdgeContacts favors front facing triangles normals. It has some optional settings for BT_TRIANGLE_CONVEX_BACKFACE_MODE.
@sparkprime: it is best to use single sided triangles, consistently front facing or backfacing. There is some experimental support for double sided triangles, enable it using BT_TRIANGLE_CONCAVE_DOUBLE_SIDED+BT_TRIANGLE_CONVEX_DOUBLE_SIDED.
Thanks for the help,
Erwin
Re: New btInternalEdgeUtility has been added
How does one use the utility in Bullet 2.76 ? For now i have to create the data-structure, put the pointer somewhere and do a lookup manually in a collision-callback. Is this supposed to stay that way?
I think either it should work automatically out of the box, or it should simply be a switch on triangle-meshes to enable or disable it (at creation time).
Jan.
I think either it should work automatically out of the box, or it should simply be a switch on triangle-meshes to enable or disable it (at creation time).
Jan.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: New btInternalEdgeUtility has been added
Once the utility has been tested and developers are happy with it, we will do a more tight integration (after 2.76 release later this week)
Have you tried the latest version?
Thanks,
Erwin
Have you tried the latest version?
Thanks,
Erwin
Re: New btInternalEdgeUtility has been added
i have test the latest googleCode svn ver 1945 with my race track ,it seems the new code work well,Erwin Coumans wrote:I improved the btInternalEdgeUtility, hopefully it works better now, in particular for single sided triangle meshes.
edl, can you please test latest trunk with your race track? By default the btAdjustInternalEdgeContacts favors front facing triangles normals. It has some optional settings for BT_TRIANGLE_CONVEX_BACKFACE_MODE.
@sparkprime: it is best to use single sided triangles, consistently front facing or backfacing. There is some experimental support for double sided triangles, enable it using BT_TRIANGLE_CONCAVE_DOUBLE_SIDED+BT_TRIANGLE_CONVEX_DOUBLE_SIDED.
Thanks for the help,
Erwin
thanks for the work! ,if i find problems,i will post it here.
Re: New btInternalEdgeUtility has been added
I found a very minor issue with btInternalEdgeUtility.h. Line 5 reads
But since I set the Bullet source directory as a user path, not a system path, I had to change it to
The quotes appear to be consistent with all other Bullet header #includes.
I'm using SVN revision 1936 of the file.
Code: Select all
#include <LinearMath/btHashMap.h>
Code: Select all
#include "LinearMath/btHashMap.h"
I'm using SVN revision 1936 of the file.
Last edited by Stillmoon on Fri Feb 05, 2010 3:40 pm, edited 1 time in total.
Re: New btInternalEdgeUtility has been added
I found a small issue in the case of degenerate triangles. In this loop numshared could go to 3 and then try to write a value beyond the end of the array:
My modified version looks like this:
As yet untested, but presumably fine.
Code: Select all
for (int i=0;i<3;i++)
{
for (int j=0;j<3;j++)
{
if ( (m_triangleVerticesA[i]-triangle[j]).length2() < m_triangleInfoMap->m_equalVertexThreshold)
{
sharedVertsA[numshared] = i;
sharedVertsB[numshared] = j;
numshared++;
}
}
}
Code: Select all
for (int i=0;i<3;i++)
{
for (int j=0;j<3;j++)
{
if ( (m_triangleVerticesA[i]-triangle[j]).length2() < m_triangleInfoMap->m_equalVertexThreshold)
{
sharedVertsA[numshared] = i;
sharedVertsB[numshared] = j;
numshared++;
if(numshared >= 3)
break;
}
}
if(numshared >= 3)
break;
}
Re: New btInternalEdgeUtility has been added
This is now fixed in the svn trunk, thanks Erwin!Stillmoon wrote:I found a very minor issue with btInternalEdgeUtility.h. Line 5 readsBut since I set the Bullet source directory as a user path, not a system path, I had to change it toCode: Select all
#include <LinearMath/btHashMap.h>
The quotes appear to be consistent with all other Bullet header #includes.Code: Select all
#include "LinearMath/btHashMap.h"
I'm using SVN revision 1936 of the file.