Player 3-Axis Rotation.
by Alex Guzman · in Torque Game Engine · 04/24/2005 (9:59 pm) · 6 replies
Ok, so here is my problem and I will admit I am new, but I am trying and going nuts while trying.
My class is working on a project. I (in my insanity) suggested that we recreate (at least in rough working order) the Battle Room in Ender's Game (yes I know there are at least 2 other people trying or tried and quit etc...) Here is the issue just like the topic states, in ANY form of gravity you need your player aligned to the ground. In ZERO gravity in a small room I need to be able to rotate the character so he/she/it can jump off the walls and ceiling. I have tried my hardest to understand where the Yaw rotation works with the mouse in rotating the model along the Z-Verticle-Center-Axis and trying to find out where in the Player class that they are doing the aligning. But it is at a complete loss to me. I have tried commenting, printing to the counsole, and cursing in 3 different languages. The only thing I can narrow down is that its most likely somewhere in the Player::updateMove() method. Now I need help. I have been trying on my own for like 4 days now and we have 2 weeks to have a "proof of concept" up and going. So any help would be most appreciated. The final product would allow me to rotate the character along all axis but I will settle for the X-Horizontal-Center-Axis (like a flipping coin). Even if someone could point me to a resource that works similar (No none of the flying, or swimming ones, they don't rotate the character just select a different animation and apply acceleration in the appropriate direction)
In advance I thank anyone and all who help.
My class is working on a project. I (in my insanity) suggested that we recreate (at least in rough working order) the Battle Room in Ender's Game (yes I know there are at least 2 other people trying or tried and quit etc...) Here is the issue just like the topic states, in ANY form of gravity you need your player aligned to the ground. In ZERO gravity in a small room I need to be able to rotate the character so he/she/it can jump off the walls and ceiling. I have tried my hardest to understand where the Yaw rotation works with the mouse in rotating the model along the Z-Verticle-Center-Axis and trying to find out where in the Player class that they are doing the aligning. But it is at a complete loss to me. I have tried commenting, printing to the counsole, and cursing in 3 different languages. The only thing I can narrow down is that its most likely somewhere in the Player::updateMove() method. Now I need help. I have been trying on my own for like 4 days now and we have 2 weeks to have a "proof of concept" up and going. So any help would be most appreciated. The final product would allow me to rotate the character along all axis but I will settle for the X-Horizontal-Center-Axis (like a flipping coin). Even if someone could point me to a resource that works similar (No none of the flying, or swimming ones, they don't rotate the character just select a different animation and apply acceleration in the appropriate direction)
In advance I thank anyone and all who help.
#2
If this is in the Player::setTransform() method, how would I modify this to actually do the rotation on all axis?
04/25/2005 (9:58 am)
Point3F pos,vec; mat.getColumn(1,&vec); mat.getColumn(3,&pos); //TODO MODIFY neeed AXIS ROTATION!!!!! Point3F rot(0,0,-mAtan(-vec.x,vec.y)); setPosition(pos,rot); setMaskBits(MoveMask | NoWarpMask);
If this is in the Player::setTransform() method, how would I modify this to actually do the rotation on all axis?
#3
04/25/2005 (3:19 pm)
That's just the tip of the iceberg. The player class doesn't network proper rotation, nor does it handle it right in its interpolation code, nor does it map input properly for it. The Vehicle class does. I would very strongly suggest using the Flying Vehicle class for your players rather then the Player class.
#4
04/28/2005 (7:09 pm)
I agree with Ben. It took me a few hours to get everything working right. Much easier to just go with the vehicle code
#5
Ok exactly what I have done is created a flyingvehicle and then in the flying vehicle I changed the .dts file to the .../player/player.dts shape. When I run the engine I get "Error, a vehicle must have a collision-1 detail!!!" which I don't understand what that means ... I have tried digging through the source but I wasn't able to locate why/what a collision-1 is.
04/29/2005 (5:22 pm)
Ok, so I have tried to create a FlyingVehicle data block and just change the DTS ... that apprently didn't work. So if either of you could point me in a more specific direction I would REALLY appreciate it. Do you guys want me to create a class that inherits from the flying vehicle? or is there something I can use in the scripting? I am so lost :SOk exactly what I have done is created a flyingvehicle and then in the flying vehicle I changed the .dts file to the .../player/player.dts shape. When I run the engine I get "Error, a vehicle must have a collision-1 detail!!!" which I don't understand what that means ... I have tried digging through the source but I wasn't able to locate why/what a collision-1 is.
#6
04/30/2005 (1:31 pm)
Create a convex collision mesh called collision-1 - see the exporter docs, they discuss how to do this! There are also some vehicle tutorials that can help you out! :)
Associate Kyle Carter
Then all you have to implement is some sort of "wall stickiness" so people can snag the wall and launch themselves off it again (presumably if they hit too hard they'll also bounce off, whoops ;).
It's a cool game idea and one I'm surprised I haven't seen done more often. I do wish you the best in pulling it off.