Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Applying Orbital Velocity

Author
Message
i lyke pineconez
7
Years of Service
User Offline
Joined: 16th Aug 2010
Location:
Posted: 28th Aug 2016 20:16
I am attempting to use the DarkPhysics engine to simulate particles with differing charges, that effectively apply forces on each other when they get too close. So far, mostly working.

The snag that I have run into, is that I need a fast solution for applying a linear force (appropriate Linear Velocity/Momentum) through "PHY ADD RIGID BODY LOCAL FORCE" which under the right circumstances would cause particle A to orbit around particle B. Under the wrong circumstances it would simply fling off.

More specifically, and simply put, I am trying to calculate the amount of Velocity in X,Y,Z directions that I need to apply, to get the particle to begin orbiting its companion in a mostly unguided manner. I want the physics engine to be in control of this relationship because I want to be able to hit those particles with other particles and break them apart, etc.

I have grabbed some example code from a few other threads, but I'm still not sure how to make this work through the physics engine, since every example I've found has DBP manipulating the object directly (Which I cannot have). In the code provided I am hung up at the function ForceOrbit() Since that is the function applying this linear force to the particles. I can't quite figure out how or where I am supposed to get AngX or AngY, since the particles can enter and leave the influence of the other particles at any time. I have no array set up to track each particles' rotation around the other, and would prefer not to have one. Is that the missing link, is it necessary for this kind of function? Any other suggestions?

Small snippet of the code I am using here;
+ Code Snippet

Login to post a reply

Server time is: 2018-02-23 06:12:31
Your offset time is: 2018-02-23 06:12:31