Box2D, Torque and collisions
by Michael Branin · in Torque 2D Beginner · 02/20/2013 (3:07 am) · 3 replies
ok .. in the old Torque you could check an objects collision against its normal to see what direction the collision came from. How do you check for the same thing now that Torque is using Box2D?
I need to determine Is a collision is coming from above, below, Left or Righ. There has got to be a way to test for this.
I need to determine Is a collision is coming from above, below, Left or Righ. There has got to be a way to test for this.
#2
%this.setConstantForceY(100);
I tried Applyforce but eveidently I am calling it wrong and I do not understand how ApplyForce works in script.
02/20/2013 (6:29 am)
I was using the collison call wrong. Quick question What is the Equivalent of this old torquescript comman under the new T2D%this.setConstantForceY(100);
I tried Applyforce but eveidently I am calling it wrong and I do not understand how ApplyForce works in script.
#3
By far the easiest method is to use the ".startTimer()" and ".stopTimer()" calls (only in the DEV branch for now, they are the equivalent of the "setTimerOn()" & "setTimerOff()" calls in MASTER) which are periodic timers. You can apply a force continuously this way.
One of the features this kind of thing was planned for was physics controllers where you can add various types of controllers to the Scene. For instance you could have a "Wind" controller which would essentially allow you to apply a force, even set variations etc. There could be a buoyancy controller for floating objects, attractors, repellers etc.
You could then simply associate a SceneObject with any of the controllers currently in the Scene.
I would love to work on that but sadly there's doco (etc) to be done.
02/20/2013 (6:38 am)
There is no equivalent to continuously apply a force and cause an acceleration other than the scene-wide gravity.By far the easiest method is to use the ".startTimer()" and ".stopTimer()" calls (only in the DEV branch for now, they are the equivalent of the "setTimerOn()" & "setTimerOff()" calls in MASTER) which are periodic timers. You can apply a force continuously this way.
One of the features this kind of thing was planned for was physics controllers where you can add various types of controllers to the Scene. For instance you could have a "Wind" controller which would essentially allow you to apply a force, even set variations etc. There could be a buoyancy controller for floating objects, attractors, repellers etc.
You could then simply associate a SceneObject with any of the controllers currently in the Scene.
I would love to work on that but sadly there's doco (etc) to be done.
Associate Melv May
Physics Guide