Returns the moment of inertia for rotations about the COM of this body
Returns the moment of inertia for rotations about the COM of this body.
It is calculated using the moments of inertia of this body's shapes and the parallel axis theorem.
If the body is fixed, its moment of inertia is infinite (Double.PositiveInfinity
).
Angular velocity of this body
Angular velocity of this body.
Applies a force to a point on this body
Applies a force to a point on this body. Warning: the point is considered to be contained within this body.
applied force
position vector of the point (in world coordinates)
Applies a force to the COM of this body
Applies a force to the COM of this body.
applied force
Applies an impulse to a point on this body
Applies an impulse to a point on this body. Warning: the point is considered to be contained within this body.
applied impulse
position vector of the point (in world coordinates)
Applies an impulse to the COM of this body
Applies an impulse to the COM of this body.
applied impulse
Checks if the point point
is contained in this body
Checks if the point point
is contained in this body.
This method is used to compare the receiver object (this
)
with the argument object (arg0
) for equivalence
This method is used to compare the receiver object (this
)
with the argument object (arg0
) for equivalence.
The default implementations of this method is an equivalence relation:
x
of type Any
,
x.equals(x)
should return true
.x
and y
of type
Any
, x.equals(y)
should return true
if and only
if y.equals(x)
returns true
.x
, y
, and z
of type AnyRef
if x.equals(y)
returns true
and
y.equals(z)
returns
true
, then x.equals(z)
should return true
.
If you override this method, you should verify that
your implementation remains an equivalence relation.
Additionally, when overriding this method it is often necessary to
override hashCode
to ensure that objects that are
"equal" (o1.equals(o2)
returns true
)
hash to the same Int
(o1.hashCode.equals(o2.hashCode)
).
the object to compare against this object for equality.
true
if the receiver object is equivalent to the argument; false
otherwise.
Returns whether this body is fixed or not
Returns whether this body is fixed or not.
Fixes or frees this body
Fixes or frees this body. By fixing, linear and angular velocities are set to zero.
Resulting force on the COM of this body
Resulting force on the COM of this body.
Returns a hash code value for the object
Returns a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash
codes (o1.hashCode.equals(o2.hashCode)
) yet not be
equal (o1.equals(o2)
returns false
). A
degenerate implementation could always return 0
.
However, it is required that if two objects are equal
(o1.equals(o2)
returns true
) that they
have identical hash codes
(o1.hashCode.equals(o2.hashCode)
). Therefore, when
overriding this method, be sure to verify that the behavior is
consistent with the equals
method.
Linear velocity of this body
Linear velocity of this body.
Returns the mass of this body
Returns the mass of this body. If the body is free, its mass is the sum of the masses of its shapes.
If the body is fixed, its mass is infinite (Double.PositiveInfinity
).
Flag for a world to monitor the properties of this body
Flag for a world to monitor the properties of this body.
Returns the position of this body
Returns the position of this body. The position is equivalent to the center of mass.
Sets the position of this body
Sets the position of this body. By doing so all its shapes are translated.
new position
Returns the current rotation of this body
Returns the current rotation of this body.
Sets the rotation of this body
Sets the rotation of this body. Position and rotation of shapes are modified accordingly.
Shapes that belong to this body
Shapes that belong to this body.
Returns a string representation of the object
Returns a string representation of the object.
The default representation is platform dependent.
Resulting torque on this body
Resulting torque on this body.
Unique identification number
Unique identification number.
Linear velocity of the given point on this body (in world coordinates)
Linear velocity of the given point on this body (in world coordinates).
Creates a new body containing this body's shapes and the shapes of another body b
Creates a new body containing this body's shapes and the shapes of another body b
.
body with extra shapes
new body
Creates a new body containing this body's shapes and the shape s
Creates a new body containing this body's shapes and the shape s
.
new shape
new body
A two dimensional rigid body is made out of shapes.