moving weapon model with first person camera?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
boredom

moving weapon model with first person camera?

Post by boredom »

hi,

i'd like to have a weapon model move with the camera - but making it a child of the camera doesn't seem to work, nor does:

Code: Select all

weaponNode->setRotation(camera->getRotation());
weaponNode->setPosition(camera->getPosition());
this does move the weapon, but it lags behind the camera, and doesn't rotate with it. any suggestions? is this a bug?

thanks!
Guest

Post by Guest »

Just use version 0.4.1 and make it a child of it. This was a bug which is fixed since 0.4.1
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Are you using Irrlicht 0.41?

There was a bug in 0.40 that wouldn't allow children to attach to the camera's scene node.

With 0.41, it works again. This is the method that I use to attach a sword and shield.
Crud, how do I do this again?
Guest

Post by Guest »

Sounds GOOD, BUT...

How to compile the new method: setEventReceiver() in 4.1?
Byron

using setEventReceiver

Post by Byron »

To compile with setEventReceiver() I just made myEventReceiver class that extends IEventReceiver have a constructor that does nothing so I can call it like this:

MyEventReceiver *receiver = new MyEventReceiver();
device->setEventReceiver(receiver);

It was a quick fix for me when I want my .04 code to run on .4.2
(also changed creatDevice())
Post Reply