I would like to propose a few updates concerning the intermediate tutorials for Ogre 1.10 while I am following them. I guess it might help future newbies like me
The report page issue link on the tutorials tells me I do not have any rights so I start posting everything here.
Please do not hesitate to tell me if my updates are not correct.
INTRODUCTION
1 Mouse events
In the provided code (BasicApp.cpp), the methods concerning mouse movements must be updated. For example in BasicApp::MouseMoved(const OIS::MouseEvent& me):
Code: Select all
mCameraMan->injectMouseMove(me);Code: Select all
mCameraMan->injectPointerMove(me);As OIS implementation seems to have changed through time, a quick modification is required on the Samples/includes/SdkCameraMan.h. I already proposed a solution through a merge request, in case it is not accepted (or not prioritized, no offense) the solution is here http://www.ogre3d.org/forums/viewtopic.php?f=2&t=85807
2 Headers
To compile, BasicApp.cpp also requires the following includes:
Code: Select all
#include <OgreLogManager.h>
#include <OgreTextureManager.h>In BasicApp.ccp, the two occurences of Ogre::StringUtil::BLANK (constructor) must be replaced by Ogre::BLANKSTRING.
INTERMEDIATE TUTORIAL 1
nextLocation() methods is missing. I am not sure yet (since I did not finish all the tutorials yet) if it should be put in the code provided in the introduction or only in this tutorial.
My personnal solution was to add in the private section of the header:
Code: Select all
bool nextLocation();Code: Select all
bool BasicApp::nextLocation()
{
return true;
}INTERMEDIATE TUTORIAL 2
1 Headers
When inserting the code relative to terrain, headers should be updated from:
Code: Select all
#include <OgreTerrain.h>
#include <OgreTerrainGroup.h>Code: Select all
#include <Terrain/OgreTerrain.h>
#include <Terrain/OgreTerrainGroup.h>Code: Select all
CEGUI::MouseCursor::getSingleton().hide();Code: Select all
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().hide();3 Ray casting/selecting terrain target
We are asked to insert these 2 lines in the mousePressed method:
Code: Select all
CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
CEGUI::Vector2f mousePos = context.getMouseCursor().getPosition();Code: Select all
CEGUI::Vector2f mousePos = context.getMouseCursor().getPosition();4 Moving robots before releasing mouse button
The tutorial states that we should be able to move the robot between mousePressed and mouseReleased.
To do so, this following code must be added in the mouseMove method in the portion corresponding to mLMouseDown:
Code: Select all
CEGUI::Vector2f mousePos = context.getMouseCursor().getPosition();
Ogre::Ray mouseRay =
mCamera->getCameraToViewportRay(
mousePos.d_x / float(me.state.width),
mousePos.d_y / float(me.state.height));
Ogre::TerrainGroup::RayResult result = mTerrainGroup->rayIntersects(mouseRay);
if (result.terrain)
{
mCurObject->setPosition(result.position);
}1 Ninjas!
The last code modification contains a syntax mistake:
Code: Select all
if (mRobotMode)Code: Select all
if (bRobotMode)Another syntax mistake, when ray casting:
Code: Select all
Ogre::RaySceneQueryResult& result = mRaySceneQuery->execute();Code: Select all
Ogre::RaySceneQueryResult& result = mRayScnQuery->execute();Code: Select all
mRayScnQuery = mSceneMgr->createRayQuery(Ogre::Ray());Another syntax mistake:
Code: Select all
mRayScnQuery->setQueryMask(mRobotMode ? ROBOT_MODE : NINJA_MASK);Code: Select all
mRayScnQuery->setQueryMask(mRobotMode ? ROBOT_MASK : NINJA_MASK);1 SelectionBox class
The following header is required:
Code: Select all
#include <OgreRenderQueue.h>Code: Select all
clear();
begin("Examples/KnotTexture", Ogre::RenderOperation::OT_LINE_STRIP);
position(left, top, -1);
position(right, top, -1);
position(left, bottom, -1);
position(left, top, -1);
end();Code: Select all
clear();
begin("Examples/KnotTexture", Ogre::RenderOperation::OT_LINE_STRIP);
position(left, top, -1);
position(right, top, -1);
position(right, bottom, -1);
position(left, bottom, -1);
position(left, top, -1);
end();The following member must be added in BasicApp.h
Code: Select all
Ogre::PlaneBoundedVolumeListSceneQuery* mVolQuery;3 BoxSelection is Volume Selection
In the header, must be added:
Code: Select all
bool mSelecting;
Ogre::Vector2 mStart, mStop;
Code: Select all
mSelecting(false),
Code: Select all
mStart.x = mouse->getPosition().d_x / (float)arg.state.width;
mStart.y = mouse->getPosition().d_y / (float)arg.state.height;Code: Select all
mStart.x = mouse->getPosition().d_x / (float)me.state.width;
mStart.y = mouse->getPosition().d_y / (float)me.state.height;Code: Select all
performSelection(mStart, mStop)4 PlaneBoundedVolumeListSceneQuery
The header must be completed with
Code: Select all
void performSelection(const Ogre::Vector2& first, const Ogre::Vector2& second);
void deselectObjects();
void selectObject(Ogre::MovableObject* obj);
static void swap(float& x, float& y);
std::list<Ogre::MovableObject*> mSelected;
Ogre::RaySceneQuery* mRayScnQuery;
Code: Select all
performSelection(mStart, mStop)Code: Select all
mVolQuery->setVolume(volList);Code: Select all
mVolQuery->setVolumes(volList);Code: Select all
selectObject(*iter);Code: Select all
selectObject(*it);In the header, the followings should be added:
Code: Select all
#include <OgreMeshManager.h>
#include <OgreManualObject.h>
#include <OgreStaticGeometry.h>Code: Select all
void createGrassMesh();Best,
Pierre