Game Development Community

Door animation problem

by Carstein Nagash · in Technical Issues · 11/14/2008 (11:23 am) · 11 replies

Hi ,

i tried to animate a door in milkshape and do a duplicate mesh collision, but the collision don t working on the engine, so is it possible to rotate the shape by code for the collision ?

Thanks at all

#1
11/14/2008 (11:24 am)
(only rotate the staticShape) sorry
#2
11/14/2008 (11:54 am)
Not sure if this still works, but give this a shot... if anything it should get you pointed in the right direction:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6780
#3
11/14/2008 (11:57 am)
...also, that resource I believe is for a sliding door vs a rotating door. From what I understand is; your pivot point is determined by your modeling program so you will have to offset the door so that the "hinge" side of the door is over the pivot point. Then you should be able to just rotate the door via script.

Of course, things may have changes in the past couple of major versions, but I believe this is how I used to do it on a much older version of TGE...
#4
11/14/2008 (3:51 pm)
You may have to set the 'door' object up as a 'mounted' object, instead of merely part of the 'base' shape....the doorFrame??


I 'think' that 'mounted' objects maintain their collision meshes and then you could perhaps rotate the mount node or the mountPoint during the animation to do this by script....
#5
11/17/2008 (4:44 am)
Yeah i did that example but i have a problem with the collision, my door is animated correctly but the collision mesh don t move and i don t know why ...
#6
11/17/2008 (4:46 am)
*** thanks at all for your help *** ;)
#7
11/17/2008 (4:47 am)
I using milkshape for the export so maybe a problem from it ?
#8
11/17/2008 (6:45 am)
I'm not so certain the 'exporter' is the issue here....


Collision meshes are not animated on their own...so it would be useless to animate it directly within the dts shape, however; collision meshes do follow along[hack:animated] with the DTS object they are a part of. This is alluded to, in Ed M's GameProgrammer'sGuideToTorque, Page 173.

"If a mount node is animated, the shape/image mounted to that node will follow the node through it's animation."


"Images do not have collision meshes and will therefore not collide with objects with objects when the shape they are mounted to moves."

...and the mainPoint to take away:

"Shapes that are mounted to other shapes retain their collision meshes"


So, perhaps approach the door art from this direction...? Make your 'door' object w/collision mesh a separate object than your 'doorFrame'.... Then, with scripting, 'mount' the 'door' object w/collision mesh onto the 'doorFrame'....now, try 'animating' your mountN node in the doorFrame DTS object, the door w/collision 'should' follow the animation. Or, try animating the mountPoint node of the 'door' object to 'open'...again, the collision mesh 'should' follow the node it's parented to?

This may have changed, but I have understood 'collision' mesh animating to only work in this way without C++ changes to the source? I could be wrong?

What, exactly, have you tried?
#9
11/24/2008 (6:23 pm)
I believe you're correct Rex, but it has been quite a while since I've made a door. I'd have to check the script-only door resources to see for sure.
#10
11/24/2008 (8:20 pm)
I Dont think a moving collision mesh works at this time.
My current solution is to move the object faster than the player can collide with it
.
I.E. Move the door as the player comes up to it via a trigger.

Or....

This code might give you other ideas!
#11
12/02/2008 (10:31 am)
Thanks at all , i will try something , hope it will work , thanks again !