Make a player rotate with the terrain
by Mitchell · in Torque Game Engine · 11/26/2006 (1:12 pm) · 2 replies
Ok, here is the full problem I'm having,
I wanna make a skateboarding game. Everything has gone fine so far, and instead of using any sorta vechicle, I'm using the player object as my skateboarder, only with some modified stuff in it. Anyways, I have the player acting properly, but the only problem is, is when the player is going up a hill or something. The player doesn't rotate with the terrain or any object hes standing on.
I've searched though all the sdk files, and have some idea what I need to do. I already figured out that you can't do this with scripting (or at least if you can, I have no idea how) but I amagine you should be able to do it in the SDK files and recompile the Torque Demo.
In player.cc there is a value Point3F mRot, and is documented as the rotation for the player, but it only uses the z axis. This makes sense, as the player should only be able to look around, not up or down or rolling. But in my case, I do want the y and x axis. So I need to get this information from the terrain. The closest place I know where to get this from, would be the Move move data set. This information (as best I can tell) contains all the information about the players next move. There for, if the player is being forced to move up... you should rotate the model to fix that using the x and y axis. (Does any of this make sense to anyone so far?)
So basicly, I need to know how to use the Move data set to apply it to the rotation data set in order to rotate my object properly.
my head hurts....
Help! thanks!
I wanna make a skateboarding game. Everything has gone fine so far, and instead of using any sorta vechicle, I'm using the player object as my skateboarder, only with some modified stuff in it. Anyways, I have the player acting properly, but the only problem is, is when the player is going up a hill or something. The player doesn't rotate with the terrain or any object hes standing on.
I've searched though all the sdk files, and have some idea what I need to do. I already figured out that you can't do this with scripting (or at least if you can, I have no idea how) but I amagine you should be able to do it in the SDK files and recompile the Torque Demo.
In player.cc there is a value Point3F mRot, and is documented as the rotation for the player, but it only uses the z axis. This makes sense, as the player should only be able to look around, not up or down or rolling. But in my case, I do want the y and x axis. So I need to get this information from the terrain. The closest place I know where to get this from, would be the Move move data set. This information (as best I can tell) contains all the information about the players next move. There for, if the player is being forced to move up... you should rotate the model to fix that using the x and y axis. (Does any of this make sense to anyone so far?)
So basicly, I need to know how to use the Move data set to apply it to the rotation data set in order to rotate my object properly.
my head hurts....
Help! thanks!
#2
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3148
12/03/2006 (10:01 pm)
Here you go, here is a resource to conform the player to the terrain.www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3148
Torque Owner Mitchell