Questions about making doors, maybe a solution?
by Michael Flynn · in General Discussion · 02/19/2012 (5:46 pm) · 6 replies
Hey all,
I'v been learning Blender, and I got to thinking about all the post I'v read about how to make
doors that operate. So I am wondering couldn't you just model a door in your favorite 3D program,
then create animation frames of it operating, IE swing open, or slide open/close and then just
script some zones to play the open and close animation? Use a timer to animate it open then
time out to play the closing Animation.
OF course I'm not sure how to do collision, is there a way to turn it off of a model?
Perhaps turn off collision when open then back on when closed?
I welcome comments about this idea!
Thanks,
Mike
I'v been learning Blender, and I got to thinking about all the post I'v read about how to make
doors that operate. So I am wondering couldn't you just model a door in your favorite 3D program,
then create animation frames of it operating, IE swing open, or slide open/close and then just
script some zones to play the open and close animation? Use a timer to animate it open then
time out to play the closing Animation.
OF course I'm not sure how to do collision, is there a way to turn it off of a model?
Perhaps turn off collision when open then back on when closed?
I welcome comments about this idea!
Thanks,
Mike
About the author
Associates in Applied Technologies. Beginner Game programmer, and 3D modeler. Torque 3D Version 1.2 Licensed Version.
#2
02/20/2012 (8:34 am)
There are several door Resources, several ways of implementing doors: making them open with an onCollision() callback, a raycast and onUse() event, even triggers. Your shape itself can have animation or you can programatically slide/rotate the shapes through script. To hide a collision mesh you can use setHidden() just like you would any other mesh - this has a side effect of propagating the new collider position across the network - but like Mike mentioned, depending on how you implemented doors that may not be practical/effective/feasible/realistic.
#3
Thanks
Mike
02/20/2012 (9:20 am)
I was thinking that if you had collision on your door, that when animated to open that it would block the player from walking thru it. I guess I was thinking too much about collision bounds, I was thinking of a door like star trek where it splits in the middle of the door, but now I think of it if each half has it's own bounding box then it will move with the door haves and not block the player.Thanks
Mike
#4
02/20/2012 (3:20 pm)
Quote:I think of it if each half has it's own bounding box then it will move with the door haves and not block the player.Exactly. Just make your animated doors and figure out which way you want to open them.
#5
Mike
02/20/2012 (5:21 pm)
Great, now I just need to find some simple examples of playing animations for an Model. Google search here I come!Mike
#6
That said, I've not tried it myself - I know it used to work like this in TGE, and the Player collision code hasn't changes much, as far as I can see. Using a physics-enabled player might yield better results.
02/20/2012 (10:04 pm)
Unless T3D somehow fixes this, animating the collision meshes won't really work. Player uses cached collision geometry so that it doesn't have to recalculate it every frame if it hasn't moved a significant distance - have a look at Player::updateWorkingCollisionSet. The effect of this is that if you walk up to a door (caching its collision geometry as you do so), then open it (moving the collision mesh), then try to walk through, you'll collide against the cached collision geometry instead of the current.That said, I've not tried it myself - I know it used to work like this in TGE, and the Player collision code hasn't changes much, as far as I can see. Using a physics-enabled player might yield better results.
Torque Owner Mike Rowley
Mike Rowley