02-Newtons-Laws icon indicating copy to clipboard operation
02-Newtons-Laws copied to clipboard

About class UniversalGravitation

Open xwc2021 opened this issue 7 years ago • 0 comments

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.

xwc2021 avatar Aug 08 '17 06:08 xwc2021