nah luvcraft, that isnt it....
I think it has something to do with the createDevice call
Homer wrote:AssiDragon wrote:On a sidenote, I broke the camera into camera.cpp, main.cpp and main.h files so it's relatively easy to put it into other stuffs if someone needs it - camera is now being handled by two functions, depending what you want.
Great! Can you please upload these files? I have some problems with my 3rd person camera, so I would be very happy if I could try your code.
[/quote]awesome! thanks for the tip AssiDragon! And the md2 framelist But i can't seem to get X axis rotation working (up/down), it's probably because the cam functions control the cam before the mouse controls kicks in eh?
// Z ROTATION (UP & DOWN) - CAMERA SHOULD ROTATE NOT CHARACTER ON Z AXIS
if ((previousMousePosition.Y < device->getCursorControl()->getPosition().Y)
||
(previousMousePosition.Y > device->getCursorControl()->getPosition().Y))
{
mainCam_rotate += device->getCursorControl()->getPosition().Y - previousMousePosition.Y;
cam->setRotation(core::vector3df(0,0,mainCam_rotate));
}
camera->setRotation(core::vector3df(0,0,mainCam_rotate));
bool playerisrunning;
bool playerisstanding;
class MyEventReceiver : public IEventReceiver
{
..............
.............
if(k)
{
if(event.KeyInput.PressedDown)
{
controls |= k;
if(!playerisrunning)
{
p1->setFrameLoop(320, 360);
playerisrunning = true;
playerisstanding = false;
}
}
else
{
controls ^= k;
if(!controls & C_UP + C_DOWN +C_LEFT + C_RIGHT)
if(!playerisstanding)
{
//p1->setFrameLoop(0, 79*8);
p1->setMD2Animation(irr::scene::EMAT_STAND);
playerisstanding = true;
playerisrunning =false;
}
}
return true;
}
.................
.................
}float CamOffSetH = 50f;
float Height = 30f;
// Z ROTATION (UP & DOWN) - CAMERA SHOULD ROTATE NOT CHARACTER ON Z AXIS
if ((previousMousePosition.Y < device->getCursorControl()->getPosition().Y)
||
(previousMousePosition.Y > device->getCursorControl()->getPosition().Y))
{
CamOffSetH = device->getCursorControl()->getPosition().Y - previousMousePosition.Y;
}
Return to FAQs, Tutorials, Howtos, and external tool lists
Users browsing this forum: No registered users and 1 guest