About Store Forum Documentation Contact



Post Reply 
Raycast car problem
Author Message
Alex Offline
Member

Post: #1
Raycast car problem
Hallo!

I have described physics of the car. But I used not built in class Wheel, and I have described wheels through RayCast.

The forces applied to the car through wheels, are put to it at each function Update() calling.

But I have a problem: if FPS falls to 5-10 my cars start to spring. Because for 1/5 seconds they fail on 0,2 metres (with free fall acceleration), and then is caused Update() and appeared compressed springs push the car upwards.

Please, help to understand with what the reason of it?

May be I do not consider any parametre of an engine, or it is necessary joints to connect capsules on places of wheels (as in examples from nVidia PhysX), or still somehow?
(This post was last modified: 02-08-2012 03:38 PM by Alex.)
02-08-2012 03:35 PM
Find all posts by this user Quote this message in a reply
Alex Offline
Member

Post: #2
RE: Raycast car problem
Physics.updatedTime() // get actual amount of physics simulation time which has been performed during last simulation, when 'PHYS_TIMESTEP_ROUND' is used the returned value will always be a multiple of a constant value based on the 'Physics.precision', ...

How I can set a constant physics update time (not "multiple of a constant") for precision of physics effects modelling?
That is, if FPS decreases, actions of actors in game should be slowed down, but that the interval of physics updating time remained to constants (for example, = 50 milliseconds).
02-11-2012 05:09 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Raycast car problem
Physics.precision, timestep,..
02-12-2012 04:20 PM
Find all posts by this user Quote this message in a reply
Alex Offline
Member

Post: #4
RE: Raycast car problem
Yes, I also use it:
Physics.timestep(PHYS_TIMESTEP_ROUND);
Physics.precision(60);
In this case, at high FPS, Physics.updatedTime() returns value 1000/60 = 16 milliseconds (or zero to skip any frames). But if FPS decreases, updatedTime() returns 33, 50, 66... Value updatedTime() increases by number, to multiple 16 milliseconds, keeping speed of movings of actors in the game world.

I would like, that at decrease FPS value updatedTime() remains to equal 16 milliseconds. It can be possible to add in function World.update(Cam.at) also argument deltaTime which will be transferred in called in it Physics.startSimulation(deltaTime)? Or to add a new physics timestep updating mode - PHYS_TIMESTEP_CONST?
(This post was last modified: 02-13-2012 12:38 PM by Alex.)
02-13-2012 12:37 PM
Find all posts by this user Quote this message in a reply
Post Reply