Panda3D Manual: Types of forces
  <<prev top next>>     

Panda3D provides several types of forces that you can apply to an object.

LinearVectorForce

A LinearVectorForce accelerates the center of mass of an object along a straight line. The direction of the line is determined by the relative orientations of the NodePath controlled by the ActorNodea and the ForceNode to which the LinearVectorForce is assigned.

lvf=LinearVectorForce(1,0,0) # push 1 newton in the positive-x direction
forceNode.addForce(lvf) # determine coordinate space of this force node
actorNode.getPhysical(0).addLinearForce(lvf)

AngularVectorForce

The AngularVectorForce changes the angular momentum of the object to which it is applied. Note that angular forces are applied to an object using the addAngularForce method, not the addLinearForce method used above.

avf=AngularVectorForce(1,0,0) # spin around the positive-x axis
forceNode.addForce(avf) #determine which positive-x axis we use for calculation
actorNode.getPhysical(0).addAngularForce(avf)

Editorial note: The linear vector force is the only one I have worked with as of right now. If anyone could flesh out this section with more detail or more forces, it would be greatly appreciated!

  <<prev top next>>