A good idea? (Torso twist + player rotation)
by Daniel Buckmaster · in Torque Game Engine · 11/23/2008 (11:40 am) · 2 replies
I've run into no end of difficulty when trying to get torso twisting working. Basically, I've got a terrible bug where the player's rotation is over-corrected as they centre their legs on their torso when moving. The player ends up rotated too far in the direciton his torso was twisted.
On the other hand, it works perfectly fine to rotate the body to line up with the legs - it just means that the player's view gets twisted back the way they were facing before twisting. Not good.
I'm wondering whether it's a better idea to try really, really hard to debug this thing, or to go with another idea I just had. TGE with my torso twist mod is currently lower-body-cardinal, it regards the player's legs as their true 'forward'. When you twist, mHead is changed and an animation is played, but you're still facing the same way as before (mRot has not changed).
The idea is to change this to being torso-cardinal. The way your torso is pointing is 'forward'. Now when you torso twist, 'forward' is altered, and an animation twists your legs beneath you in the opposite direction. Now I avoid the nasty problem with over-correction, because all I have to do is reduce the twist amount and animate the legs back to normal. However, I can still use the legs' direction relative to the body for movement, so there's no visual anomaly with a character's legs pointing off to the side as they move hte way their chest points.
So - good idea, or no?
On the other hand, it works perfectly fine to rotate the body to line up with the legs - it just means that the player's view gets twisted back the way they were facing before twisting. Not good.
I'm wondering whether it's a better idea to try really, really hard to debug this thing, or to go with another idea I just had. TGE with my torso twist mod is currently lower-body-cardinal, it regards the player's legs as their true 'forward'. When you twist, mHead is changed and an animation is played, but you're still facing the same way as before (mRot has not changed).
The idea is to change this to being torso-cardinal. The way your torso is pointing is 'forward'. Now when you torso twist, 'forward' is altered, and an animation twists your legs beneath you in the opposite direction. Now I avoid the nasty problem with over-correction, because all I have to do is reduce the twist amount and animate the legs back to normal. However, I can still use the legs' direction relative to the body for movement, so there's no visual anomaly with a character's legs pointing off to the side as they move hte way their chest points.
So - good idea, or no?
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
11/24/2008 (9:41 am)
So as you move, the torso stays twisted...? Like mech games? I'm just trying to implement a basic FPS feature - move where the camera's pointing, but have torso twisting :P.
Torque Owner Erik Madison