Beispiel #1
0
int main(void)
{
    mem_man_t *global_manager;
    void *p;

    if (pretest() != 0)
    {
        DPRINTF("pretest error\n");
        return 1;
    }


    init_mem_man(&global_manager);
    p = lockfree_alloc(global_manager, FIRST_BLOCK_SIZE);
    DPRINTF("alloc ret->%p\n", p);
    DPRINTF("desc in new block->0X%llX\n", (u64)*((desc_t **)p - 1));

    p = lockfree_alloc(global_manager, FIRST_BLOCK_SIZE);
    if (NULL != p)
    {
        DPRINTF("alloc ret->%p\n", p);
        DPRINTF("desc in new block->0X%llX\n", (u64)*((desc_t **)p - 1));
    }
    else
    {
        DPRINTF("ALLOC FAIL\n");
    }


    return 0;
}
Beispiel #2
0
void
testScaleSphere()
{
    pretest( sphere );

    osg::Vec3 scale( 3., 3., 3. );
    osg::notify( osg::ALWAYS ) << "  Scaling by: " << scale << std::endl;
    osg::Matrix m( osg::Matrix::scale( scale ) );
    osg::BoundingSphere newSphere = osgwTools::transform( m, sphere );

    posttest( newSphere );
}
Beispiel #3
0
void
testScaleBox()
{
    pretest( box );

    osg::Vec3 scale( 3., 3., 3. );
    osg::notify( osg::ALWAYS ) << "  Scaling by: " << scale << std::endl;
    osg::Matrix m( osg::Matrix::scale( scale ) );
    osg::BoundingBox newBox = osgwTools::transform( m, box );

    posttest( newBox );
}
Beispiel #4
0
void
testRotateBox()
{
    pretest( box );

    float degrees( 45.f );
    osg::Vec3 axis( 1., 0., 0. );
    osg::notify( osg::ALWAYS ) << "  Rotating " << degrees << " degrees around: " << axis << std::endl;
    osg::Matrix m( osg::Matrix::rotate( osg::DegreesToRadians( degrees ), axis ) );
    osg::BoundingBox newBox = osgwTools::transform( m, box );

    posttest( newBox );
}
Beispiel #5
0
void
testScaleRotateSphere()
{
    pretest( sphere );

    osg::Vec3 scale( 2., 2., 2. );
    float degrees( 45.f );
    osg::Vec3 axis( 1., 0., 0. );
    osg::notify( osg::ALWAYS ) << "  Scaling by: " << scale << std::endl;
    osg::notify( osg::ALWAYS ) << "  Rotating " << degrees << " degrees around: " << axis << std::endl;
    osg::Matrix m( osg::Matrix::scale( scale ) * osg::Matrix::rotate( osg::DegreesToRadians( degrees ), axis ) );
    osg::BoundingSphere newSphere = osgwTools::transform( m, sphere );

    posttest( newSphere );
}
Beispiel #6
0
void
testScaleTranslateSphere()
{
    pretest( sphere );

    osg::Vec3 scale( 2., 2., 2. );
    osg::Vec3 trans( 0., -5., 0. );
    osg::notify( osg::ALWAYS ) << "  Scaling by: " << scale << std::endl;
    osg::notify( osg::ALWAYS ) << "  Translating by: " << trans << std::endl;
    osg::notify( osg::ALWAYS ) << "  Order: result = input * scale * trans" << std::endl;
    osg::Matrix m( osg::Matrix::scale( scale ) * osg::Matrix::translate( trans ) );
    osg::BoundingSphere newSphere = osgwTools::transform( m, sphere );

    posttest( newSphere );
}