I have a working 3rd person camera (or so at least). The camera is the child of the player's node and it is behind the player's node. I can already move it using the mouse and shooting using mouse click. (the bullet ran from the player's node toward where the player's looking, I don't have any weapon model right now)
what I want to ask is:
1.) When I hold down the mouse click (left mouse button), it only shot once but when I hold down the 'H' key (I wrote it for testing) the player keeps firing the gun without any delay (just like a machine gun).
How can this happen? what is the difference between mouse input and keyboard input? I want the mouse input shooting to behave just like the keyboard input shooting. (I'm using EMIE_BUTTON_DOWN or something like that, I'm not at home and I don't have my code with me)
2.)I wrote my camera using addCameraSceneNode(); and am able to make it looks towards where to mouse pointer is. (just like the addCameraSceneNodeFPS(); mine just more flexible to what I need) but when I looked up, up, and up until I faced the spot right above the player's node, and then looked up again, the camera suddenly 'jumps' to the player's feet (or foot, I don't know the difference).
How can this happen? I realize at addCameraSceneNodeFPS(); you can't look more up than the spot right above you or the spot right below you (the camera node),how does it does this?
I think that's about it, I hope my English is right and you guys can understand me.
thanks in advance, any help is appreciated
Some questions about the camera and mouse
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: Some questions about the camera and mouse
Your OS will generate repeated key down events while you are holding a key down. It won't do that for mouse events.Daggio wrote:How can this happen? what is the difference between mouse input and keyboard input?
What you'll want to do is to operate on the input state rather than directly on input events. See the event receiver in example 04.Movement/main.cpp; you'll want something similar, that also stores the state of mouse buttons.
I dunno, let's look at the source.Daggio wrote:I realize at addCameraSceneNodeFPS(); you can't look more up than the spot right above you or the spot right below you (the camera node),how does it does this?
source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp
Code: Select all
if (relativeRotation.X > MaxVerticalAngle*2 &&
relativeRotation.X < 360.0f-MaxVerticalAngle)
{
relativeRotation.X = 360.0f-MaxVerticalAngle;
}
else
if (relativeRotation.X > MaxVerticalAngle &&
relativeRotation.X < 360.0f-MaxVerticalAngle)
{
relativeRotation.X = MaxVerticalAngle;
}
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way