SiMS
|
|
sims/dynamics/World.scala
]
class
World
extends
AnyRefValue Summary | |
val
|
bodies
: scala.collection.mutable.ArrayBuffer[Body]
Bodies contained in this world.
|
val
|
detector
: Detector
Collsion detector who manages collision detection in this world.
|
var
|
enableCollisionDetection
: Boolean
Flag to enable collision detection.
|
var
|
enablePositionCorrection
: Boolean
Flag to enable position correction for constraints.
|
var
|
gravity
: Vector2D
Gravity in this world.
|
var
|
iterations
: Int
Number of constraint corrections per time step.
|
val
|
joints
: scala.collection.mutable.ArrayBuffer[Joint]
Joints contained in this world.
|
var
|
minAngularVelocity
: Double
Minimal, non-zero angular velocity.
|
var
|
minLinearVelocity
: Double
Minimal, non-zero linear velocity.
|
val
|
monitors
: scala.collection.mutable.ArrayBuffer[(java.lang.String, (Body) => java.lang.String)]
Monitoring methods for bodies.
|
var
|
overCWarning
: Boolean
Warning if a body's velocity exceeds the speed of light.
|
var
|
time
: Double
Current time in this world.
|
var
|
timeStep
: Double
Time intervals in which this world simulates.
|
Method Summary | |
def
|
++=
(bs : scala.Seq[Body]) : Unit
Adds the given sequence of bodies to this world.
|
def
|
+=
(body : Body) : Unit
Adds the given body to this world.
|
def
|
+=
(p : Prefab) : Unit
Adds the given prefabricated system of bodies and joints to this world.
|
def
|
+=
(joint : Joint) : Unit
Adds the given joint to this world.
|
def
|
--=
(bs : scala.Seq[Body]) : Unit
Removes the given sequence of bodies from this world.
|
def
|
-=
(p : Prefab) : Unit
Removes the given prefabricated system of bodies and joints from this world.
|
def
|
-=
(body : Body) : Unit
Removes the given body from this world.
|
def
|
-=
(joint : Joint) : Unit
Removes the given joint from this world.
|
def
|
clear
: Unit
Removes all bodies, joints and monitoring methods from this world.
|
def
|
info
: java.lang.String
Returns information about this world.
|
def
|
postStep
: Unit
Initially empty method that is executed after each time step. This method
may be overriden to create custom behaviour in a world.
|
def
|
shapes
: scala.Seq[Shape]
Returns all shapes of all bodies in this world.
|
def
|
step
: Unit
Simulates a time step of the duration
timeStep . |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Value Details |
var
timeStep : Double
var
iterations : Int
var
gravity : Vector2D
val
bodies : scala.collection.mutable.ArrayBuffer[Body]
val
joints : scala.collection.mutable.ArrayBuffer[Joint]
val
monitors : scala.collection.mutable.ArrayBuffer[(java.lang.String, (Body) => java.lang.String)]
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.
val
detector : Detector
var
overCWarning : Boolean
var
enableCollisionDetection : Boolean
var
enablePositionCorrection : Boolean
var
minLinearVelocity : Double
var
minAngularVelocity : Double
var
time : Double
Method Details |
def
clear : Unit
def
step : Unit
timeStep
.
The time step is simulated in the following phases:
postStep()
is executed.
def
postStep : Unit
def
info : java.lang.String
SiMS
|
|