xiangaodielian / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

btCollisionWorld::debugDrawObject() never calls getDebugDrawer()->drawBox() #622

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce the problem:
1. Create a world
2. Add a box collision shape into the world
3. Enable debug drawing
4. Setup a break point (or add a log message) in the function 
btCollisionWorld::debugDrawObject in case block BOX_SHAPE_PROXYTYPE (line 1290)
5. Run the test
6. Notice that the execution never gets into the mentioned case block 
BOX_SHAPE_PROXYTYPE

What is the expected output? What do you see instead?
I might be mistaken, but I expected the function drawBox of btIDebugDraw to be 
called to draw a box collision shape. Instead a box collision shape is 
classified as a Polyhedral and gets drawn line by line. Check out a code 
branching scheme of the function btCollisionWorld::debugDrawObject: 

if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE)
{
    // draw each shape
}
else
{
    if (shape->isPolyhedral())
    {
        ...
        // draw the shape edge by edge
        // IT ALWAYS GETS HERE FOR A BOX SHAPE    <-----------------------
    }
    else
    {
        switch (shape->getShapeType())
        {
            case BOX_SHAPE_PROXYTYPE:
            {
                // INSTEAD OF GETTING HERE    <----------------------------
                ...
                break;
            }

            ...
        }
    }
}

What version of the product are you using? On what operating system?
bullet-2.80-rev2531, Windows 7

Please provide any additional information below.
Thank you for the great engine, Erwin! If you need more details feel free to 
contact me.

Original issue reported on code.google.com by gonzales...@gmail.com on 30 Apr 2012 at 3:18

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2564.

Original comment by erwin.coumans on 9 Sep 2012 at 10:08