anchor.diff:  = Physics: Gravity, Collisions, Forces
  -:author: 
  -:revnumber: 
  +:author:
  +:revnumber:
   :revdate: 2016/03/17 20:48
   :keywords: physics, documentation, control
   :relfileprefix: ../../
   :imagesdir: ../..
  +ifdef::backend-html5[]
  +:twoinches: width='144'
  +:full-width: width='100%'
  +:half-width: width='50%'
  +:third-width: width='33%'
  +:quarter-width: width='25%'
  +:half-size:
  +:thumbnail: width='60'
  +endif::[]
   ifdef::env-github,env-browser[:outfilesuffix: .adoc]
   
   
   A physics simulation is used in games and applications where objects are exposed to physical forces: Think of games like pool billiard and car racing simulators. Massive objects are pulled by gravity, forces cause objects to gain momentum, friction slows them down, solid objects collide and bounce off one another, etc. Action and Adventure games also make use of physics to implement solid obstacles, falling, and jumping.
   
  -The jMonkeyEngine3 has built-in support for link:http://jbullet.advel.cz[jBullet Physics] (based on link:http://bulletphysics.org[Bullet Physics]) via the `com.jme3.bullet` package. This article focuses mostly on the RigidBodyControl, but also introduces you to others. 
  +The jMonkeyEngine3 has built-in support for link:http://jbullet.advel.cz[jBullet Physics] (based on link:http://bulletphysics.org[Bullet Physics]) via the `com.jme3.bullet` package. This article focuses mostly on the RigidBodyControl, but also introduces you to others.
   
   If you are looking for info on how to respond to physics events such as collisions, read about <<jme3/advanced/physics_listeners#,Physics Listeners>>.
   
  
positive.code: 
  == Add PhysicsControl to PhysicsSpace
  
  The PhysicsSpace is an object in BulletAppState that is like a rootNode for Physics Controls. 
  
  *  Just like you add the Geometry to the rootNode, you add its PhysicsControl to the PhysicsSpace. 
  [source,java]
  ----
  bulletAppState.getPhysicsSpace().add(myThing_phys); 
  rootNode.attachChild(myThing_geo); 
  ----
  
  *  When you remove a Geometry from the scene and detach it from the rootNode, also remove the PhysicsControl from the PhysicsSpace: 
  [source,java]
  ----
  bulletAppState.getPhysicsSpace().remove(myThing_phys);
  
negative.code: 
  // Doesn't scale
  // This modified version contains Node -> Geometry (name = "MonkeyHeadGeom")
  Spatial model = assetManager.loadModel("Models/MonkeyHead.j3o");
  model.addControl(new RigidBodyControl(0));
  // Won't work as this is now a CompoundCollisionShape containing a MeshCollisionShape
  model.getControl(RigidBodyControl.class).getCollisionShape().setScale(new Vector3f(2, 2, 2));
  bulletAppState.getPhysicsSpace().add(model);
  
  // Works fine
  