/** * Apply an angular impulse. * * @param impulse the angular impulse in units of kg*m*m/s */ public void applyAngularImpulse(float impulse) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { setAwake(true); } m_angularVelocity += m_invI * impulse; }
/** * Apply an angular impulse. * * @param impulse the angular impulse in units of kg*m*m/s */ public void applyAngularImpulse(float impulse) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { setAwake(true); } m_angularVelocity += m_invI * impulse; }
/** * Apply a torque. * This affects the angular velocity without affecting the linear velocity of the center of mass. * This wakes up the body. * * @param torque about the z-axis (out of the screen), usually in N-m */ public void applyTorque(float torque) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { setAwake(true); } m_torque += torque; }
/** * Apply a torque. * This affects the angular velocity without affecting the linear velocity of the center of mass. * This wakes up the body. * * @param torque about the z-axis (out of the screen), usually in N-m */ public void applyTorque(float torque) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { setAwake(true); } m_torque += torque; }
/** * Apply an impulse at a point. * This immediately modifies the velocity. * It also modifies the angular velocity if the point of application is not at the center of mass. * This wakes up the body if 'wake' is set to true. * If the body is sleeping and 'wake' is false, then there is no effect. * * @param impulse the world impulse vector, usually in N-seconds or kg-m/s * @param point the world position of the point of application * @param wake also wake up the body */ public void applyLinearImpulse(Vec2 impulse, Vec2 point, boolean wake) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { if (wake) { setAwake(true); } else { return; } } m_linearVelocity.x += impulse.x * m_invMass; m_linearVelocity.y += impulse.y * m_invMass; m_angularVelocity += m_invI * ((point.x - m_sweep.c.x) * impulse.y - (point.y - m_sweep.c.y) * impulse.x); }
/** * Apply an impulse at a point. * This immediately modifies the velocity. * It also modifies the angular velocity if the point of application is not at the center of mass. * This wakes up the body if 'wake' is set to true. * If the body is sleeping and 'wake' is false, then there is no effect. * * @param impulse the world impulse vector, usually in N-seconds or kg-m/s * @param point the world position of the point of application * @param wake also wake up the body */ public void applyLinearImpulse(Vec2 impulse, Vec2 point, boolean wake) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { if (wake) { setAwake(true); } else { return; } } m_linearVelocity.x += impulse.x * m_invMass; m_linearVelocity.y += impulse.y * m_invMass; m_angularVelocity += m_invI * ((point.x - m_sweep.c.x) * impulse.y - (point.y - m_sweep.c.y) * impulse.x); }
public void setTarget(Vec2 target) { if (m_bodyB.isAwake() == false) { m_bodyB.setAwake(true); } m_targetA.set(target); }
public void setTarget(Vec2 target) { if (m_bodyB.isAwake() == false) { m_bodyB.setAwake(true); } m_targetA.set(target); }
/** * Apply a force to the center of mass. * This wakes up the body. * * @param force the world force vector, usually in Newtons (N) */ public void applyForceToCenter(Vec2 force) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { setAwake(true); } m_force.addLocal(force); }
/** * Apply a force to the center of mass. * This wakes up the body. * * @param force the world force vector, usually in Newtons (N) */ public void applyForceToCenter(Vec2 force) { if (type != BodyType.DYNAMIC) { return; } if (!isAwake()) { setAwake(true); } m_force.addLocal(force); }
if (!seed.isAwake() || !seed.isActive()) { continue;
if (!seed.isAwake() || !seed.isActive()) { continue;