AddCentralForce

(Difference between revisions)
Jump to: navigation, search
(Created page with "Add a force than an object. Make sure Physics and the mass of the object is enabled in the object proprieties, otherwise it won't move. Example 1 : Simple usage object =...")
 
Line 1: Line 1:
 
Add a force than an object. Make sure Physics and the mass of the object is enabled in the object proprieties,
 
Add a force than an object. Make sure Physics and the mass of the object is enabled in the object proprieties,
otherwise it won't move.
+
otherwise it won't move.<br>
 +
''The "local" argument is optional (local coordinates), without it the transformation is global (global coordinates).''
 +
 
  
 
Example 1 : Simple usage
 
Example 1 : Simple usage

Revision as of 20:45, 5 August 2012

Add a force than an object. Make sure Physics and the mass of the object is enabled in the object proprieties, otherwise it won't move.
The "local" argument is optional (local coordinates), without it the transformation is global (global coordinates).


Example 1 : Simple usage

   object = getObject("object") 
   function onSceneUpdate()
       addCentralForce(object, {1, 0, 0}, "local")
   end

Example 2 : Use a variable to determinate the force

   object = getObject("object") 
   power = 1
   function onSceneUpdate()
       addCentralForce(object, {power, 0, 0}, "local")
   end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox