Attaching Children to the Camera's Scenenode

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
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Attaching Children to the Camera's Scenenode

Post by saigumi »

I think I'm doing this right and tried a few ways to get the same effect. I should be able to attach children to the Camera, right? Just the same way that you set a node to any other parent scene node?

camera is my camera. :D

Code: Select all

Player.SwordNode = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/sword.ms3d"),camera,-1,irr::core::vector3df(-30.0f,-10.0f,0.0f),irr::core::vector3df(90,35,90),irr::core::vector3df(1.0f,1.0f,1.0f));
The other hack I tried was to move the scenenodes to the camera's position every frame, setPosition worked fine. But this didn't do anything.

Code: Select all

Sword.NodePointer->setRotation(camera->getRotation());
Crud, how do I do this again?
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

Are you trying to for example get a gun to display in front of the camera for a fps or a sword for an rpg?

~~ The Robomaniac
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Yep, attaching the sword + shield.

Figured that I'd slap both on and use animators for the normal joggle during movement and the slashing/blocking. It works the same for the rest of the players that are viewable as I'm attaching the weaponry to their central block scenenode. Though it doesn't set the camera as a parent when I create the node nor when I use setParent.
Crud, how do I do this again?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Hm, seems to be a bug. I'll check this.
Post Reply