caifie
12-04-2010 06:42:10
hi, every one!
i'm using the ogre1.7 and newton 2.18, and i have download the ogrenewt2.0 from the svn, and combiled it writly, and have the ogrenewt_d.lib.
the problem is that, it will shut down when i using it in ogre1.7.
my code is below, combile well but run wrong.
when i run, it will shutdown and die at the line,
and the error text:
ps: i have built the newton world and include the required head files.
does anyone kown this? tell me how to do.
thanks!
i'm using the ogre1.7 and newton 2.18, and i have download the ogrenewt2.0 from the svn, and combiled it writly, and have the ogrenewt_d.lib.
the problem is that, it will shut down when i using it in ogre1.7.
my code is below, combile well but run wrong.
Ogre::Vector3 size(10.0,1.0,10.0);
Ogre::SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
Ogre::Entity* ent = mSceneMgr->createEntity( "floorobj", "box.mesh" );
node->attachObject( ent );
node->setScale( size );
OgreNewt::CollisionPtr col( new OgreNewt::CollisionPrimitives::TreeCollision( m_World, ent, true, 0));
OgreNewt::Body* floorbody = new OgreNewt::Body( m_World, col );
floorbody->attachNode(node);
floorbody->setPositionOrientation( Ogre::Vector3(0,-5,0), Ogre::Quaternion::IDENTITY );
// BOX
size = Ogre::Vector3( 10, 10, 10 );
node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
ent = mSceneMgr->createEntity("box_body", "box.mesh" );
node->attachObject( ent );
node->setScale( size );
// rigid body.
OgreNewt::CollisionPrimitives::Box *boxcol = new OgreNewt::CollisionPrimitives::Box(m_World, size, 0);
col = OgreNewt::CollisionPtr(boxcol);
OgreNewt::Body* bod = new OgreNewt::Body( m_World, col );
bod->attachNode( node );
// initial position
bod->setPositionOrientation( Ogre::Vector3(-2,20,2), Ogre::Quaternion::IDENTITY );
Ogre::Real mass = 10.0;
Ogre::Vector3 inertia, centerOfMass;
boxcol->calculateInertialMatrix(inertia, centerOfMass);
inertia*=mass;
bod->setMassMatrix( mass, inertia );
bod->setCenterOfMass(centerOfMass);
bod->setStandardForceCallback();
when i run, it will shutdown and die at the line,
OgreNewt::CollisionPrimitives::Box *boxcol = new OgreNewt::CollisionPrimitives::Box(m_World, size, 0);
and the error text:
Unhandled exception at 0xC0000005 in test_ogrenewt.exe:0x00c31400: Access violation reading location 0x3f800000
Unhandled exception at 0xC0000005 in test_ogrenewt.exe:0x00c31400: Access violation reading location 0x3f800000
ps: i have built the newton world and include the required head files.
does anyone kown this? tell me how to do.
thanks!