[fixed]Maya camera as child of moving node

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

The patch gives you the lines to change. Add every line marked with a '+' at the start and remove every line marked with a '-' (none in this patch). All other lines are just there to help you find the right place.

Instead of changing the engine you can also copy those files and use them as a start for your own animator. Rename the class, rename the file and then add it to your project. Then you can create it with new and add the animator to a normal camera. (I've not tested this yet myself, but it should work). This is a little more work, but the better solution as patching the engine will turn out to be more work in the long run.

This patch might make it in Irrlicht - lets see what others think of it.

I'm not really sure what setParent would do - it just makes not much sense for this animator. The animators work is about setting the position based on the target. So anything which further influences the position will most likely only cause trouble for it.

Also I have the slight suspicion that would you are looking for might be a 3rd-person-cam. If that's the case - just search the forum, I'm sure you will find some implementations for that.
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
someguy99
Posts: 38
Joined: Sun Oct 11, 2009 11:20 am

Post by someguy99 »

CuteAlien wrote:The patch gives you the lines to change. Add every line marked with a '+' at the start and remove every line marked with a '-' (none in this patch). All other lines are just there to help you find the right place.

Instead of changing the engine you can also copy those files and use them as a start for your own animator.Rename the class, rename the file and then add it to your project.
So everything is in these 2 files?

This patch might make it in Irrlicht - lets see what others think of it.
I dont see why not. Why have limited cameras and tell everyone to build their own?


Also I have the slight suspicion that would you are looking for might be a 3rd-person-cam. If that's the case - just search the forum, I'm sure you will find some implementations for that.
Well not really. Depends on what you mean by that.
I just want an orbiting camera to follow my character around. Most 3rdp cameras always look at your players back.
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

someguy99 wrote:
CuteAlien wrote:The patch gives you the lines to change. Add every line marked with a '+' at the start and remove every line marked with a '-' (none in this patch). All other lines are just there to help you find the right place.

Instead of changing the engine you can also copy those files and use them as a start for your own animator.Rename the class, rename the file and then add it to your project.
So everything is in these 2 files?
Yes, for a start.
someguy99 wrote:
CuteAlien wrote: This patch might make it in Irrlicht - lets see what others think of it.
I dont see why not. Why have limited cameras and tell everyone to build their own?
Because I've only had time for running a short test so far with example 09. I don't know yet if it will cause any troubles because I don't know enough about how that camera is supposed to work.
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
someguy99
Posts: 38
Joined: Sun Oct 11, 2009 11:20 am

Post by someguy99 »

Code: Select all

 	{
 		OldTarget = camera->getTarget();
 		OldCamera = camera;
+		LastCameraTarget = OldTarget;
 	}
+	else
+	{
+		OldTarget += camera->getTarget() - LastCameraTarget; // translation is still lost
+	}
 
 	core::vector3df target = camera->getTarget();
 
Im guessing you wrote the lines without + to help me find where i should put the ones with + ? I searched CSceneNodeAnimatorCameraMaya.cpp but couldnt find lines like those.
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

someguy99 wrote: Im guessing you wrote the lines without + to help me find where i should put the ones with + ? I searched CSceneNodeAnimatorCameraMaya.cpp but couldnt find lines like those.
Actually I didn't do it myself, but this is the format automatically generated when creating patches. And the first line in this format even gives you the line-number where to search. I can't help you more for that... the lines are there as well in 1.6 as in trunk.
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
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I've added it now to the svn trunk. Unless it causes any troubles it will be in Irrlicht 1.7.
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
Post Reply