Game Development Community

Need C++ Programmer - Hiding Model Parts

by Kiyaku · in Torque Game Engine Advanced · 09/23/2008 (2:22 pm) · 8 replies

Hi guys,
i found this resource Resource

It would be really helpful for my game and save lot of work. Though the code doesn't work with the current TGEA 1.7.1.

So i ask you C++ guys if someone could look into this and rewrite it for the newer version, i would also pay for this!


Thanks so much in advance, i hope someone can do that.

#1
09/23/2008 (2:59 pm)
Hi Kiyaku,

There is a follow up resource here. I can't remember if I needed to change anything to get it to work but I have that working in TGEA 1.7.1 perfectly.

If I get a chance later I'll scan through my code and see if I had to change anything.
#2
09/23/2008 (3:19 pm)
Actually - no time like the present... I should be working but I've been in the office for 16 1/2 hours already today and could do with a break :o)

Just glanced over the code and there were a couple of changes:

in shapeBase.cpp:

void ShapeBase::updateHiddenMeshes()

change
S32 nodeIndex = mShapeInstance->mMeshObjects[x].object->nodeIndex;
to
S32 nameIndex = mShapeInstance->mMeshObjects[x].object->nameIndex;

change
if(isHiddenMesh(nodeIndex))
to
if(isHiddenMesh(nameIndex))


void ShapeBase::SkinOffList()
remove
if (mShapeInstance->getShape()->objects[i].nodeIndex<0) // must be a skin
and the corresponding braces


void ShapeBase::SkinOnList()
remove
if (mShapeInstance->getShape()->objects[i].nodeIndex<0) // must be a skin
and the corresponding braces


Works fine for me with those changes - I suspect (because I'm really no good at c++ yet!) that those changes are from the resource comments.

Good luck!
#3
09/23/2008 (4:27 pm)
Thanks a lot, it works for me almost as well with your code manipulation!

I just have the problem that some parts are not hide-able. I have following modelgroups:

- hat
- head
- body
- legs
- shoes


Both Hat and Head are not able to hide. Body, legs and shoes does hide perfectly.

Any idea why i cant hide the other parts? Does it depend on the joints somehow?
#4
09/23/2008 (5:58 pm)
Hmmm. That is strange. To be honest I don't know. It's almost certainly on the art side rather than the code side (otherwise it'd be all or nothing, right?).

And that's where I come unstuck as I just get the model and a list of meshes from our art guys... Sorry - maybe if there's a 3d person dropping in on this thread they might be able to help out?
#5
09/23/2008 (10:54 pm)
I guess so too, well im gonna check this out with another model.

Anyway big thanks to you. If you got PayPal or something i'm willing to send you a small "Thank You" :)
#6
09/24/2008 (3:24 am)
If you still have troubles, email me (profile address). I wrote the followup resource, and I now use TGEA exclusively :)
#7
09/24/2008 (3:45 am)
Hi Erik,
thanks a lot for this offer, i really appreciate that :D
Your Code is working fine (just have those problems with the 2 mesh parts that are not able to hide but im sure this is caused by my model. Can't test it with another one right now).

The only thing i was just wondering is if its possible to combine it with this resource: setSkinName on ObjectView

This would be great for a characterCreator. It's not that important, i could also load a level and use an AIPlayer to do so but was just wondering if something like this would be possible too ^^
#8
09/24/2008 (5:42 am)
I've just submitted an improved version of mentioned resource (code was done half-year ago but only now got time to post it here, sorry):
Hiding Meshes v2