// Just override the mandatory create scene method void OgreSample::setupContent(void) { mTrayMgr->hideLogo(); //m_pSim = new VTFWSimulation(mSceneMgr, mCamera, mWindow, mViewport); Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, mInfo["Title"]); Ogre::Camera* cam = mgr->createCamera(mInfo["Title"] + "Camera"); mWindow->removeAllViewports(); mWindow->addViewport(cam); m_pSim = new StableFluids(mgr, cam); //m_pSim = new WaterSimulation(mSceneMgr, mCamera); m_pSim->init(); setupControls(); setDragLook(true); }
void PlayPen_testCameraSetDirection::setupContent() { mSceneMgr->setAmbientLight(ColourValue::White); Entity* e = mSceneMgr->createEntity("1", "knot.mesh"); mSceneMgr->getRootSceneNode()->createChildSceneNode(mFocus)->attachObject(e); mCamera->setPosition(200,1000,1000); mCamera->lookAt(mFocus); mTrayMgr->createButton(OgreBites::TL_BOTTOM, "Look At", "Look At"); mTrayMgr->createCheckBox(OgreBites::TL_BOTTOM, "tglParent", "Use Parent Node"); OgreBites::CheckBox* chk = mTrayMgr->createCheckBox(OgreBites::TL_BOTTOM, "tglFixedYaw", "Use Fixed Yaw"); chk->setChecked(true, false); mTrayMgr->showCursor(); setDragLook(true); mParentNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(1000, 2000, -1000)); }
void Sample_VolumeTex::setupContent() { // Create dynamic texture ptex = TextureManager::getSingleton().createManual( "DynaTex","General", TEX_TYPE_3D, 64, 64, 64, 0, PF_A8R8G8B8); // Set ambient light mSceneMgr->setAmbientLight(ColourValue(0.6, 0.6, 0.6)); mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox", 50 ); //mRoot->getRenderSystem()->clearFrameBuffer(FBT_COLOUR, ColourValue(255,255,255,0)); // Create a light Light* l = mSceneMgr->createLight("MainLight"); l->setDiffuseColour(0.75, 0.75, 0.80); l->setSpecularColour(0.9, 0.9, 1); l->setPosition(-100,80,50); mSceneMgr->getRootSceneNode()->attachObject(l); // Create volume renderable snode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,0,0)); vrend = new VolumeRenderable(32, 750.0f, "DynaTex"); snode->attachObject( vrend ); trend = new ThingRenderable(90.0f, 32, 7.5f); trend->setMaterial("Examples/VTDarkStuff"); snode->attachObject(trend); // Ogre head node fnode = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,0,0)); // Load ogre head Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh"); fnode->attachObject(head); // Animation for ogre head // Create a track for the light Animation* anim = mSceneMgr->createAnimation("OgreTrack", 10); // Spline it for nice curves anim->setInterpolationMode(Animation::IM_SPLINE); // Create a track to animate the camera's node NodeAnimationTrack* track = anim->createNodeTrack(0, fnode); // Setup keyframes TransformKeyFrame* key = track->createNodeKeyFrame(0); // A startposition key->setTranslate(Vector3(0.0f, -15.0f, 0.0f)); key = track->createNodeKeyFrame(5);//B key->setTranslate(Vector3(0.0f, 15.0f, 0.0f)); key = track->createNodeKeyFrame(10);//C key->setTranslate(Vector3(0.0f, -15.0f, 0.0f)); // Create a new animation state to track this mOgreAnimState = mSceneMgr->createAnimationState("OgreTrack"); mOgreAnimState->setEnabled(true); //mFountainNode->attachObject(pSys2); //Setup defaults global_real = 0.4f; global_imag = 0.6f; global_theta = 0.0f; // show GUI createControls(); setDragLook(true); generate(); }