public class PhysicsMotor extends Object
| Constructor and Description |
|---|
PhysicsMotor(Body body1,
Body body2,
Vector2 anchorPoint)
Another constructor which defines and creates the RevoluteJoint.
|
PhysicsMotor(Body body1,
Body body2,
Vector2 anchorPoint,
float motorSpeed,
float maxMotorTorque,
boolean motorEnable)
Constructor which defines and creates the
RevoluteJoint. |
| Modifier and Type | Method and Description |
|---|---|
void |
enableLimit(boolean flag) |
void |
enableMotor(boolean flag) |
float |
getAngle() |
RevoluteJoint |
getJoint() |
Vector2 |
getLocalAnchorA() |
Vector2 |
getLocalAnchorB() |
float |
getLowerLimit() |
float |
getMaxMotortorque(float invDt) |
float |
getMotorSpeed() |
float |
getSpeed() |
float |
getUpperLimit() |
void |
initializeMotor(float speed,
float torque,
boolean enable)
Initialize the motor with the desired parameters.
|
boolean |
isLimitEnabled() |
boolean |
isMotorEnabled() |
void |
setLimits(float lower,
float upper) |
void |
setLowerLimit(float lower) |
void |
setMaxMotorTorque(float torque) |
void |
setMotorSpeed(float speed) |
void |
setUpperLimit(float upper) |
public PhysicsMotor(Body body1, Body body2, Vector2 anchorPoint, float motorSpeed, float maxMotorTorque, boolean motorEnable)
RevoluteJoint.
It also sets the desired information for the PhysicsMotor.body1 - The first body for the jointbody2 - The second body for the jointanchorPoint - The point that links the two objectsmotorSpeed - The speed of the motormaxMotorTorque - The maximum torque that the motor can exertmotorEnable - If the motor is enabled or notpublic PhysicsMotor(Body body1, Body body2, Vector2 anchorPoint)
PhysicsMotor(Body, Body, Vector2, float, float, boolean)body1 - The first body for the jointbody2 - The second body for the jointanchorPoint - The point that links the two objectspublic void enableLimit(boolean flag)
public void enableMotor(boolean flag)
public float getAngle()
public float getSpeed()
public Vector2 getLocalAnchorA()
public Vector2 getLocalAnchorB()
public float getLowerLimit()
public float getMotorSpeed()
public float getMaxMotortorque(float invDt)
public float getUpperLimit()
public boolean isLimitEnabled()
public boolean isMotorEnabled()
public void setLowerLimit(float lower)
public void setUpperLimit(float upper)
public void setLimits(float lower,
float upper)
public void setMaxMotorTorque(float torque)
public void setMotorSpeed(float speed)
public void initializeMotor(float speed,
float torque,
boolean enable)
PhysicsMotor.speed - The new speed for the joint motortorque - The new torque value for the joint motorenable - The new state for the joint motorpublic RevoluteJoint getJoint()
Copyright © 2014-2016 gdx2d - https://github.com/hevs-isi/gdx2d