02-Newtons-Laws
02-Newtons-Laws copied to clipboard
About class UniversalGravitation
hi, I am learn this course form udemy now . But I find something weird. in CalculateGravity() "physicsEngineA != this" is seemed not necessary.Instance of UniversalGravitation is never equal Instance of PhysicsEngine. on the other world "physicsEngineA != this" is always true.
And if There is only one Instance of UniversalGravitation in the game world. Just use "physicsEngineA !=physicsEngineB" can get the correct result.
Hypothesis physicsEngineArray={a,b,c} then {a} is applied force from {b,c}
{b} is applied force from {a,c}
{c} is applied force from {a,b}
But The object can be dynamically generated, so I think need a global container to memory all instance of PhysicsEngine. and all physicsEngine need to add his self to the container in function start.