I'm stuck on this one error that I can't seem to find on the forums. Do you think you can help me?
I'm running the full source from the second half of the "Humble Beginnnings" tutorial. I went through and fixed all the yaw and rotate errors (thanks forums!
Code: Select all
error C2440: '=' : cannot convert from 'class Ogre::Node *' to 'class Ogre::SceneNode *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.Code: Select all
mRotatingNode = mCentralNode->createChild();Code: Select all
class SpaceCameraRotator : public ExampleFrameListener
{
protected:
Camera* mCamera;
SceneNode* mCentralNode;
SceneNode* mRotatingNode;
Vector3 mRotationAxis;
Real mRotationSpeed;
public:
SpaceCameraRotator(RenderWindow* win, Camera* cam, SceneNode* centralNode, Vector3 initialPosition) : ExampleFrameListener(win, cam)
{
mCamera = cam;
mCentralNode = centralNode;
mRotationAxis = Vector3::UNIT_Y;
mRotationSpeed = 60.0;
// Create a node to act as the central rotation point
mRotatingNode = mCentralNode->createChild();
mRotatingNode->attachObject(mCamera);//this line right,tutorial wrong
mCamera->moveRelative(initialPosition);
mCamera->lookAt(0, 0, 0);
}
~SpaceCameraRotator()
{
delete mRotatingNode;
}
bool frameStarted(const FrameEvent& evt)
{
// Copy the current state of the input devices
mInputDevice->capture();
if(mInputDevice->isKeyDown(Ogre::KC_SPACE))
mRotatingNode->rotate(mRotationAxis, Degree(mRotationSpeed * evt.timeSinceLastFrame)); //tutorial wrong, this is right
return true;
}
};