Physics improvement
- ElderTroll
- Posts: 499
- Joined: 25 Jan 2012, 07:01
Re: Physics improvement
I know that I should wait until this is tested and confirmed to work, but AWESOME JOB Jhooks! Will that make it into 0.12.0 or 0.13.0?
Re: Physics improvement
0.13.0. We don't accept anything new or possibly disruptive (as in: can introduce new bugs) for 0.12.0.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Physics improvement
Congratulations jhooks!
@Zini Debian FTW!
Ok, as I said I did two very long falls. I dropped my character from the height of 350280,82 units and 561547,82 units next (around 5 km and 8 km).
The falling time was 1 minute and 27 seconds at first test and 2 minutes and 23 seconds second time.
After calculations I found speed cap 3772,625 units/second (around 3770) and g is (suprise!) equal 645,1098 units/second^2. That's just 9,16056 m/s^2.
Since the heights was so freaking big I think that this numbers are accurate.
PS
Don't try this at home!
@Zini Debian FTW!
Ok, as I said I did two very long falls. I dropped my character from the height of 350280,82 units and 561547,82 units next (around 5 km and 8 km).
The falling time was 1 minute and 27 seconds at first test and 2 minutes and 23 seconds second time.
After calculations I found speed cap 3772,625 units/second (around 3770) and g is (suprise!) equal 645,1098 units/second^2. That's just 9,16056 m/s^2.
Since the heights was so freaking big I think that this numbers are accurate.
PS
Don't try this at home!
Re: Physics improvement
Gus, is this the right way to do things?
Re: Physics improvement
Physic.cpp is in openengine, so do I have to commit it to openengine instead of openmw?
Re: Physics improvement
Changed it to internalCollisionShape = new btBoxShape(btVector3(14.64f * 2, 14.24f * 2, 33.25f * 2)); Found the xyz in base_anim.
Seems to work better, I think aedras coordinate system is different which is why the coordinates were in a different order.
Seems to work better, I think aedras coordinate system is different which is why the coordinates were in a different order.
Re: Physics improvement
Ok, so I first just decided to check the end numbers to see if they were about right, they were not really, so one thing led to another and now this:
I may not be a coder, but I did minor in physics.
~0.142876729 internal game unit to decameter(.1m) multiplication factor
I left off the back digits as it only makes a ~.0002 difference.
Game units are multiplied by this number.
You can also go by 64 units/yard or ~70 units/meter. This 70 units/meter is verified both on the Morrowind and Oblivion wiki.
0.0142876729 is used here to make things in meters instead of a tenth of a meter.
A. 350280.82 units; 87 seconds
B. 561547.82 units; 143 seconds
Step 1
A. 350280.82*0.0142876729 = 5004.697779, so ~5004.7m
B. 561547.82*0.0142876729 = 8023.21157, so ~8023.2m
Step 2
Average Velocity
A. 5004.7/87 = 57.5253m/s
B. 8023.2/143 = 56.1063m/s
This is close so I think its accurate enough.
Average of A and B = 56.815m/s
in units, this is 56.8158*70 = 3977.11u/s
56m/s is actually about the terminal velocity of a person in real life.
Distance needed to reach this speed:
56^2/(2*9.81) = 159.837m
Time taken to reach this distance:
(2*159.837/9.81)^.5 = 5.7085 seconds
So, if anything 9.0 or more was used, it only takes about ~6-7 seconds to get to max speed.
This is under 10% of the total time for A and B which means that the speed shouldnt vary anywhere above 1% from the average.
So, looking at the numbers below, I am perplexed:
3772.625*0.0142876729 = 53.9020m/s
3772.625/70 = 53.8946m/s
645.1098*0.0142876729 = 9.21709m/s
645.1098/70 = 9.21585m/s
645.1098/9.16056 = 70.4225
which does not equal 70
So, my question is, exactly what calculations did you do?
Unless you have access to air resistance, mass, density and drag...
Just want to make sure gravity gets done correctly. Please forgive the use of decimals instead of commas, why they are switched comparing the US to Europe I have no idea.
I may not be a coder, but I did minor in physics.
~0.142876729 internal game unit to decameter(.1m) multiplication factor
I left off the back digits as it only makes a ~.0002 difference.
Game units are multiplied by this number.
You can also go by 64 units/yard or ~70 units/meter. This 70 units/meter is verified both on the Morrowind and Oblivion wiki.
0.0142876729 is used here to make things in meters instead of a tenth of a meter.
A. 350280.82 units; 87 seconds
B. 561547.82 units; 143 seconds
Step 1
A. 350280.82*0.0142876729 = 5004.697779, so ~5004.7m
B. 561547.82*0.0142876729 = 8023.21157, so ~8023.2m
Step 2
Average Velocity
A. 5004.7/87 = 57.5253m/s
B. 8023.2/143 = 56.1063m/s
This is close so I think its accurate enough.
Average of A and B = 56.815m/s
in units, this is 56.8158*70 = 3977.11u/s
56m/s is actually about the terminal velocity of a person in real life.
Distance needed to reach this speed:
56^2/(2*9.81) = 159.837m
Time taken to reach this distance:
(2*159.837/9.81)^.5 = 5.7085 seconds
So, if anything 9.0 or more was used, it only takes about ~6-7 seconds to get to max speed.
This is under 10% of the total time for A and B which means that the speed shouldnt vary anywhere above 1% from the average.
So, looking at the numbers below, I am perplexed:
3772.625*0.0142876729 = 53.9020m/s
3772.625/70 = 53.8946m/s
645.1098*0.0142876729 = 9.21709m/s
645.1098/70 = 9.21585m/s
645.1098/9.16056 = 70.4225
which does not equal 70
So, my question is, exactly what calculations did you do?
Unless you have access to air resistance, mass, density and drag...
Just want to make sure gravity gets done correctly. Please forgive the use of decimals instead of commas, why they are switched comparing the US to Europe I have no idea.
Re: Physics improvement
I shall not forgive you for using Decimals. I SHALL THANK YOU.
everyone should be using decimals
everyone should be using decimals
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Physics improvement
It's simple. Let S1 would be distance in first jump, S2 in second, Vm maximum velocity, a acceleration value, t1 total time in first one, t2 total time in the second one, ta time of acceleration phase.
S1=Vm(t1-ta)+1/2(a*ta^2)
S2=Vm(t2-ta)+1/2(a*ta^2)
but Vm is nothing else but ta*a, this leaves just two unknowns to be calculated. Anyway: in the end we have:
Vm=(s2-s1)/(t2-t1)
a=Vm^2/(s1-Vm*t1)
As you can see no problem here at all. Just pure Newton's dynamics.
PS
PPS
Just checked it. there is something not right.
PPPS
I think that the height was just to big (like 2 times to big) and something bad happend because of float point.
S1=Vm(t1-ta)+1/2(a*ta^2)
S2=Vm(t2-ta)+1/2(a*ta^2)
but Vm is nothing else but ta*a, this leaves just two unknowns to be calculated. Anyway: in the end we have:
Vm=(s2-s1)/(t2-t1)
a=Vm^2/(s1-Vm*t1)
As you can see no problem here at all. Just pure Newton's dynamics.
PS
For comas we shall kill and die!everyone should be using decimals
PPS
Just checked it. there is something not right.
PPPS
I think that the height was just to big (like 2 times to big) and something bad happend because of float point.
Re: Physics improvement
Correct. You need to fork openengine on github. Add your fork as a remote to your local repository (after cd-ing into it). Then it is mostly business as usual. But after you done committing/pushing and have cd'ed back from the submodule directory to the OpenMW directory, do another commit so OpenMW is using the new version of the submodule.Physic.cpp is in openengine, so do I have to commit it to openengine instead of openmw?