Hey again,
Sorry for being that quick between each topic ... But I've got to ask you questions in order to continue with my projects. And yes, I always try to find stuff in the tutorials and in the documentation before I ask here.
Now for the problem of mine:
I need to see if the camera's position has exceeded a specific limit, i.e. when you fall off a Quake 3 map in the tutorial example and need to respawn - you 've got to detect that you're actually going down below the map.
So, I want to add something during the main loop that checks if the camera's position on the Y axis exceeds the value of M (which I cannot tell you right now as I've not yet figured out what value M stands for), and if it does, the game moves the camera to the same position as when the game was started for the first time.
You'll probably need the Quake 3 map node's position and the camera's starting position. They are as follows:
QUAKE 3 MAP: q3node->setPosition(core::vector3df(0,-1000,0));
CAMERA STARTING POSITION: camera->setPosition(core::vector3df(0,0,0));
If you need further information about this issue, just ask.
Camera position as output *SOLVED*
Camera position as output *SOLVED*
Last edited by thojoh370 on Mon Nov 05, 2007 8:22 pm, edited 1 time in total.
Programmers don't DIE, they just GOSUB and then RETURN.
You just need to check if the characters position is below some set limit.
Ideally Limit would be no lower than the lowest point on the map. You can get the height of the lowest point on the map by using the MinEdge.Y of the world space bounding box for the map itself.
Depending on your game, it might make more sense to make sure that the player is inside the bounding box of the level at all. I mean they could potentially find a way to get onto the ceiling of the map. If that is the case you could just make sure that the player absolute position is inside the world bounding box of your map.
Travis
Code: Select all
if (player->getAbsolutePosition().Y < Limit) {
// fix the problem
}
Depending on your game, it might make more sense to make sure that the player is inside the bounding box of the level at all. I mean they could potentially find a way to get onto the ceiling of the map. If that is the case you could just make sure that the player absolute position is inside the world bounding box of your map.
Travis
No player yet
I don't have any player entity yet; it's just a camera this far. But I will make it a player entity as soon as I know how to do that ... But I suppose this will work?:
Code: Select all
if (camera->getAbsolutePosition().Y < Limit) {
// fix the problem
}
Programmers don't DIE, they just GOSUB and then RETURN.