Hey i was just wondering if there was any kind of debug render in bepu.
I have written my own at the moment but its buggy and doesnt work on all bepu objects.
Is there any built in that i have missed?
Debug Render?
-
- Posts: 136
- Joined: Sun Jan 17, 2010 11:35 am
Re: Debug Render?
I thought i would just post a image of what it currently looks like and was hopeing to improve on.
And the code that i use to do it.
And here is the code.
I am sure that you can see the issue...
Im not sure if im doing it right but perhaps there is a better way?
.
.
.
And the code that i use to do it.
And here is the code.
Code: Select all
for (int i = 0; i < space.updateables.Count; i++)
{
if (space.updateables[i] is StaticTriangleGroup)
{
TriangleMeshVertex[] temp = ((StaticTriangleGroup)space.updateables[i]).triangleMesh.vertices;
int[] tempIndices = ((StaticTriangleGroup)space.updateables[i]).triangleMesh.indices;
for (int j = 0; j < tempIndices.Length - 1; j += 2)
{
if (j + 1 > g_Constants.GET.MaxDebugLines - 5)
return;
Lines.Add(temp[tempIndices[j]].position, temp[tempIndices[j + 1]].position, new Color(Color.Red,50));
}
}
}
Im not sure if im doing it right but perhaps there is a better way?
.
.
.
Re: Debug Render?
There's a sort-of-debug renderer in the BEPUphysics demos project (source can be downloaded here: http://www.bepu-games.com/BEPUphysics/downloads.htm).
As far as meshes are concerned, all it does is use basic effect to render them with an optional wireframe mode.
As far as meshes are concerned, all it does is use basic effect to render them with an optional wireframe mode.
-
- Posts: 7
- Joined: Sun Mar 08, 2009 12:51 am
Re: Debug Render?
Dan:
Why not use TriangleRenderHelper from the SunBurn Framework? You could submit triangles using the index data and get a near perfect overlay I would think. If your not using SunBurn (you should start) the code will still work with any effect. Actually, the code is somewhere on their website. If your interested I can send you a copy or find it for you.
Why not use TriangleRenderHelper from the SunBurn Framework? You could submit triangles using the index data and get a near perfect overlay I would think. If your not using SunBurn (you should start) the code will still work with any effect. Actually, the code is somewhere on their website. If your interested I can send you a copy or find it for you.