StaticBody class
Allocate and initialize a cpBody, and set it as a static body.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isExist → bool
-
no setterinherited
- isSleeping → bool
-
Returns true if the body is sleeping.
no setterinherited
- kineticEnergy → double
-
Get the amount of kinetic energy contained by the body.
no setterinherited
- p ↔ Vector2
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sleeping → Sleeping
-
no setterinherited
- transform → Matrix4
-
no setterinherited
- v ↔ Vector2
-
getter/setter pairinherited
Methods
-
activate(
) → void -
Wake up a sleeping or idle body.
inherited
-
activateStatic(
Shape filter) → void -
Wake up any sleeping or idle bodies touching a static body.
inherited
-
applyForceAtLocalPoint(
{required Vector2 force, required Vector2 point}) → void -
Apply a force to a body. Both the force and point are expressed in body local coordinates.
inherited
-
applyForceAtWorldPoint(
{required Vector2 force, required Vector2 point}) → void -
Apply a force to a body. Both the force and point are expressed in world coordinates.
inherited
-
applyImpulseAtLocalPoint(
{required Vector2 impulse, required Vector2 point}) → void -
Apply an impulse to a body. Both the impulse and point are expressed in world coordinates.
inherited
-
applyImpulseAtWorldPoint(
{required Vector2 impulse, required Vector2 point}) → void -
Apply an impulse to a body. Both the impulse and point are expressed in world coordinates.
inherited
-
destroy(
) → void -
Destroy a Body.
inherited
-
eachArbiter(
void arbiterFunc(Body body, Arbiter arbiter)) → void -
Call @c func once for each arbiter that is currently active on the body.
inherited
-
eachConstraint(
void constraintFunc(Body body, Constraint constraint)) → void -
Call @c func once for each constraint attached to @c body and added to the space.
inherited
-
eachShape(
void shapeFunc(Body body, Shape shape)) → void -
Call @c func once for each shape attached to @c body and added to the space.
inherited
-
getAngle(
) → double -
Get the angle of the body.
inherited
-
getAngularVelocity(
) → double -
Get the angular velocity of the body.
inherited
-
getCenterOfGravity(
) → Vector2 -
Get the offset of the center of gravity in body local coordinates.
inherited
-
getData<
T> () → T? -
Get the user data assigned to the body.
inherited
-
getForce(
) → Vector2 -
Get the force applied to the body for the next time step.
inherited
-
getMass(
) → double -
Get the mass of the body.
inherited
-
getMoment(
) → double -
Get the moment of inertia of the body.
inherited
-
getPosition(
) → Vector2 -
Set the position of a body.
inherited
-
getRotation(
) → Vector2 -
Get the rotation vector of the body. (The x basis vector of it's transform.)
inherited
-
getSpace(
) → Space -
Get the space this body is added to.
inherited
-
getTorque(
) → double -
Get the torque applied to the body for the next time step.
inherited
-
getType(
) → BodyType -
Get the type of the body.
inherited
-
getVelocity(
) → Vector2 -
Get the velocity of the body.
inherited
-
getVelocityAtLocalPoint(
Vector2 point) → Vector2 -
Get the velocity on a body (in world units) at a point on the body in local coordinates.
inherited
-
getVelocityAtWorldPoint(
{required Vector2 point}) → Vector2 -
Get the velocity on a body (in world units) at a point on the body in world coordinates.
inherited
-
localToWorld(
Vector2 point) → Vector2 -
Convert body relative/local coordinates to absolute/world coordinates.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeData(
) → void -
Remove the user data assigned to the body.
inherited
-
setAngle(
double a) → void -
Set the angle of a body.
inherited
-
setAngularVelocity(
double angularVelocity) → void -
Set the angular velocity of the body.
inherited
-
setCenterOfGravity(
Vector2 cog) → void -
Set the offset of the center of gravity in body local coordinates.
inherited
-
setData<
T> (T data) → void -
Set the user data assigned to the body.
inherited
-
setForce(
Vector2 force) → void -
Set the force applied to the body for the next time step.
inherited
-
setMass(
double m) → void -
Set the mass of the body.
inherited
-
setMoment(
double i) → void -
Set the moment of inertia of the body.
inherited
-
setPosition(
{required Vector2 pos}) → void -
Set the position of the body.
inherited
-
setPositionUpdateFunc(
void positionFunc(Body body, double dt)) → void -
Set the callback used to update a body's position.
NOTE: It's not generally recommended to override this unless you call the default position update function.
inherited
-
setTorque(
double torque) → void -
Set the torque applied to the body for the next time step.
inherited
-
setType(
BodyType type) → void -
Set the type of the body.
inherited
-
setVelocity(
{required Vector2 vel}) → void -
Set the velocity of the body.
inherited
-
setVelocityUpdateFunc(
void velocityFunc(Body body, Vector2 gravity, double damping, double dt)) → void -
Set the callback used to update a body's velocity.
inherited
-
sleep(
) → void -
Force a body to fall asleep immediately.
inherited
-
sleepWithGroup(
Body body) → void -
Force a body to fall asleep immediately along with other bodies in a group.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updatePosition(
double dt) → void -
Default position integration function.
inherited
-
updateVelocity(
{required Vector2 gravity, required double damping, required double dt}) → void -
Default velocity integration function..
inherited
-
worldToLocal(
Vector2 point) → Vector2 -
Convert body absolute/world coordinates to relative/local coordinates.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited