|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.bullet.BulletAppState
public class BulletAppState
BulletAppState
allows using bullet physics in an Application.
Nested Class Summary | |
---|---|
static class |
BulletAppState.ThreadingType
|
Field Summary | |
---|---|
protected boolean |
active
|
protected Application |
app
|
protected PhysicsSpace.BroadphaseType |
broadphaseType
|
protected java.util.concurrent.ScheduledThreadPoolExecutor |
executor
|
protected boolean |
initialized
|
protected java.util.concurrent.Future |
physicsFuture
|
protected PhysicsSpace |
pSpace
|
protected AppStateManager |
stateManager
|
protected BulletAppState.ThreadingType |
threadingType
|
protected float |
tpf
|
protected Vector3f |
worldMax
|
protected Vector3f |
worldMin
|
Constructor Summary | |
---|---|
BulletAppState()
Creates a new BulletAppState running a PhysicsSpace for physics simulation, use getStateManager().addState(bulletAppState) to enable physics for an Application. |
|
BulletAppState(PhysicsSpace.BroadphaseType broadphaseType)
Creates a new BulletAppState running a PhysicsSpace for physics simulation, use getStateManager().addState(bulletAppState) to enable physics for an Application. |
|
BulletAppState(Vector3f worldMin,
Vector3f worldMax)
Creates a new BulletAppState running a PhysicsSpace for physics simulation, use getStateManager().addState(bulletAppState) to enable physics for an Application. |
|
BulletAppState(Vector3f worldMin,
Vector3f worldMax,
PhysicsSpace.BroadphaseType broadphaseType)
|
Method Summary | |
---|---|
void |
cleanup()
Cleanup the game state. |
PhysicsSpace |
getPhysicsSpace()
|
float |
getSpeed()
|
BulletAppState.ThreadingType |
getThreadingType()
|
void |
initialize(AppStateManager stateManager,
Application app)
Called to initialize the AppState. |
boolean |
isEnabled()
|
boolean |
isInitialized()
|
void |
physicsTick(PhysicsSpace space,
float f)
Called after the physics has been stepped, use to check for forces etc. |
void |
postRender()
Called after all rendering commands are flushed. |
void |
prePhysicsTick(PhysicsSpace space,
float f)
Called before the physics is actually stepped, use to apply forces etc. |
void |
render(RenderManager rm)
Render the state. |
void |
setBroadphaseType(PhysicsSpace.BroadphaseType broadphaseType)
Use before attaching state |
void |
setEnabled(boolean enabled)
Enable or disable the functionality of the AppState . |
void |
setSpeed(float speed)
|
void |
setThreadingType(BulletAppState.ThreadingType threadingType)
Use before attaching state |
void |
setWorldMax(Vector3f worldMax)
Use before attaching state |
void |
setWorldMin(Vector3f worldMin)
Use before attaching state |
void |
startPhysics()
The physics system is started automatically on attaching, if you want to start it before for some reason, you can use this method. |
void |
stateAttached(AppStateManager stateManager)
Called when the state was attached. |
void |
stateDetached(AppStateManager stateManager)
Called when the state was detached. |
void |
update(float tpf)
Called to update the state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean initialized
protected Application app
protected AppStateManager stateManager
protected java.util.concurrent.ScheduledThreadPoolExecutor executor
protected PhysicsSpace pSpace
protected BulletAppState.ThreadingType threadingType
protected PhysicsSpace.BroadphaseType broadphaseType
protected Vector3f worldMin
protected Vector3f worldMax
protected boolean active
protected float tpf
protected java.util.concurrent.Future physicsFuture
Constructor Detail |
---|
public BulletAppState()
public BulletAppState(PhysicsSpace.BroadphaseType broadphaseType)
broadphaseType
- The type of broadphase collision detection, BroadphaseType.DVBT is the defaultpublic BulletAppState(Vector3f worldMin, Vector3f worldMax)
worldMin
- The minimum world extentworldMax
- The maximum world extentpublic BulletAppState(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType)
Method Detail |
---|
public PhysicsSpace getPhysicsSpace()
public void startPhysics()
public void initialize(AppStateManager stateManager, Application app)
AppState
initialize
in interface AppState
stateManager
- The state managerpublic boolean isInitialized()
isInitialized
in interface AppState
initialize()
was called on the state,
false otherwise.public void setEnabled(boolean enabled)
AppState
AppState
.
The effect of this call depends on implementation. An
AppState
starts as being enabled by default.
setEnabled
in interface AppState
enabled
- activate the AppState or not.public boolean isEnabled()
isEnabled
in interface AppState
AppState
is enabled, false otherwise.AppState.setEnabled(boolean)
public void stateAttached(AppStateManager stateManager)
AppState
stateAttached
in interface AppState
stateManager
- State manager to which the state was attached to.public void stateDetached(AppStateManager stateManager)
AppState
stateDetached
in interface AppState
stateManager
- The state manager from which the state was detached from.public void update(float tpf)
AppState
update
in interface AppState
tpf
- Time per frame.public void render(RenderManager rm)
AppState
render
in interface AppState
rm
- RenderManagerpublic void postRender()
AppState
postRender
in interface AppState
public void cleanup()
AppState
cleanup
in interface AppState
public BulletAppState.ThreadingType getThreadingType()
public void setThreadingType(BulletAppState.ThreadingType threadingType)
threadingType
- the threadingType to setpublic void setBroadphaseType(PhysicsSpace.BroadphaseType broadphaseType)
public void setWorldMin(Vector3f worldMin)
public void setWorldMax(Vector3f worldMax)
public float getSpeed()
public void setSpeed(float speed)
public void prePhysicsTick(PhysicsSpace space, float f)
PhysicsTickListener
prePhysicsTick
in interface PhysicsTickListener
space
- the physics spacef
- the time per frame in secondspublic void physicsTick(PhysicsSpace space, float f)
PhysicsTickListener
physicsTick
in interface PhysicsTickListener
space
- the physics spacef
- the time per frame in seconds
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |