Skip to content

Commit

Permalink
Changes to build with current OSG.
Browse files Browse the repository at this point in the history
Version bump to v3.00.00 (to match osgWorks).
  • Loading branch information
skewmatrix@gmail.com committed Nov 15, 2013
1 parent bd750c5 commit 37c7aed
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ cmake_minimum_required( VERSION 2.8.8 )
project( osgBullet )

# Please keep in sync with Version.h
set( OSGBULLET_VERSION 2.00.02 )
set( OSGBCOLLISION_MAJOR_VERSION 2 )
set( OSGBULLET_VERSION 3.00.00 )
set( OSGBCOLLISION_MAJOR_VERSION 3 )
set( OSGBCOLLISION_MINOR_VERSION 0 )
set( OSGBCOLLISION_SUB_VERSION 2 )
set( OSGBCOLLISION_SUB_VERSION 0 )

set( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" )

Expand Down
7 changes: 6 additions & 1 deletion src/osgbCollision/ComputeShapeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#include <osg/Geode>
#include <osg/Notify>
#include <osgwTools/Transform.h>
#include <osgwTools/ShortEdgeOp.h>
#include <osgwTools/Version.h>
#if( OSGWORKS_OSG_VERSION < 30109 )
# include <osgwTools/ShortEdgeOp.h>
#endif()
#include <osgwTools/ReducerOp.h>
#include <osgwTools/GeometryModifier.h>
#include <osgbCollision/Utils.h>
Expand Down Expand Up @@ -235,6 +238,7 @@ void ComputeShapeVisitor::reduce( osg::Node& node )
seFeature *= _bs.radius() * 2.;

osg::notify( osg::DEBUG_FP ) << "ComputeShapeVisitor: Reducing..." << std::endl;
#if( OSGWORKS_OSG_VERSION < 30109 )
{
osgwTools::ShortEdgeOp* seOp = new osgwTools::ShortEdgeOp( sePercent, seFeature );
seOp->setDoTriStrip( false );
Expand All @@ -244,6 +248,7 @@ void ComputeShapeVisitor::reduce( osg::Node& node )
node.accept( modifier );
modifier.displayStatistics( osg::notify( osg::DEBUG_FP ) );
}
#endif

{
osgwTools::ReducerOp* redOp = new osgwTools::ReducerOp;
Expand Down
11 changes: 10 additions & 1 deletion tests/com/com.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <osgbDynamics/RigidBodyAnimation.h>
#include <btBulletDynamicsCommon.h>

#include <osgwTools/Version.h>

#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgDB/FileUtils>
Expand Down Expand Up @@ -99,15 +101,22 @@ osg::MatrixTransform* createOffOriginOSGBox( osg::Vec3 size )
geom->setVertexArray( v );

osg::Vec3Array * n = new osg::Vec3Array;
n->resize( 6 );
n->resize( 8 );
( *n )[ 0 ] = osg::Vec3( 0, 0, -1 );
( *n )[ 1 ] = osg::Vec3( 0, 0, 1 );
( *n )[ 2 ] = osg::Vec3( -1, 0, 0 );
( *n )[ 3 ] = osg::Vec3( 1, 0, 0 );
( *n )[ 4 ] = osg::Vec3( 0, -1, 0 );
( *n )[ 5 ] = osg::Vec3( 0, 1, 0 );
( *n )[ 6 ] = osg::Vec3( 0, 1, 0 );
( *n )[ 7 ] = osg::Vec3( 0, 1, 0 );
geom->setNormalArray( n );
#if( OSGWORKS_OSG_VERSION < 30109 )
geom->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
#else
// TBD need to fix this for current OSG to render a box properly.
geom->setNormalBinding( osg::Geometry::BIND_PER_VERTEX );
#endif

osg::Vec4Array * c = new osg::Vec4Array;
c->resize( 8 );
Expand Down
11 changes: 10 additions & 1 deletion tests/compound/compound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <osgbDynamics/RigidBodyAnimation.h>
#include <btBulletDynamicsCommon.h>

#include <osgwTools/Version.h>

#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgDB/FileUtils>
Expand Down Expand Up @@ -124,15 +126,22 @@ osg::MatrixTransform * createOffOriginOSGBox( osg::Vec3 size )
geom->setVertexArray( v );

osg::Vec3Array * n = new osg::Vec3Array;
n->resize( 6 );
n->resize( 8 );
( *n )[ 0 ] = osg::Vec3( 0, 0, -1 );
( *n )[ 1 ] = osg::Vec3( 0, 0, 1 );
( *n )[ 2 ] = osg::Vec3( -1, 0, 0 );
( *n )[ 3 ] = osg::Vec3( 1, 0, 0 );
( *n )[ 4 ] = osg::Vec3( 0, -1, 0 );
( *n )[ 5 ] = osg::Vec3( 0, 1, 0 );
( *n )[ 6 ] = osg::Vec3( 0, 1, 0 );
( *n )[ 7 ] = osg::Vec3( 0, 1, 0 );
geom->setNormalArray( n );
#if( OSGWORKS_OSG_VERSION < 30109 )
geom->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
#ekse
// TBD need to fix this for current OSG to render a box properly.
geom->setNormalBinding( osg::Geometry::BIND_PER_VERTEX );
#endif

osg::Vec4Array * c = new osg::Vec4Array;
c->resize( 8 );
Expand Down

0 comments on commit 37c7aed

Please sign in to comment.