car problem?

njw1985

22-05-2008 08:04:42

Hi,,I happen to one problem,,,When I set up one car,and follow one Camera,,the car quive very heavy,so why?

reptor

22-05-2008 08:42:34

You should definitely give more information about your problem.

Also it would help if you would write in English.

njw1985

22-05-2008 08:57:46

Ok,,when I bind Camera to my car,,and the car shock very heavy,,
How to solve it ?

Code:

if(IsCar)
{
const Real followFactor = 0.2;
const Real camHeight = 2.0;
const Real camDistance = 10.0;
const Real camLookAhead = 8.0;

Quaternion q=actorr->getNode()->getOrientation();
Vector3 toCam=actorr->getNode()->getPosition();
toCam.y += (camHeight+3);
toCam.z -= camDistance * q.zAxis().z;
toCam.x -= camDistance * q.zAxis().x;

mCamera->move( (toCam - mCamera->getPosition()) * followFactor );
mCamera->lookAt(actorr->getNode()->getPosition() + ((actorr->getNode()->getOrientation() * Vector3::UNIT_Z) * camLookAhead));
}

When I release bind Camera to car,,the car seem not shock,,
when bind camera to car ,the car shock likes up and down,how can I solve it?

betajaen

22-05-2008 11:05:22

You have to apply interpolation to the Car and probably the camera.

njw1985

22-05-2008 11:45:49

The body class has not "setInterpolation" function in 0.9?
How to set interpolation in 0.9?

BloodyFanatic

22-05-2008 13:38:29

it isn't implemented in 0.9. you will need to update to at least 1.0'18 ;)

njw1985

23-05-2008 01:29:57

1.0'18 is bleeding ?

betajaen

23-05-2008 01:33:11

Yes. Anything that is 1.0 is bleeding.

njw1985

25-05-2008 10:51:23

OK,,thank u!!

Another problem,,,When I set up car,,and then use Moter to control it like this:
mm=new Motor("Motor", mScene, &ww.Drive);
ww.attachDriveShaft(mm);

if(mKeyboard->isKeyDown(OIS::KC_LCONTROL))
{
mm->shiftGear(-1);
}

then the result seem can't control it ?

njw1985

27-05-2008 04:21:22

How to get speed of a car?

betajaen

27-05-2008 11:36:50

The speed of the car is:

NxVec3 v(new_pos - old_pos); NxReal speed = v.magnitude();

Measured in metres per second.

njw1985

27-05-2008 13:12:44

Ok,,!!
I use the "shiftGear(1)" to increase 1 gear to my car,,but the speed can't improve,,why?
How can I use "shiftGear()" function?

betajaen

27-05-2008 13:32:20

Gears probably don't work with the motor class, as it's only an example.

njw1985

27-05-2008 13:52:10

Ok,,you said is right!!
I know your mean,,thank u!!!

njw1985

20-07-2008 14:05:35

The speed of the car is:

NxVec3 v(new_pos - old_pos); NxReal speed = v.magnitude();

Measured in metres per second.


as you said,,I try it ,,and the speed is only:0.6 m/s!!1