Adds the given sequence of bodies to this world
Adds the given sequence of bodies to this world.
Adds the given prefabricated system of bodies and joints to this world
Adds the given prefabricated system of bodies and joints to this world.
Adds the given joint to this world
Adds the given joint to this world.
Adds the given body to this world
Adds the given body to this world.
Removes the given sequence of bodies from this world
Removes the given sequence of bodies from this world.
Removes the given prefabricated system of bodies and joints from this world
Removes the given prefabricated system of bodies and joints from this world.
Removes the given joint from this world
Removes the given joint from this world.
Removes the given body from this world
Removes the given body from this world.
Bodies contained in this world
Bodies contained in this world.
Removes all bodies, joints and monitoring methods from this world
Removes all bodies, joints and monitoring methods from this world.
Collsion detector who manages collision detection in this world
Collsion detector who manages collision detection in this world.
Flag to enable collision detection
Flag to enable collision detection.
Flag to enable position correction for constraints
Flag to enable position correction for constraints.
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.
Gravity in this world
Gravity in this world.
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.
Returns information about this world
Returns information about this world.
Number of constraint corrections per time step
Number of constraint corrections per time step.
Joints contained in this world
Joints contained in this world.
Minimal, non-zero angular velocity
Minimal, non-zero angular velocity.
Minimal, non-zero linear velocity
Minimal, non-zero linear velocity.
Monitoring methods for bodies
Monitoring methods for bodies.
The first element of the tuple is the method's title and the second the method.
Example usage: monitors += ("Y-Position", _.pos.y.toString)
This will calculate all bodies - whose monitor
field is set to
true
- second position components.
Warning if a body's velocity exceeds the speed of light
Warning if a body's velocity exceeds the speed of light.
Initially empty method that is executed after each time step
Initially empty method that is executed after each time step. This method may be overriden to create custom behaviour in a world.
Returns all shapes of all bodies in this world
Returns all shapes of all bodies in this world.
Simulates a time step of the duration timeStep
Simulates a time step of the duration timeStep
.
The time step is simulated in the following phases:
postStep()
is executed.Current time in this world
Current time in this world.
Time intervals in which this world simulates
Time intervals in which this world simulates.
Returns a string representation of the object
Returns a string representation of the object.
The default representation is platform dependent.
A world contains and simulates a system of rigid bodies and joints.