MouseWheel move Camera
-
- Posts: 44
- Joined: Tue Nov 17, 2009 9:56 am
- Location: Rus
MouseWheel move Camera
How can I control camera movement (forward-backward) by mouse wheel rotation?
-
- Posts: 44
- Joined: Tue Nov 17, 2009 9:56 am
- Location: Rus
-
- Posts: 44
- Joined: Tue Nov 17, 2009 9:56 am
- Location: Rus
-
- Posts: 44
- Joined: Tue Nov 17, 2009 9:56 am
- Location: Rus
Sorry, I look at it. But I want to see realisation (code) "ICameraSceneNode::OnEvent" for example... and etc. Is it possible? I want to built my own control for camera. But manual seems to me very poor...
Last edited by Morganolla on Tue Nov 17, 2009 7:43 pm, edited 1 time in total.
what they are telling you is that the header file you are looking at only has the definition for the interface. That interface is used as the template for all of the cameras, so you will have to look at the CCameraSceneNode.cpp file to see one method of how the interface was used to create a certain type of camera. There are many different cameras, but they all derive from the interface that you see in ICameraSceneNode.hMorganolla wrote:So, Irrlicht is not fully open source engine? I interesting how realise camera rotation member-functions in this class...
-
- Posts: 44
- Joined: Tue Nov 17, 2009 9:56 am
- Location: Rus
By the way... Excuse, can I see anywhere a complete description (code) member "ICameraSceneNode::OnEvent"... Or it does not exist... all over the world. Or it is closed information?
I want to understand it for my future investigation this engine...
I want to understand it for my future investigation this engine...
Last edited by Morganolla on Tue Nov 17, 2009 7:43 pm, edited 1 time in total.
-
- Posts: 44
- Joined: Tue Nov 17, 2009 9:56 am
- Location: Rus
Work smart, not hard.Morganolla wrote:Thanks, friend, but Russian engineers very much like to get to the bottom of the truth...:)And they are not afraid of a hard work!Reiko wrote:I think you're going about this the hard way mate. Just check out the example I linked you to, and change it or take from it to fit your needs.
- The glory days.
-
- Posts: 15
- Joined: Fri Oct 09, 2009 2:54 pm
Here is a snippet:
Code: Select all
virtual bool OnEvent(const SEvent& event)
{
cam_pos = camera->getPosition();
if(event.EventType == EET_MOUSE_INPUT_EVENT)
{
// Camera Zoom
if(eventp.Event == EMIE_MOUSE_WHEEL)
{
if(cam_pos.getLength() > 100 || cam_pos.getLength() < 600)
{
cam_pos = cam_pos.setLength( cam_pos.getLength() - (eventp.Wheel * 25) );
if(cam_pos.getLength() < 100)
{
cam_pos.setLength(100);
}
if(cam_pos.getLength() > 600)
{
cam_pos.setLength(600);
}
}
camera->setPosition(cam_pos);
}
}
}
"Mission failed: Your team was wiped out."
Nothing is closed. Irrlicht is completely OpenSource. But the headers contain interface classes (starting always with I) which means they usually don't have an implementation but describe how the interface of the implementation classes has to look like. There are also CCameraSceneNode classes which are an implementation of such an interface. Those are in the source folder. And when it comes to scrolling a camera with mouse I usually implement that myself.Morganolla wrote:By the way... Excuse, can I see anywhere a complete description (code) member "ICameraSceneNode::OnEvent"... Or it does not exist... all over the world. :) Or it is closed information?
I want to understand it for my future investigation this engine...:)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm