Previous Blog Next Blog
Prev/Next Blog
by date

Yet another late night...

Yet another late night...
Name:Tony Richards
Date Posted:Oct 01, 2006
Rating:2.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Tony Richards

Blog post
I've been working on this since about 10:30 am... my 3d math sucks!.

But, after a crash course, a bunch of debugging, stepping through the code and pulling out my hair, I've finally got it.


   // Dampen the Pitch after stopped moving for a second
// TODO: make this 1.0 second be a DataBlock variable
if (mTimeSinceLastPitch > 1)
{
F32 yangle = mDot(yv, Point3F(0, 0, 1));

torque -= xv * yangle * mDataBlock->steeringForce * mDataBlock->autoAngularForce;
}


I've got some code elsewhere that keeps track of the last time the player modified the pitch control. If it's been over a second then the vehicle automatically corrects the pitch to zero. The correction occurs over time and is based on the autoAngularForce. A 2.0 value seems to be about right, but I'll probably have it exposed as a configurable parameter in the vehicle setup.

Eventually I'll get the hard-coded one-second delay moved out to the datablock so it can be configurable as well.

This solves the last hurdle for vehicular control... now time for some more play-testing.

Recent Blog Posts
List:11/13/08 - Take Two...
11/13/08 - Zen and the Art of Indie Game Development
04/10/08 - Indie 2.0 - Content Packs
03/14/08 - Indie 2.0 - Part 1
01/04/08 - IndieZen Dev Blog, Dec 2007
12/13/07 - Happy Birthday IndieZen!
11/25/07 - IndieZen Dev Blog, Nov 2007
11/17/07 - IMGDC tech talk

Submit ResourceSubmit your own resources!

Tony Richards   (Oct 02, 2006 at 02:07 GMT)
Wow, how'd I get a rating of 1 star? :S

Alexander "taualex" Gaevoy   (Oct 02, 2006 at 19:26 GMT)   Resource Rating: 5
Because your 3d math is not that great :)

Just kidding... GG site makes some wierd stuff sometimes...

You must be a member and be logged in to either append comments or rate this resource.