Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ogre::Entity* ground = mSceneMgr->createEntity("ground", "Level.mesh");
- Ogre::StaticGeometry *sg = mSceneMgr->createStaticGeometry("Level");
- const int size = 1300;
- sg->setRegionDimensions(Ogre::Vector3(size));
- sg->setOrigin(Ogre::Vector3(-size/2, 0, -size/2));
- sg->addEntity(ground, Ogre::Vector3::ZERO);
- sg->build();
- // Create the collision shape and rigid body of our level.
- hkpBvTreeShape* groundShape = HkOgre::Cooker::processOgreMesh(ground);
- hkpRigidBodyCinfo ci;
- ci.m_shape = groundShape;
- ci.m_motionType = hkpMotion::MOTION_FIXED;
- ci.m_position = hkVector4( 0.0f, 0.0f, 0.0f );
- ci.m_qualityType = HK_COLLIDABLE_QUALITY_FIXED;
- hkpRigidBody* groundBody = new hkpRigidBody(ci);
- mWorld->markForWrite();
- // Add the ground geometry to the physical world.
- mWorld->addEntity(groundBody)->removeReference();
- // Remove the reference to our physical
- // shape because it's unneeded.
- groundShape->removeReference();
- mWorld->unmarkForWrite();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement