After my years of game engine writing this is actually my first time to write a working physics engine with a simple sphere-sphere, sphere-box 2d collision. Though one thing bothers me is that at some point the application crashes randomly.
So I noticed that my application consistently crashing at Math.Sign() with NaN values passing in it. I tried to fix the bug the whole day without luck -- the bug is very trivial what causing it.
I also override the XNA's Vector2 object with NaN value to a corrected one but the physics movement make it worst.
Tried looking in the net as well but I think nothing really that helps. In the first place I thought my engine now written in C# should be flawless. !@#$ I was very frustrated! Then I decided to continue the other modules and almost got me thinking not to use physics for now.
After few days I realized, Hey! why not brute force assertion on suspected codes and slowly dig more....
Code:
System.Diagnostics.Debug.Assert(!float.IsNaN(value));
Success! At some point on 2 objects colliding, you will get a perfect 2 radius delta length value (ex. 40.0f) subtracted from 2 object position. By computing the minimum translation distance you will need to subtract the delta length to 2 radius added so resulted to 0 and need to divide again to delta length and will result to Not-a-Number value in C#.
Blablablah! it only means at some point I'm dividing a perfect 0 value. Heheh
So far everything is working fine and I'm almost done with the engine writing (maybe for a very simple game).
Now I'm off to test the codes to my Xbox360 and to WindowsPhone7 emulator =)
The plan includes up to twenty minutes of intense interval training, done for up to three
ReplyDeletedays per week. At least, you were pretty sure there was no such thing despite
your fondest fantasies. To get rid of unwanted love-handles, workout your lower back.
Rob Polous continues to state that there are too
many weight-reduction plan scams and products available on the market but when he comes
upon one thing that is natural he simply has to try it
out for himself.
Feel free to visit my web blog ... Best Fat Burning Foods
For individuals who have a very minor excess to provide,
ReplyDeletea diamond ring will go lower effectively having a small woman.
The idea behind pre engagement ring is that they
represent sincerity towards a relation without being committed into an
engagement. To produce cultured pearls, a skilled
technician, termed a nucleator, induces the pearl-growing course of action by
surgically putting an irritant'a mommy-of-pearl bead along with a piece of mantle tissue, typically'into a mollusk.
Here is my web blog; promise ring after 6 months
I prefer sterling silver jewelry because I hate the way gold
ReplyDeletelooks with my skin tone and because it is cheaper than white gold.
It definitely puts the whole matter of wearing a divorce ring to rest.
In a bold, albeit somewhat of a shallow and pedantic move, Apple has implemented Christian i - Phone app developer Island
Wall Entertainment's Purity Ring Application, "in an attempt to engage with today's youth using new mediums.
My page :: promise rings meaning for girlfriend [www.gultgu.org]
Most engraving is also available in a variety of fonts allowing the font selection to also be a part of the overall ring design.
ReplyDeleteTitanium was a metal first used in the aerospace industry because of its ability to withstand
high temperatures. These hearts symbolize true love and
liking for the soul mate.
Here is my homepage; promise rings london
At $20 it can be a really good deal and comes in the ton of shades.
ReplyDeleteWith our bodies working in overdrive, you obtain eruptions within the skin which brings about acne.
If somebody is unable to wake up and start breathing normally during
an apnea episode, death can occur. Well, luckily
to suit your needs, people that have spent years researching
and developing clean pores clear system of skin will
not only know what they are doing, but put your dollars
where your mouth is and fully guarantee their product.
Also visit my web-site b5 vitamin acne