cassius Posted March 12, 2012 Share Posted March 12, 2012 SetBodyForce AddBodyForce SetBodyVelocity Although the meaning of the above functions are selfevident I have never been sure WHEN they are needed or what they can be used for or whether to put them in main loop or not Can someone give me some idea of different ways of using them.Thanks Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Daimour Posted March 12, 2012 Share Posted March 12, 2012 They will be useful If physics is a part of gameplay. Examples: 1. Picking up and levitating (carrying) crates. 2. Pushing (shooting) cannonball. 3. Kicking the ball in football /baseball / tennis. 4. Imitation of the blast wave. 5. Moving parts of machinery. And so on... Quote Link to comment Share on other sites More sharing options...
Mumbles Posted March 12, 2012 Share Posted March 12, 2012 SetBodyVelocity sets an absolute speed on a body. Use it to make a body move at a certain speed. Be careful though because setting a Y velocity of 0 will "remove" gravity's influence, which can cause an object to be suspended in mid-air SetBodyForce applies to specified force to the body. Speed however is not constant, because an object with a large surface area suffers greater friction than an object with a smaller surface area. AddBodyForce is the same as SetBodyForce, but it takes into account any forces already acting on the body rather than overwriting them with the new one. In the C newton interface, the force commands can only be used during the ApplyForceAndTorque callback. I believe however in Leadwerks that these can be called at any time, because the callback is hidden from you, and these functions instead probably just update a hidden variable called something like BodyForce, which is then read in the hidden callback. SetBodyVelocity can always be used at any time, both in Leadwerks, and in the C newton interface. 1 Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
cassius Posted March 12, 2012 Author Share Posted March 12, 2012 Thanks for explanations. I have a problem with enemy controller where the controller slides backwards constantly after coming near main character and I wondered if any of the force commands were of any use with this problem. From your explanation it seems something else is causing it..I am not using any forces currently. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Daimour Posted March 13, 2012 Share Posted March 13, 2012 Do you using controllers for both NPCs and main character? Do you moving controllers with UpdateController() function? Don't you scale controllers? Scaling physics bodies causing problems with colliding. I have no any problems with collided controllers. You can see it in video below. Quote Link to comment Share on other sites More sharing options...
cassius Posted March 13, 2012 Author Share Posted March 13, 2012 I fixed all controller problems now exept one.After my enemy character goes through its die routine it slides across floor. Maybe I should use freeEntity on enemy controller once the character is dead. This only happens when I move main character(player) Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
cassius Posted March 13, 2012 Author Share Posted March 13, 2012 Yeah. freeing the enemy controller works fine. All problems solved. Thanks for help. Like video. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.