I've seen that the methods of moving the camera will surely changes in the future...
I've just checked the source code of the FPSCamera and think that is not supported (Any orientation the camera take MouseX is still reference X) and I would have liked to align the mouse coordinate with the UPVector of the camera.
Ordinarily, the way it is now, it's not a problem. But I would like that the camera run on walls and ceilings also.(Would like to do gravity effects like in PREY)
So if an algorythm could be defined to calculate the UPVector of the camera and that the MouseX and MouseY orientation match the view of that vector, it would be great. This would open new possibilities...
At the moment, I can change the view of the camera by changing the UP Vector of it. I've been able to run in my level ceiling, but the mouse is inverted.
Will mouse will align with the view up vector of the camera?
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Could you not hi-jack the mouse events before they go to the camera (i think events go through the user before the camera) and then you can look at the camera's current up vector and fiddle with the mouse event parameters (namely the coordinates i guess, to invert them you'd negate the y value) and then send them on to the camera?
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
In ICameraSceneNode there's a function OnEvent which you can use to send events to a camera. Though it says that some cameras will ignore this information... But the Maya and MeshViewer cameras don't, so i guess the FPS and static cameras do perhaps ignore it.
Always one way to find out! Try it yourself!
Remember to return true after sending the event to the camera so that the 'incorrect' mouse coordinate data isn't sent to the camera as well.
Always one way to find out! Try it yourself!
Remember to return true after sending the event to the camera so that the 'incorrect' mouse coordinate data isn't sent to the camera as well.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Hi, I've checked the source code. I think it's possible to do this.
I think we will be required to create another type of class "IEVENTRECEIVER" to send to the camera.
This class would need to get the current camera UPVERTOR, the standard IEVENTRECEIVER then change the data coming out of the mouse coordinate and send the result appropriately. (So the mouse will be aligned with the camera Z view, rotation is done in X,Y for the FPS Camera). The objective of this class will be to align the mouse coordinates with the upvector of the camera and send the corrected coordinates so the rotation will be aligned with the Camera.
If theory, it could be done. In pratice, I cannot do this because I'm lacking the skill to write such a class. (Need good skills in Math and C++, that I'm laking)
Since I know that it's possible, perhaps one day, my skills will be better and I would be able to write it.
This function will allow the FPS Camera to navigate about any angle. Could be able to have game controls like in PREY. That will remove the limitation we have that the camera MUST be UP so the controls works.
Thanks for your help.
I think we will be required to create another type of class "IEVENTRECEIVER" to send to the camera.
This class would need to get the current camera UPVERTOR, the standard IEVENTRECEIVER then change the data coming out of the mouse coordinate and send the result appropriately. (So the mouse will be aligned with the camera Z view, rotation is done in X,Y for the FPS Camera). The objective of this class will be to align the mouse coordinates with the upvector of the camera and send the corrected coordinates so the rotation will be aligned with the Camera.
If theory, it could be done. In pratice, I cannot do this because I'm lacking the skill to write such a class. (Need good skills in Math and C++, that I'm laking)
Since I know that it's possible, perhaps one day, my skills will be better and I would be able to write it.
This function will allow the FPS Camera to navigate about any angle. Could be able to have game controls like in PREY. That will remove the limitation we have that the camera MUST be UP so the controls works.
Thanks for your help.