Bones with skin

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
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Bones with skin

Post by wyrmmage »

First off, sorry for posting two questions so close to each other....I'm pretty sure that this question has nothing to do with my other one, though :P

I have a .b3d model that uses bones and has cubes for the skin. Currently I have one cube for each bone, and everything is working out fine :) Unfortunately, it appears that for a bone to be recognized by Irrlicht, it must have a piece of skin attached to it; even then, the bone itself is not accessible through a call to getJointNode(), only the skin. Since I'm planning on having quite a few different characters with large height differences/bone structures, I would like to define a place in my model where I can attach a camera and have it follow the parent bone's rotation/scale/etc. Actually, I'd like to have two or three different places to attach cameras. I was going to try making three different bones named FPSCameraBone, OverheadCameraBone, and FollowCameraBone, but since the bones are not recorded (since they do not have skin), then I'm rather in a bind.

Giving a bone an empty node as a child (in Blender, not in Irrlicht) seems to have no effect - the bone is still discarded and the empty child node is discarded as well :(
Any ideas on how I should go about implementing this?

Thanks :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

You can pass around this problem probably by simply modeling some geometry to that joint, set it to have its own material so it loads as meshbuffer then remove it manually in Irrlicht. But I was not trying that myself so its only idea.

Bye the way, if joints without geometry are really discarded in loader it would be good candidate for "feature request" ...or "bug report". Some chance is however that it is not Irrlicht loader which discards them but your exporter which optimize your data while writing file and discards empty joints.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

empty structures are also often discarded in the loaders, because of possible performance problems due to countless invisible stuff. But you're right, it's a good candidate for a parameter making this changeable.
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

thanks everyone, I'll have to try the idea that arras suggested, since it should be relatively simple to do. An option in the loader would definitely be cool as well :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

having a quick look though the code, I cannot see anywhere that empty bones are removed. I don't think I did that for your reason.

so you might want to check that your exporter is not removing them.


hmm, btw if no bones have skin attached, and you have no animation, your mesh is not marked as animated, this may cause problems, but shouldn't.
the bone itself is not accessible through a call to getJointNode(), only the skin
don't get what you mean here, you can only access the bone.
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

Luke wrote:don't get what you mean here, you can only access the bone.
I'll have to check my exporter later to make sure it's not removing empty bones.

Perhaps I'm not truly "skinning" the bone? All I'm doing is have a bone with a child polygon attached. If I have a bone called chestBone and a cube as a child object to the chestBone called chest then if I call getJointNode("chestBone"), it returns NULL; if I call getJointNode("chest"), it returns the address to the node. Perhaps the getJointNode() call is returning the value of the bone that the skin is attached to, but it seems odd that calling getJointNode() with the name of a bone would return nothing :\

-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
Post Reply