コード例 #1
0
void DebugRenderer::drawContactPoint( const osg::Vec3& pointOnB,
    const osg::Vec3& normalOnB, float distance, 
    int lifeTime, const osg::Vec3& color)
{
    if( !getEnabled() )
        return;

    if( !_active )
    {
        osg::notify( osg::WARN ) << "DebugRenderer: BeginDraw was not called." << std::endl;
        return;
    }

    _contacts++;

    _ptVerts->push_back( pointOnB /*osgbCollision::asOsgVec3( pointOnB )*/ );
    _ptColors->push_back( osg::Vec4( color, 1.) /*osgbCollision::asOsgVec4( color, 1. )*/ );

    /*btVector3*/osg::Vec3 to=pointOnB+normalOnB*distance;
    const /*btVector3*/osg::Vec3 &from = pointOnB;

    drawLine( from, to, color );

    char buf[12];
    sprintf(buf," %d",lifeTime);

    draw3dText( from, buf );
}
コード例 #2
0
ファイル: gldebugdrawer.cpp プロジェクト: brownman/4wd
void GLDebugDrawer::drawContactPoint( const btVector3& pointOnB,
    const btVector3& normalOnB, btScalar distance,
    int lifeTime, const btVector3& color) {
    if( !getEnabled() )
        return;

    if( !_active ) {
        osg::notify( osg::WARN ) << "GLDebugDrawer: BeginDraw was not called." << std::endl;
        return;
    }

    _contacts++;

    _ptVerts->push_back( asOsgVec3( pointOnB ) );
    _ptColors->push_back( asOsgVec4( color, 1. ) );

    btVector3 to=pointOnB+normalOnB*distance;
    const btVector3&from = pointOnB;

    drawLine( from, to, color );

    char buf[12];
    sprintf(buf," %d",lifeTime);

    draw3dText( from, buf );
}