linearVelocity property

Vector2 linearVelocity

The linear velocity of the center of mass. Do not modify directly, instead use applyLinearImpulse or applyForce.

Implementation

final Vector2 linearVelocity = Vector2.zero();
void linearVelocity=(Vector2 velocity)

Set the linear velocity of the center of mass.

Implementation

set linearVelocity(Vector2 velocity) {
  if (_bodyType == BodyType.static) {
    return;
  }

  if (velocity.dot(velocity) > 0.0) {
    setAwake(true);
  }

  linearVelocity.setFrom(velocity);
}