car Angles
car Angles
I know you guys are probably sick of me asking question about getting in cars and driving them and stuff! But I still need to know another thing, How can I set the gen1car script to were if the road slants up it doesn't just keep going straight and plow throught the concrete, but goes up!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
This is the function from ogre that handled the terrain folowing for the tanks...
Like anything done in an RF game, it is a hack. It simply tests to see whether or not the tank is going up or down and then tilting the tank either up or dwn to match. THe trick is that the level must be made with a Y value that is positivie. (ie, it must be built above 0 Y)
However, the same thing can be done nowadays with a single command if anyone wished to add it. All it would have to do is perform collison test from each corner of the bounding box and then align itself to match the required angle. Anywyas here's the funtion from the original OGRE script from the tanks.
Like anything done in an RF game, it is a hack. It simply tests to see whether or not the tank is going up or down and then tilting the tank either up or dwn to match. THe trick is that the level must be made with a Y value that is positivie. (ie, it must be built above 0 Y)
However, the same thing can be done nowadays with a single command if anyone wished to add it. All it would have to do is perform collison test from each corner of the bounding box and then align itself to match the required angle. Anywyas here's the funtion from the original OGRE script from the tanks.
Code: Select all
CheckAngles[()
{
if(self.current_Y != LASTPITCH)
{
debug(DIR);
switch(DIR)
{
case 0
{
if(self.current_Y > LASTPITCH)
{
self.ideal_pitch=(15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
}
case 90
{
if(self.current_Y < LASTPITCH)
{
self.ideal_pitch=(15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
}
case 180
{
if(self.current_Y > LASTPITCH)
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(15)*0.0174532925199433;
}
}
case 270
{
if(self.current_Y > LASTPITCH)
{
self.ideal_pitch=(-15)*0.0174532925199433;
}
else
{
self.ideal_pitch=(15)*0.0174532925199433;
}
}
}
}
else
{
self.ideal_pitch=0;
}
LASTPITCH=self.current_Y;
ChangePitch();
}]
Does guest know were I might be able to get a hold of O.G.R.E?
thanks for the info!
thanks for the info!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
That would be great! I'm glad that the demo are finally coming back! I was kinda worried that they would be back but I guess I'm just crazy!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Another method might be by using 2 pawns for the front and rear tires. Having them check their angles to each other, and then having the car body as the third pawn. It checks the angles between the two pawns, and set it's angle (or pitch) accordingly.
Kind of like having the back tires pawn constantly adjust it's pitch to aim at the front tires pawn. Then having the car body pawn setting it's angle to match the back tires pawns angle.
This way the car will always match the terrain pitch exactly. Could even use 4 pawns 1 for each tire to get side to side tilting as well.
Kind of like having the back tires pawn constantly adjust it's pitch to aim at the front tires pawn. Then having the car body pawn setting it's angle to match the back tires pawns angle.
This way the car will always match the terrain pitch exactly. Could even use 4 pawns 1 for each tire to get side to side tilting as well.
http://www.mapvault.com/uploads/rf/
While you're waiting for OGRE, you can get RF fighting demo,
fif_setup.rar, and operation spyerwolf, and brawl, 4 of Pickle's games, not to mention my personal favorite
http://asylum.rfactory.org/asylumdemo.exe
While you're waiting for OGRE, you can get RF fighting demo,
fif_setup.rar, and operation spyerwolf, and brawl, 4 of Pickle's games, not to mention my personal favorite
http://asylum.rfactory.org/asylumdemo.exe