That's a "bad path". Separate the physics from the graphics and make the graphics slave to the physics.
As-is this sounds like you are relying on the graphics calculations to achieve the spin-result.
This will result in non-deterministic behavior due to a variable calculation step-size (it'll be whatever the spurious free-running rate is... almost random).
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.
You create 'synthetic time' and update it at the physics step. Each step you run a pass of the physics engine.
When you have time (are caught up to real-time) you can render a frame. If you get all the work done you can sleep until real-time reaches the next physics step in synthetic-time.
*The primary problem is the inconsistent step size not rounding issues
Show differencesHistory of post edits
#3Shannon Barber
Posted 18 December 2012 - 09:26 PM
That's a "bad path". Separate the physics from the graphics and make the graphics slave to the physics.
As-is this sounds like you are relying on the graphics calculations to achieve the spin-result.
This will result in non-deterministic behavior due to subtle rounding errors that will not always execute the same way on different machines and implementations.
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.
You create 'synthetic time' and update it at the physics step. Each step you run a pass of the physics engine.
When you have time (are caught up to real-time) you can render a frame. If you get all the work done you can sleep until real-time reaches the next physics step in synthetic-time.
As-is this sounds like you are relying on the graphics calculations to achieve the spin-result.
This will result in non-deterministic behavior due to subtle rounding errors that will not always execute the same way on different machines and implementations.
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.
You create 'synthetic time' and update it at the physics step. Each step you run a pass of the physics engine.
When you have time (are caught up to real-time) you can render a frame. If you get all the work done you can sleep until real-time reaches the next physics step in synthetic-time.
#2Shannon Barber
Posted 18 December 2012 - 09:24 PM
That's a "bad path". Separate the physics from the graphics and make the graphics slave to the physics.
As-is this sounds like you are relying on the graphics calculations to achieve the spin-result.
This will result in non-deterministic behavior due to subtle rounding errors that will not always execute the same way on different machines and implementations.
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.
As-is this sounds like you are relying on the graphics calculations to achieve the spin-result.
This will result in non-deterministic behavior due to subtle rounding errors that will not always execute the same way on different machines and implementations.
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.
#1Shannon Barber
Posted 18 December 2012 - 09:23 PM
That's a "bad path". Separate the physics from the graphics and make the graphics slave to the physics.
As-is this sounds like you are relying on the integration to achieve the spin-result.
This will result in non-deterministic behavior due to subtle rounding errors that will not always execute the same way on different machines and implementations.
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.
As-is this sounds like you are relying on the integration to achieve the spin-result.
This will result in non-deterministic behavior due to subtle rounding errors that will not always execute the same way on different machines and implementations.
Typically you pick a fixed rate to run the physics at. This makes the physics (much more) stable and repeatable.
If you update the graphics more frequently (don't have to) then you interpolate or predict & correct.
So write the physics part that takes an impulse and translates it into an initial rotational velocity and then tweak your spin-down.
Then make the rendering pass take the current angle from the physics engine and calculate a rotation matrix to apply to the wheel.