Panda3D
Public Member Functions | List of all members
PhysicsManager Class Reference

Physics don't get much higher-level than this. More...

Public Member Functions

 __init__ ()
 Default Constructor. More...
 
 __init__ (const PhysicsManager)
 
 addAngularForce (AngularForce f)
 Adds a global angular force to the physics manager. More...
 
 addLinearForce (LinearForce f)
 Adds a global linear force to the physics manager. More...
 
 attachAngularIntegrator (AngularIntegrator i)
 Hooks an angular integrator into the manager. More...
 
 attachLinearIntegrator (LinearIntegrator i)
 Hooks a linear integrator into the manager. More...
 
 attachPhysical (Physical p)
 Registers a Physical class with the manager. More...
 
 attachPhysicalnode (PhysicalNode p)
 Please call attach_physical_node instead. More...
 
 attachPhysicalNode (PhysicalNode p)
 Registers a physicalnode with the manager. More...
 
 clearAngularForces ()
 Resets the physics manager force vector. More...
 
 clearLinearForces ()
 Resets the physics manager force vector. More...
 
 clearPhysicals ()
 Resets the physics manager objects vector. More...
 
 debugOutput (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 doPhysics (float dt)
 This is the main high-level API call. More...
 
 doPhysics (float dt, Physical p)
 This is the main high-level API call. More...
 
float getViscosity ()
 Get the global viscosity. More...
 
 initRandomSeed ()
 One-time config function, sets up the random seed used by the physics and particle systems. More...
 
 output (Ostream out)
 Write a string representation of this instance to <out>. More...
 
 removeAngularForce (AngularForce f)
 takes an angular force out of the physics list More...
 
 removeLinearForce (LinearForce f)
 takes a linear force out of the physics list More...
 
 removePhysical (Physical p)
 takes a physical out of the object list More...
 
 removePhysicalNode (PhysicalNode p)
 Removes a physicalnode from the manager. More...
 
 setViscosity (float viscosity)
 Set the global viscosity. More...
 
 write (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 writeAngularForces (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 writeLinearForces (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 writePhysicals (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 

Detailed Description

Physics don't get much higher-level than this.

Attach as many Physicals (particle systems, etc..) as you want, pick an integrator and go.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

Default Constructor.

NOTE: EulerIntegrator is the standard default.

◆ __init__() [2/2]

__init__ ( const  PhysicsManager)

◆ addAngularForce()

addAngularForce ( AngularForce  f)

Adds a global angular force to the physics manager.

◆ addLinearForce()

addLinearForce ( LinearForce  f)

Adds a global linear force to the physics manager.

◆ attachAngularIntegrator()

attachAngularIntegrator ( AngularIntegrator  i)

Hooks an angular integrator into the manager.

◆ attachLinearIntegrator()

attachLinearIntegrator ( LinearIntegrator  i)

Hooks a linear integrator into the manager.

◆ attachPhysical()

attachPhysical ( Physical  p)

Registers a Physical class with the manager.

◆ attachPhysicalnode()

attachPhysicalnode ( PhysicalNode  p)

Please call attach_physical_node instead.

◆ attachPhysicalNode()

attachPhysicalNode ( PhysicalNode  p)

Registers a physicalnode with the manager.

◆ clearAngularForces()

clearAngularForces ( )

Resets the physics manager force vector.

◆ clearLinearForces()

clearLinearForces ( )

Resets the physics manager force vector.

◆ clearPhysicals()

clearPhysicals ( )

Resets the physics manager objects vector.

◆ debugOutput()

debugOutput ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ doPhysics() [1/2]

doPhysics ( float  dt)

This is the main high-level API call.

Performs integration on every attached Physical.

◆ doPhysics() [2/2]

doPhysics ( float  dt,
Physical  p 
)

This is the main high-level API call.

Performs integration on a single physical. Make sure its associated forces are active.

◆ getViscosity()

float getViscosity ( )

Get the global viscosity.

◆ initRandomSeed()

initRandomSeed ( )

One-time config function, sets up the random seed used by the physics and particle systems.

For synchronizing across distributed computers

◆ output()

output ( Ostream  out)

Write a string representation of this instance to <out>.

◆ removeAngularForce()

removeAngularForce ( AngularForce  f)

takes an angular force out of the physics list

◆ removeLinearForce()

removeLinearForce ( LinearForce  f)

takes a linear force out of the physics list

◆ removePhysical()

removePhysical ( Physical  p)

takes a physical out of the object list

◆ removePhysicalNode()

removePhysicalNode ( PhysicalNode  p)

Removes a physicalnode from the manager.

◆ setViscosity()

setViscosity ( float  viscosity)

Set the global viscosity.

◆ write()

write ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ writeAngularForces()

writeAngularForces ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ writeLinearForces()

writeLinearForces ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ writePhysicals()

writePhysicals ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.