i'm aware that it's possible to use the visualdebugger to visualize physics object and custom data i have in the scene
but it it possible to get a set of polygons ,lines that i can visualize in my own Game Editor? if so how?
Hi Ahmed,Disclaimer: I haven't tried this, but I think it'll work. Famous last words If you take a look in RaycastAgainstProxyDemo.cpp, there's a bit of code that looks like this: hkArray geom; hkpShapeDisplayBuilder::hkpShapeDisplayBuilderEnvironment env; hkpShapeDisplayBuilder builder(env); builder.buildShapeDisplay(m_pf->getShape(), m_pf->getTransform(), geom);If you do that (substituting your own shape for "m_pf->getShape()" , and probably hkTransform::getIdentity() for "m_pf->getTransform()" ), you can iterate through geom array and either call hkGeometry* mesh = geom[i].getGeometry();if you want triangles, or hkArray lines; geom[i]->getWireframeGeometry(lines);to get the lines. These should be the same representations that the VDB displays. BTW, You've got the headers for hkGeometry, hkDisplayGeometry, and hkpShapeDisplayBuilder, but no source.Hope that helps. If you run into problems, I'll try actually compiling it tomorrow -Chris
I was never able to figure out how to get debug geometry out of Havok. I finally gave up and now use an alternative way.
I wanted to see exactly howgame bounding boxes lined up to the Havok shapes, so I draw the lines in the game, then send those same lines to the Havok debugger via:
It met my needs and I no longer care about trying to export geometry.
I think maybe you missed a geom[i]->buildGeometry() before hkGeometry* mesh = geom[i].getGeometry();I wrote code like you wrote...the mesh always is empty or null.After I read hkDisplaySphere.cpp, I tried adding a buildGeometry() calling before getGeometry(). Now, the mesh returned by getGeometry() has data.
It turns out that the wireframe geometry is not available for some hkpEntity classes (or maybe shapes, I haven't done an exhaustive investigation). For example, a character proxy using a capsule phantom won't give me wireframe data (but with the above call to buildGeometry() it will at least make the mesh). From that I could make my own wireframe (probably not the optimal wireframe but it's debug geometry, after all...)
FYI for those who may have been wondering. ;)