Package com.xebisco.yield.physics
Class PhysicsBody
java.lang.Object
com.xebisco.yield.AbstractBehavior
com.xebisco.yield.ComponentBehavior
com.xebisco.yield.physics.PhysicsBody
- All Implemented Interfaces:
Behavior,Renderable,Closeable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContactListener(org.jbox2d.callbacks.ContactListener contactListener) booleandoublevoidapplyAngularImpulse(double impulse) voidapplyForce(Vector2D force) voidapplyLinearImpulse(Vector2D impulse) voidapplyTorque(double torque) org.jbox2d.dynamics.Bodyb2Body()booleanbullet()voidclose()Called when the behavior is closed.List<org.jbox2d.callbacks.ContactListener>booleandoubledoublevoidonCreate()Called when the behavior is created.voidonLateUpdate(ContextTime time) Called after allComponentBehavior.onUpdate(ContextTime)calls.voidonUpdate(ContextTime time) Called every frame.setAllowSleep(boolean allowSleep) setAngularDamping(double angularDamping) setB2Body(org.jbox2d.dynamics.Body b2Body) setBullet(boolean bullet) setFixedRotation(boolean fixedRotation) setGravityScale(double gravityScale) setLinearDamping(double linearDamping) setLinearVelocity(Vector2D linearVelocity) type()Methods inherited from class com.xebisco.yield.ComponentBehavior
application, component, component, entity, onStart, render, renderIndex, setEntity, setRenderIndex, texture, texture, transformMethods inherited from class com.xebisco.yield.AbstractBehavior
frames, tick
-
Constructor Details
-
PhysicsBody
public PhysicsBody()
-
-
Method Details
-
onCreate
public void onCreate()Description copied from class:ComponentBehaviorCalled when the behavior is created.- Overrides:
onCreatein classComponentBehavior
-
close
public void close()Description copied from class:ComponentBehaviorCalled when the behavior is closed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classComponentBehavior
-
applyForce
-
applyLinearImpulse
-
applyTorque
public void applyTorque(double torque) -
linearVelocity
-
setLinearVelocity
-
applyAngularImpulse
public void applyAngularImpulse(double impulse) -
onUpdate
Description copied from class:ComponentBehaviorCalled every frame.- Specified by:
onUpdatein interfaceBehavior- Overrides:
onUpdatein classComponentBehavior- Parameters:
time- The context time.
-
onLateUpdate
Description copied from class:ComponentBehaviorCalled after allComponentBehavior.onUpdate(ContextTime)calls.- Overrides:
onLateUpdatein classComponentBehavior- Parameters:
time- The context time.
-
addContactListener
public void addContactListener(org.jbox2d.callbacks.ContactListener contactListener) -
type
-
setType
-
b2Body
public org.jbox2d.dynamics.Body b2Body() -
setB2Body
-
linearDamping
public double linearDamping() -
setLinearDamping
-
angularDamping
public double angularDamping() -
setAngularDamping
-
allowSleep
public boolean allowSleep() -
setAllowSleep
-
fixedRotation
public boolean fixedRotation() -
setFixedRotation
-
bullet
public boolean bullet() -
setBullet
-
gravityScale
public double gravityScale() -
setGravityScale
-
contactListeners
-