From be2ee4dea92c5a4fc2329959d6e7272c50b221a6 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 29 Nov 2009 16:15:03 +0000 Subject: Translated comments to english. --- doc/all-classes.html | 6 + doc/graphyx/graphics/GraphicalCircle.html | 4 +- doc/graphyx/graphics/GraphicalRectangle.html | 4 +- doc/graphyx/graphics/GraphicalRegularPolygon.html | 4 +- doc/graphyx/graphics/GraphicalShape.html | 8 +- doc/graphyx/graphics/Parser$object.html | 22 +- doc/graphyx/graphics/Scene.html | 4 +- doc/graphyx/gui/OptionsPanel.html | 40 ++ doc/graphyx/gui/WorldPanel.html | 60 +++ doc/graphyx/tests$content.html | 33 ++ doc/graphyx/tests$package.html | 7 +- doc/graphyx/tests/Atom$object.html | 256 +++++++++++ doc/graphyx/tests/Spring$object.html | 169 +++++++ doc/graphyx/tests/Test.html | 2 +- doc/graphyx/tests/Wave$object.html | 169 +++++++ doc/modules.html | 2 + doc/root-content.html | 5 + doc/sims/collision$content.html | 21 +- doc/sims/collision/AABB.html | 13 +- doc/sims/collision/CircleCollision.html | 18 +- doc/sims/collision/Collision$object.html | 4 +- doc/sims/collision/Collision.html | 32 +- doc/sims/collision/Detector.html | 10 +- doc/sims/collision/GridDetector.html | 56 +-- doc/sims/collision/Pair.html | 2 +- doc/sims/collision/PolyCircleCollision.html | 18 +- doc/sims/collision/PolyCollision.html | 18 +- doc/sims/dynamics$content.html | 18 +- doc/sims/dynamics/Body.html | 191 ++++---- doc/sims/dynamics/Circle.html | 42 +- doc/sims/dynamics/Constraint.html | 20 +- doc/sims/dynamics/Rectangle.html | 51 +-- doc/sims/dynamics/RegularPolygon.html | 28 +- doc/sims/dynamics/Shape.html | 182 ++++---- doc/sims/dynamics/World.html | 149 +++--- doc/sims/dynamics/joints$content.html | 14 +- doc/sims/dynamics/joints/DistanceJoint.html | 32 +- doc/sims/dynamics/joints/ForceJoint.html | 6 +- doc/sims/dynamics/joints/Joint.html | 22 +- doc/sims/dynamics/joints/RevoluteJoint.html | 12 +- doc/sims/dynamics/joints/SpringJoint.html | 79 ++-- doc/sims/dynamics/joints/test$content.html | 45 ++ doc/sims/dynamics/joints/test$package.html | 17 + .../joints/test/PrismaticJoint$object.html | 82 ++++ doc/sims/dynamics/joints/test/PrismaticJoint.html | 502 +++++++++++++++++++++ doc/sims/dynamics/joints/test/UnitCircleJoint.html | 261 +++++++++++ doc/sims/geometry$content.html | 12 +- doc/sims/geometry/ConvexPolygon.html | 47 +- doc/sims/geometry/Projection.html | 20 +- doc/sims/geometry/Ray.html | 24 +- doc/sims/geometry/Segment.html | 29 +- doc/sims/geometry/Vector2D$object.html | 14 +- doc/sims/geometry/Vector2D.html | 96 ++-- doc/sims/math$content.html | 2 +- doc/sims/math/Matrix22.html | 43 +- doc/sims/util$content.html | 4 +- doc/sims/util/Polar.html | 6 +- doc/sims/util/Positioning$object.html | 2 +- doc/sims/util/RelativeVector.html | 16 +- src/graphyx/tests/Friction2.scala | 2 +- src/graphyx/tests/General1.scala | 2 +- src/graphyx/tests/Spring.scala | 4 +- src/sims/collision/AABB.scala | 13 +- src/sims/collision/CircleCollision.scala | 2 +- src/sims/collision/Collision.scala | 12 +- src/sims/collision/Detector.scala | 6 +- src/sims/collision/GridDetector.scala | 38 +- src/sims/collision/Pair.scala | 2 +- src/sims/collision/PolyCircleCollision.scala | 4 +- src/sims/collision/PolyCollision.scala | 2 +- src/sims/dynamics/Body.scala | 104 +++-- src/sims/dynamics/Circle.scala | 11 +- src/sims/dynamics/Constraint.scala | 12 +- src/sims/dynamics/Rectangle.scala | 22 +- src/sims/dynamics/RegularPolygon.scala | 18 +- src/sims/dynamics/Shape.scala | 70 +-- src/sims/dynamics/World.scala | 84 ++-- src/sims/dynamics/joints/DistanceJoint.scala | 36 +- src/sims/dynamics/joints/ForceJoint.scala | 4 +- src/sims/dynamics/joints/Joint.scala | 12 +- src/sims/dynamics/joints/RevoluteJoint.scala | 4 +- src/sims/dynamics/joints/SpringJoint.scala | 44 +- src/sims/dynamics/joints/test/PrismaticJoint.scala | 26 +- src/sims/geometry/ConvexPolygon.scala | 33 +- src/sims/geometry/Projection.scala | 19 +- src/sims/geometry/Ray.scala | 20 +- src/sims/geometry/Segment.scala | 28 +- src/sims/geometry/Vector2D.scala | 60 +-- src/sims/materials/Steel.scala | 2 +- src/sims/math/Matrix22.scala | 26 +- src/sims/util/Polar.scala | 4 +- src/sims/util/Positioning.scala | 2 +- 92 files changed, 2708 insertions(+), 1075 deletions(-) create mode 100644 doc/graphyx/tests/Atom$object.html create mode 100644 doc/graphyx/tests/Spring$object.html create mode 100644 doc/graphyx/tests/Wave$object.html create mode 100644 doc/sims/dynamics/joints/test$content.html create mode 100644 doc/sims/dynamics/joints/test$package.html create mode 100644 doc/sims/dynamics/joints/test/PrismaticJoint$object.html create mode 100644 doc/sims/dynamics/joints/test/PrismaticJoint.html create mode 100644 doc/sims/dynamics/joints/test/UnitCircleJoint.html diff --git a/doc/all-classes.html b/doc/all-classes.html index a5b98a0..c31b553 100644 --- a/doc/all-classes.html +++ b/doc/all-classes.html @@ -55,6 +55,7 @@
  • PolyCollision
  • PopupMenu
  • Prefab
  • +
  • PrismaticJoint
  • Projection
  • Pylon
  • Ragdoll
  • @@ -70,6 +71,7 @@
  • ShapeInfoPanel
  • SpringJoint
  • Test
  • +
  • UnitCircleJoint
  • Vector2D
  • World
  • WorldPanel
  • @@ -77,6 +79,7 @@
    Objects
    \ No newline at end of file diff --git a/doc/graphyx/graphics/GraphicalCircle.html b/doc/graphyx/graphics/GraphicalCircle.html index 1cf6174..613c136 100644 --- a/doc/graphyx/graphics/GraphicalCircle.html +++ b/doc/graphyx/graphics/GraphicalCircle.html @@ -61,7 +61,7 @@ Values and Variables inherited from Shape - collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes @@ -163,7 +163,7 @@ Methods inherited from Shape
    - mass, asBody, ^, ^ + mass, body, asBody, ~, ~
    diff --git a/doc/graphyx/graphics/GraphicalRectangle.html b/doc/graphyx/graphics/GraphicalRectangle.html index 264601b..27d2809 100644 --- a/doc/graphyx/graphics/GraphicalRectangle.html +++ b/doc/graphyx/graphics/GraphicalRectangle.html @@ -61,7 +61,7 @@ Values and Variables inherited from Shape
    - collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes
    @@ -170,7 +170,7 @@ Methods inherited from Shape
    - mass, asBody, ^, ^ + mass, body, asBody, ~, ~
    diff --git a/doc/graphyx/graphics/GraphicalRegularPolygon.html b/doc/graphyx/graphics/GraphicalRegularPolygon.html index a86cedf..ee4a7aa 100644 --- a/doc/graphyx/graphics/GraphicalRegularPolygon.html +++ b/doc/graphyx/graphics/GraphicalRegularPolygon.html @@ -61,7 +61,7 @@ Values and Variables inherited from Shape
    - collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes
    @@ -170,7 +170,7 @@ Methods inherited from Shape
    - mass, asBody, ^, ^ + mass, body, asBody, ~, ~
    diff --git a/doc/graphyx/graphics/GraphicalShape.html b/doc/graphyx/graphics/GraphicalShape.html index 5f45529..574ec35 100644 --- a/doc/graphyx/graphics/GraphicalShape.html +++ b/doc/graphyx/graphics/GraphicalShape.html @@ -59,7 +59,7 @@ uid : Int -
    Einzigartige Identifikationsnummer.
    +
    Unique identification number.
    @@ -74,7 +74,7 @@ Values and Variables inherited from Shape
    - density (abstract), volume (abstract), I (abstract), collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + density (abstract), volume (abstract), I (abstract), collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes
    @@ -89,7 +89,7 @@ Methods inherited from Shape
    - AABB (abstract), project (abstract), contains (abstract), mass, asBody, ^, ^ + AABB (abstract), project (abstract), contains (abstract), mass, body, asBody, ~, ~
    @@ -67,8 +67,8 @@ def @@ -78,8 +78,8 @@ def @@ -89,8 +89,8 @@ def @@ -111,8 +111,8 @@ def @@ -163,7 +163,7 @@ def - toGraphical(real : Joint) : GraphicalJoint with scala.Product + toGraphical(real : Joint) : GraphicalJoint

    diff --git a/doc/graphyx/graphics/Scene.html b/doc/graphyx/graphics/Scene.html index 06bbfe1..ab0f4df 100644 --- a/doc/graphyx/graphics/Scene.html +++ b/doc/graphyx/graphics/Scene.html @@ -87,7 +87,7 @@ @@ -239,7 +239,7 @@ val - joints : scala.Seq[GraphicalJoint with scala.Product] + joints : scala.Seq[GraphicalJoint]

    diff --git a/doc/graphyx/gui/OptionsPanel.html b/doc/graphyx/gui/OptionsPanel.html index b4f3ec6..a666b5d 100644 --- a/doc/graphyx/gui/OptionsPanel.html +++ b/doc/graphyx/gui/OptionsPanel.html @@ -123,6 +123,17 @@ : scala.swing.CheckBox + + + + + @@ -255,6 +266,17 @@ : scala.swing.Label + + + + + @@ -587,6 +609,24 @@

    +
    +
    + + + val + lblTrace : scala.swing.Label +
    +
    +

    +
    +
    + + + val + chckTrace : scala.swing.CheckBox +
    +
    +

    diff --git a/doc/graphyx/gui/WorldPanel.html b/doc/graphyx/gui/WorldPanel.html index 959812e..e9a346e 100644 --- a/doc/graphyx/gui/WorldPanel.html +++ b/doc/graphyx/gui/WorldPanel.html @@ -178,6 +178,17 @@ : Double + +
    + + + @@ -200,6 +211,17 @@ : java.awt.Point + + + + +
    @@ -147,7 +147,7 @@
    -
    Einzigartige Identifikationsnummer.
    +
    Unique identification number.
    diff --git a/doc/graphyx/graphics/Parser$object.html b/doc/graphyx/graphics/Parser$object.html index a03729d..b74e777 100644 --- a/doc/graphyx/graphics/Parser$object.html +++ b/doc/graphyx/graphics/Parser$object.html @@ -56,8 +56,8 @@ def
    - toGraphical - (real : AABB) : GraphicalAABB + toGraphical + (real : Shape) : GraphicalShape with scala.Product - toGraphical - (real : Shape) : GraphicalShape with scala.Product + toGraphical + (real : Pair) : GraphicalPair - toGraphical - (real : Pair) : GraphicalPair + toGraphical + (real : AABB) : GraphicalAABB - toGraphical - (real : Joint) : GraphicalJoint with scala.Product + toGraphical + (real : Body) : GraphicalBody - toGraphical - (real : Body) : GraphicalBody + toGraphical + (real : Joint) : GraphicalJoint joints - : scala.Seq[GraphicalJoint with scala.Product] + : scala.Seq[GraphicalJoint]
    + val + + chckTrace + : scala.swing.CheckBox + +
    + val + + lblTrace + : scala.swing.Label + +
    + val + + prevPos + : scala.collection.mutable.Map[Int, scala.collection.mutable.Queue[Vector2D]] + +
    + var + + trace + : Boolean + +
    @@ -333,6 +355,17 @@ : Scene + + + + + @@ -501,6 +534,24 @@

    +
    +
    + + + var + trace : Boolean +
    +
    +

    +
    +
    + + + val + prevPos : scala.collection.mutable.Map[Int, scala.collection.mutable.Queue[Vector2D]] +
    +
    +

    @@ -593,6 +644,15 @@

    +
    +
    + + + def + trace(shapes : scala.Iterable[GraphicalShape], g : java.awt.Graphics) : Unit +
    +
    +

    diff --git a/doc/graphyx/tests$content.html b/doc/graphyx/tests$content.html index a16a70b..ff87015 100644 --- a/doc/graphyx/tests$content.html +++ b/doc/graphyx/tests$content.html @@ -23,6 +23,17 @@
    + + + + + + + + @@ -193,6 +215,17 @@ extends Test + + + + +
    + def + + trace + (shapes : scala.Iterable[GraphicalShape], g : java.awt.Graphics) : Unit + +
    object + Atom + extends Test + + +
    + object + BallStack extends Test @@ -182,6 +193,17 @@ extends Test +
    + object + + Spring + extends Test + +
    + object + + Wave + extends Test + +
    diff --git a/doc/graphyx/tests$package.html b/doc/graphyx/tests$package.html index 7afa1bc..7e57107 100644 --- a/doc/graphyx/tests$package.html +++ b/doc/graphyx/tests$package.html @@ -12,7 +12,8 @@
  • Test
  • Objects
    \ No newline at end of file diff --git a/doc/graphyx/tests/Atom$object.html b/doc/graphyx/tests/Atom$object.html new file mode 100644 index 0000000..2db8db4 --- /dev/null +++ b/doc/graphyx/tests/Atom$object.html @@ -0,0 +1,256 @@ + + + object Atom in graphyx.tests + + + + + + + + + + + +
    + graphyx.tests +

    + object Atom +

    +
    + [source: graphyx/tests/Atom.scala] +

    +
    +
    + + + object + Atom +
    +
    extends Test
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    Value Summary
    + var + + connections + : scala.List[SpringJoint] + + +
    + var + + electrons + : scala.List[Body] + + +
    + var + + nucleus + : Body + + +
    + val + + title + : java.lang.String + + +
    + val + + world + : World + + +
    + + + + + + + + + + +
    Method Summary
    + override def + + fireEvent + : Unit + + +
    + def + + init + : Unit + + +
    + + +
    + Methods inherited from Test +
    + toString +
    + + +
    + Methods inherited from AnyRef +
    + getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
    + + +
    + Methods inherited from Any +
    + ==, !=, isInstanceOf, asInstanceOf +
    + + + + + + +
    Value Details
    +
    + + + val + title : java.lang.String +
    +
    +
    +
    + Overrides +
    +
    + Test.title +
    +

    +
    +
    + + + val + world : World +
    +
    +
    +
    + Overrides +
    +
    + Test.world +
    +

    +
    +
    + + + var + nucleus : Body +
    +
    +

    +
    +
    + + + var + electrons : scala.List[Body] +
    +
    +

    +
    +
    + + + var + connections : scala.List[SpringJoint] +
    +
    +

    + + +
    Method Details
    +
    + + + def + init : Unit +
    +
    +
    +
    + Overrides +
    +
    + Test.init +
    +

    +
    +
    + + override + def + fireEvent : Unit +
    +
    +
    +
    + Overrides +
    +
    + Test.fireEvent +
    +

    + + +
    + + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/tests/Spring$object.html b/doc/graphyx/tests/Spring$object.html new file mode 100644 index 0000000..c9a3d6f --- /dev/null +++ b/doc/graphyx/tests/Spring$object.html @@ -0,0 +1,169 @@ + + + object Spring in graphyx.tests + + + + + + + + + + + +
    + graphyx.tests +

    + object Spring +

    +
    + [source: graphyx/tests/Spring.scala] +

    +
    +
    + + + object + Spring +
    +
    extends Test
    +
    + + + + + + + + + + + + +
    Value Summary
    + val + + title + : java.lang.String + + +
    + val + + world + : World + + +
    + + + + + + +
    Method Summary
    + def + + init + : Unit + + +
    + + +
    + Methods inherited from Test +
    + fireEvent, toString +
    + + +
    + Methods inherited from AnyRef +
    + getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
    + + +
    + Methods inherited from Any +
    + ==, !=, isInstanceOf, asInstanceOf +
    + + + + + + +
    Value Details
    +
    + + + val + title : java.lang.String +
    +
    +
    +
    + Overrides +
    +
    + Test.title +
    +

    +
    +
    + + + val + world : World +
    +
    +
    +
    + Overrides +
    +
    + Test.world +
    +

    + + +
    Method Details
    +
    + + + def + init : Unit +
    +
    +
    +
    + Overrides +
    +
    + Test.init +
    +

    + + +
    + + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/tests/Test.html b/doc/graphyx/tests/Test.html index da7465a..33cfb50 100644 --- a/doc/graphyx/tests/Test.html +++ b/doc/graphyx/tests/Test.html @@ -34,7 +34,7 @@
    extends AnyRef
    Direct Known Subclasses:
    -
    BallStack, Carriage, Chain, CompositeShape, Cup, EmptyTest, Friction, Friction2, General1, General2, Joints1, Joints2, Net, RagdollTest, Restitution, Stacking
    +
    Atom, BallStack, Carriage, Chain, CompositeShape, Cup, EmptyTest, Friction, Friction2, General1, General2, Joints1, Joints2, Net, RagdollTest, Restitution, Spring, Stacking, Wave

    diff --git a/doc/graphyx/tests/Wave$object.html b/doc/graphyx/tests/Wave$object.html new file mode 100644 index 0000000..1b31387 --- /dev/null +++ b/doc/graphyx/tests/Wave$object.html @@ -0,0 +1,169 @@ + + + object Wave in graphyx.tests + + + + + + + + + + + +
    + graphyx.tests +

    + object Wave +

    +
    + [source: graphyx/tests/Wave.scala] +

    +
    +
    + + + object + Wave +
    +
    extends Test
    +
    + + + + + + + + + + + + +
    Value Summary
    + val + + title + : java.lang.String + + +
    + val + + world + : World + + +
    + + + + + + +
    Method Summary
    + def + + init + : Unit + + +
    + + +
    + Methods inherited from Test +
    + fireEvent, toString +
    + + +
    + Methods inherited from AnyRef +
    + getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
    + + +
    + Methods inherited from Any +
    + ==, !=, isInstanceOf, asInstanceOf +
    + + + + + + +
    Value Details
    +
    + + + val + title : java.lang.String +
    +
    +
    +
    + Overrides +
    +
    + Test.title +
    +

    +
    +
    + + + val + world : World +
    +
    +
    +
    + Overrides +
    +
    + Test.world +
    +

    + + +
    Method Details
    +
    + + + def + init : Unit +
    +
    +
    +
    + Overrides +
    +
    + Test.init +
    +

    + + +
    + + + + + + + + + \ No newline at end of file diff --git a/doc/modules.html b/doc/modules.html index 8edb9c7..894ca01 100644 --- a/doc/modules.html +++ b/doc/modules.html @@ -22,6 +22,8 @@ sims.dynamics
  • sims.dynamics.joints
  • +
  • + sims.dynamics.joints.test
  • sims.geometry
  • diff --git a/doc/root-content.html b/doc/root-content.html index e5c8a85..e477111 100644 --- a/doc/root-content.html +++ b/doc/root-content.html @@ -45,6 +45,11 @@ sims.dynamics.joints + + package + sims.dynamics.joints.test + + package sims.geometry diff --git a/doc/sims/collision$content.html b/doc/sims/collision$content.html index d34c535..1aa99c6 100644 --- a/doc/sims/collision$content.html +++ b/doc/sims/collision$content.html @@ -13,9 +13,8 @@ AABB (val minVertex : Vector2D, val maxVertex : Vector2D) extends scala.Product -
    Axis Aligned Bounding Boxes, kurz AABBs, sind Rechtecke die eine bestimmte Form umhuellen. - Da AABBs nach den X- und Y-Achsen orientiert sind, ermoeglichen sie eine schnelle - und einfache Feststellung ob zwei AABBs sich ueberschneiden.
    +
    Axis Aligned Bounding Boxes (AABBs) are rectangles that frame a shape. + Their X-Axis and Y-Axis orientation makes it easy to test two AABBs for overlap.
    @@ -26,7 +25,7 @@ CircleCollision (val c1 : Circle, val c2 : Circle) extends Collision with scala.Product -
    Kollision zwischen zwei Kreisen.
    +
    Collision between two circles.
    @@ -37,7 +36,7 @@ Collision extends Constraint with AnyRef -
    Kollisionen zwischen zwei Formen enthalten Methoden zur Berrechnen der Kollisionsreaktion.
    +
    Collision between two shapes. Contains methods to compute the collision response.
    @@ -48,7 +47,7 @@ Detector extends AnyRef -
    Eine Welt ermittelt ihre Kollisionen durch konkrete Implementierungen dieser Klasse.
    +
    A world detects its collisions through concrete implementations of this class.
    @@ -59,8 +58,8 @@ GridDetector (val override world : World) extends Detector -
    Eine konkrete Implementierung von Detector. GridDetector ermittelt - alle Kollisionen mit einem Gittersystem.
    +
    A conrete implementation of Detector. GridDetector divides the world into a grid + for faster collision detection.
    @@ -82,7 +81,7 @@ Pair (val s1 : Shape, val s2 : Shape) extends (Shape, Shape) -
    Formenpaar.
    +
    Pair of shapes.
    @@ -93,7 +92,7 @@ PolyCircleCollision (val p : ConvexPolygon, val c : Circle) extends Collision with scala.Product -
    Kollision zwischen einem konvexen Polygon und einem Kreis.
    +
    Collision between a convex polygon and a circle.
    @@ -104,7 +103,7 @@ PolyCollision (val p1 : ConvexPolygon, val p2 : ConvexPolygon) extends Collision with scala.Product -
    Kollision zwischen zwei konvexen Polygonen.
    +
    Collision between two convex polygons.
    diff --git a/doc/sims/collision/AABB.html b/doc/sims/collision/AABB.html index d4759f1..a687d9d 100644 --- a/doc/sims/collision/AABB.html +++ b/doc/sims/collision/AABB.html @@ -33,11 +33,10 @@
    extends scala.Product
    -
    Axis Aligned Bounding Boxes, kurz AABBs, sind Rechtecke die eine bestimmte Form umhuellen. - Da AABBs nach den X- und Y-Achsen orientiert sind, ermoeglichen sie eine schnelle - und einfache Feststellung ob zwei AABBs sich ueberschneiden.
    +
    Axis Aligned Bounding Boxes (AABBs) are rectangles that frame a shape. + Their X-Axis and Y-Axis orientation makes it easy to test two AABBs for overlap.
    - Parameters
    minVertex - Ortsvektor der minimalen Ecke des AABBs
    maxVertex - Ortsvektor der maximalen Ecke des AABBs
    + Parameters
    minVertex - Position vector of the bottom-left vertex
    maxVertex - Position vector of the upper-right vertex
    Direct Known Subclasses:
    GraphicalAABB
    @@ -78,7 +77,7 @@ overlaps (box : AABB) : Boolean -
    Ueberprueft ob dieses AABB sich mit dem AABB box ueberschneidet.
    +
    Checks this AABB with box for overlap.
    @@ -156,9 +155,9 @@
    -
    Ueberprueft ob dieses AABB sich mit dem AABB box ueberschneidet.
    +
    Checks this AABB with box for overlap.
    - Parameters
    box - das mit diesem auf Ueberschneidung zu ueberpruefende AABB
    + Parameters
    box - AABB with which to check for overlap

    diff --git a/doc/sims/collision/CircleCollision.html b/doc/sims/collision/CircleCollision.html index d305be6..e26027f 100644 --- a/doc/sims/collision/CircleCollision.html +++ b/doc/sims/collision/CircleCollision.html @@ -33,7 +33,7 @@
    extends Collision with scala.Product
    -
    Kollision zwischen zwei Kreisen.
    +
    Collision between two circles.
    @@ -48,7 +48,7 @@ normal : Vector2D -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -59,7 +59,7 @@ points : scala.List[Vector2D] -
    Kollisionspunkte.
    +
    Collision points.
    @@ -70,7 +70,7 @@ shape1 : Circle -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -81,7 +81,7 @@ shape2 : Circle -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -191,7 +191,7 @@
    -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -210,7 +210,7 @@
    -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -229,7 +229,7 @@
    -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -248,7 +248,7 @@
    -
    Kollisionspunkte.
    +
    Collision points.
    diff --git a/doc/sims/collision/Collision$object.html b/doc/sims/collision/Collision$object.html index de0b9de..0d02762 100644 --- a/doc/sims/collision/Collision$object.html +++ b/doc/sims/collision/Collision$object.html @@ -45,7 +45,7 @@ ToleratedOverlap : Double -
    Erlaubte Ueberlappung.
    +
    Tolerated overlap. Collision response will only be applied if the overlap of two shapes exceeds the tolerated overlap.
    @@ -79,7 +79,7 @@
    -
    Erlaubte Ueberlappung.
    +
    Tolerated overlap. Collision response will only be applied if the overlap of two shapes exceeds the tolerated overlap.

    diff --git a/doc/sims/collision/Collision.html b/doc/sims/collision/Collision.html index 8b97de9..028dc09 100644 --- a/doc/sims/collision/Collision.html +++ b/doc/sims/collision/Collision.html @@ -33,7 +33,7 @@
    extends Constraint with AnyRef
    -
    Kollisionen zwischen zwei Formen enthalten Methoden zur Berrechnen der Kollisionsreaktion.
    +
    Collision between two shapes. Contains methods to compute the collision response.
    Direct Known Subclasses:
    @@ -51,7 +51,7 @@ normal : Vector2D -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -62,7 +62,7 @@ points : scala.Iterable[Vector2D] -
    Kollisionspunkte.
    +
    Collision points.
    @@ -73,7 +73,7 @@ shape1 : Shape -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -84,7 +84,7 @@ shape2 : Shape -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -109,7 +109,7 @@ correctPosition (h : Double) : Unit -
    Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
    +
    Corrects the positions of bodies according to this constraint.
    @@ -120,7 +120,7 @@ correctVelocity (h : Double) : Unit -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
    +
    Corrects the velocities of bodies according to this constraint.
    @@ -153,7 +153,7 @@
    -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).

    @@ -165,7 +165,7 @@
    -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).

    @@ -177,7 +177,7 @@
    -
    Kollisionspunkte.
    +
    Collision points.

    @@ -189,7 +189,7 @@
    -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.

    @@ -203,8 +203,9 @@
    -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
    -
    +
    Corrects the velocities of bodies according to this constraint.
    +
    + Parameters
    h - a time interval, used for converting forces and impulses
    Overrides @@ -231,8 +232,9 @@
    -
    Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
    -
    +
    Corrects the positions of bodies according to this constraint.
    +
    + Parameters
    h - a time interval, used for converting forces and impulses
    Overrides diff --git a/doc/sims/collision/Detector.html b/doc/sims/collision/Detector.html index 7aaa1e4..ad93c73 100644 --- a/doc/sims/collision/Detector.html +++ b/doc/sims/collision/Detector.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Eine Welt ermittelt ihre Kollisionen durch konkrete Implementierungen dieser Klasse.
    +
    A world detects its collisions through concrete implementations of this class.
    Direct Known Subclasses:
    @@ -51,7 +51,7 @@ world : World -
    Die Welt dessen Formen auf Kollisionen ueberprueft werden sollen.
    +
    The world whose shapes are to be checked for collisions.
    @@ -65,7 +65,7 @@ collisions : scala.Seq[Collision] -
    Ergibt alle Kollisionen zwischen Formen der Welt world.
    +
    Returns all collisions between shapes in the world world.
    @@ -98,7 +98,7 @@
    -
    Die Welt dessen Formen auf Kollisionen ueberprueft werden sollen.
    +
    The world whose shapes are to be checked for collisions.

    @@ -112,7 +112,7 @@
    -
    Ergibt alle Kollisionen zwischen Formen der Welt world.
    +
    Returns all collisions between shapes in the world world.

    diff --git a/doc/sims/collision/GridDetector.html b/doc/sims/collision/GridDetector.html index 43dc1f6..9007d31 100644 --- a/doc/sims/collision/GridDetector.html +++ b/doc/sims/collision/GridDetector.html @@ -33,8 +33,8 @@
    extends Detector
    -
    Eine konkrete Implementierung von Detector. GridDetector ermittelt - alle Kollisionen mit einem Gittersystem.
    +
    A conrete implementation of Detector. GridDetector divides the world into a grid + for faster collision detection.
    @@ -49,7 +49,7 @@ collisionMethods : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Collision]] -
    Array von Kollisionsmethoden fuer Formenpaare.
    +
    Array of methods returning collisions. It is assumed that both shapes are colliding.
    @@ -60,7 +60,7 @@ detectionMethods : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Boolean]] -
    Array von Kollisionserkennungsmethoden fuer Formenpaare.
    +
    Array of collision detection methods. These methods return true if two shapes are colliding.
    @@ -71,7 +71,7 @@ gridSide : Double -
    Breite und Hoehe einer Gitterzelle.
    +
    Width and height of a grid cell.
    @@ -85,7 +85,7 @@ colliding (p : Pair) : Boolean -
    Gibt an, ob das Formenpaar p kollidiert.
    +
    Checks the pair of shapes p for collision.
    @@ -96,7 +96,7 @@ collidingPairs : scala.Seq[Pair] -
    Ergibt alle kollidierenden Paare.
    +
    Returns all colliding pairs.
    @@ -107,7 +107,7 @@ collision (p : Pair) : Collision -
    Gibt die Kollision des Formenpaares p zurueck.
    +
    Returns the collision between both shapes of the pair p.
    @@ -118,7 +118,7 @@ collisions : scala.Seq[Collision] -
    Ergibt alle Kollisionen.
    +
    Returns all collisions.
    @@ -129,7 +129,7 @@ getPairs : scala.Seq[Pair] -
    Ergibt potenzielle Kollisionspaare der Welt world.
    +
    Returns potential colliding pairs of shapes of the world world.
    @@ -140,7 +140,7 @@ pairs : scala.Seq[Pair] -
    Alle potentiellen Kollisionspaare der Welt.
    +
    All potential colliding pairs of the world.
    @@ -173,7 +173,7 @@
    -
    Array von Kollisionserkennungsmethoden fuer Formenpaare.
    +
    Array of collision detection methods. These methods return true if two shapes are colliding.

    @@ -185,7 +185,7 @@
    -
    Array von Kollisionsmethoden fuer Formenpaare.
    +
    Array of methods returning collisions. It is assumed that both shapes are colliding.

    @@ -197,7 +197,7 @@
    -
    Breite und Hoehe einer Gitterzelle.
    +
    Width and height of a grid cell.

    @@ -211,9 +211,9 @@
    -
    Gibt an, ob das Formenpaar p kollidiert.
    +
    Checks the pair of shapes p for collision.
    - Parameters
    p - Formenpaar.
    + Parameters
    p - Pair of shapes.

    @@ -224,9 +224,9 @@
    -
    Gibt die Kollision des Formenpaares p zurueck.
    +
    Returns the collision between both shapes of the pair p.
    - Parameters
    p - Formenpaar.
    + Parameters
    p - Pair of shapes.

    @@ -237,15 +237,15 @@
    -
    Ergibt potenzielle Kollisionspaare der Welt world. +
    Returns potential colliding pairs of shapes of the world world.

    - Ein Kollisionspaar ist ein Paar aus zwei verschiedenen Formen, das folgenden Bedingungen unterliegt: + A potential colliding pair is a pair of two shapes that comply with the following criteria:

      -
    • Die Formen muessen sich in der gleichen Gitterzelle befinden.
    • -
    • Ihre AABBs muessen sich ueberlappen.
    • -
    • Die Formen duerfen nicht von dem gleichen Koerper sein.
    • -
    • Mindestens eine Form darf nicht Fixiert sein.
    • -
    • Beide muessen {@link dynamics.Shape#collidable collidierbar} sein.
    • +
    • The shapes are situated in the same grid cell.
    • +
    • Their AABBs overlap.
    • +
    • The shapes do not belong to the same body.
    • +
    • At least one shape is not fixed.
    • +
    • Both shapes are {@link dynamics.Shape#collidable}.

    @@ -258,7 +258,7 @@
    -
    Alle potentiellen Kollisionspaare der Welt.
    +
    All potential colliding pairs of the world.
    See Also
    getPairs

    @@ -271,7 +271,7 @@
    -
    Ergibt alle kollidierenden Paare.
    +
    Returns all colliding pairs.

    @@ -283,7 +283,7 @@
    -
    Ergibt alle Kollisionen.
    +
    Returns all collisions.
    diff --git a/doc/sims/collision/Pair.html b/doc/sims/collision/Pair.html index 15b53bf..e210fc9 100644 --- a/doc/sims/collision/Pair.html +++ b/doc/sims/collision/Pair.html @@ -33,7 +33,7 @@
    extends (Shape, Shape)
    -
    Formenpaar.
    +
    Pair of shapes.
    diff --git a/doc/sims/collision/PolyCircleCollision.html b/doc/sims/collision/PolyCircleCollision.html index eb30399..3b1d094 100644 --- a/doc/sims/collision/PolyCircleCollision.html +++ b/doc/sims/collision/PolyCircleCollision.html @@ -33,7 +33,7 @@
    extends Collision with scala.Product
    -
    Kollision zwischen einem konvexen Polygon und einem Kreis.
    +
    Collision between a convex polygon and a circle.
    @@ -48,7 +48,7 @@ normal : Vector2D -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -59,7 +59,7 @@ points : scala.List[Vector2D] -
    Kollisionspunkte.
    +
    Collision points.
    @@ -70,7 +70,7 @@ shape1 : Shape -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -81,7 +81,7 @@ shape2 : Circle -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -191,7 +191,7 @@
    -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -210,7 +210,7 @@
    -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -229,7 +229,7 @@
    -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -248,7 +248,7 @@
    -
    Kollisionspunkte.
    +
    Collision points.
    diff --git a/doc/sims/collision/PolyCollision.html b/doc/sims/collision/PolyCollision.html index dbfe30b..9009f39 100644 --- a/doc/sims/collision/PolyCollision.html +++ b/doc/sims/collision/PolyCollision.html @@ -33,7 +33,7 @@
    extends Collision with scala.Product
    -
    Kollision zwischen zwei konvexen Polygonen.
    +
    Collision between two convex polygons.
    @@ -59,7 +59,7 @@ normal : Vector2D -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -81,7 +81,7 @@ points : scala.Seq[Vector2D] -
    Kollisionspunkte.
    +
    Collision points.
    @@ -92,7 +92,7 @@ shape1 : Shape -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -103,7 +103,7 @@ shape2 : Shape -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -242,7 +242,7 @@
    -
    Erste Kollisionsform (Referenz).
    +
    First colliding shape (reference shape).
    @@ -261,7 +261,7 @@
    -
    Zweite Kollisionsform (eindringend).
    +
    Second colliding shape (incident shape).
    @@ -280,7 +280,7 @@
    -
    Normalenvektor zu der Kollisionsebene.
    +
    Normal vector to the collision face.
    @@ -299,7 +299,7 @@
    -
    Kollisionspunkte.
    +
    Collision points.
    diff --git a/doc/sims/dynamics$content.html b/doc/sims/dynamics$content.html index 256ead8..8cbd40c 100644 --- a/doc/sims/dynamics$content.html +++ b/doc/sims/dynamics$content.html @@ -13,7 +13,7 @@ Body (shps : Shape*) extends AnyRef -
    Ein 2-Dimensionaler Koerper besteht aus mehreren Formen. Im gegensatz zu letzteren, enthaelt ein Koerper dynamische Informationen (v, F, etc...).
    +
    A two dimensional rigid body is made out of shapes.
    @@ -24,7 +24,7 @@ Circle (val radius : Double, val density : Double) extends Shape with scala.Product -
    Circle ist die Definition eines Kreises.
    +
    A circle.
    @@ -35,9 +35,9 @@ Constraint extends AnyRef -
    Randbedingungen erben von dem Trait Constraint. - Fuer jeden Constraint koennen Position und Geschwindigkeit korrigiert werden. - Ihre Implementierung wurde von Erin Catto's box2d inspiriert.
    +
    All constraints in SiMS implement this trait. + Position and velocity can be corrected for each constraint. + The implementation of constraints was inspired by Erin Catto's box2d.
    @@ -48,7 +48,7 @@ Rectangle (val halfWidth : Double, val halfHeight : Double, val density : Double) extends Shape with ConvexPolygon with scala.Product -
    Rechteck ist eine Art Polygon.
    +
    A rectangle is a polygon.
    @@ -59,7 +59,7 @@ RegularPolygon (val n : Int, val radius : Double, val density : Double) extends Shape with ConvexPolygon with scala.Product -
    Ein regelmaessiges Polygon mit n Seiten, dass der Kreis mit radius radius umschreibt.
    +
    A regular polygon with n sides whose excircle has a radius radius.
    @@ -70,7 +70,7 @@ Shape extends AnyRef -
    Eine abstrakte Form.
    +
    An abstract shape.
    @@ -81,7 +81,7 @@ World extends AnyRef -
    Eine Welt enthaelt und Simuliert ein System aus Koerpern und Verbindungen.
    +
    A world contains and simulates a system of rigid bodies and joints.
    diff --git a/doc/sims/dynamics/Body.html b/doc/sims/dynamics/Body.html index 7ac6091..4bacab2 100644 --- a/doc/sims/dynamics/Body.html +++ b/doc/sims/dynamics/Body.html @@ -33,9 +33,9 @@
    extends AnyRef
    -
    Ein 2-Dimensionaler Koerper besteht aus mehreren Formen. Im gegensatz zu letzteren, enthaelt ein Koerper dynamische Informationen (v, F, etc...).
    +
    A two dimensional rigid body is made out of shapes.
    - Parameters
    shps - zu dem Koerper gehoerende Formen.
    + Parameters
    shps - shapes that belong to this body.
    @@ -49,7 +49,7 @@ angularVelocity : Double -
    Winkelgeschwindigkeit dieses Koerpers.
    +
    Angular velocity of this body.
    @@ -60,7 +60,7 @@ force : Vector2D -
    Resultierende Kraft auf den Schwerpunkt dieses Koerpers.
    +
    Resulting force on the COM of this body.
    @@ -71,7 +71,7 @@ linearVelocity : Vector2D -
    Lineargeschwindigkeit dieses Koerpers.
    +
    Linear velocity of this body.
    @@ -82,7 +82,7 @@ monitor : Boolean -
    Gibt an ob die Eigenschaften dieses Koerpers ueberwacht werden sollen.
    +
    Flag for a world to monitor the properties of this body.
    @@ -93,7 +93,7 @@ shapes : scala.List[Shape] -
    Formen aus denen dieser Koerper besteht.
    +
    Shapes that belong to this body.
    @@ -104,7 +104,7 @@ torque : Double -
    Resultierender Drehmoment zu dem Schwerpunkt dieses Koerpers.
    +
    Resulting torque on this body.
    @@ -115,7 +115,7 @@ uid : Int -
    Einzigartige Identifikationsnummer dieses Koerpers.
    +
    Unique identification number.
    @@ -129,7 +129,9 @@ I : Double -
    Ergibt den Traegheitsmoment zu dem Schwerpunkt dieses Koerpers. Der Traegheitsmoment wird mit Hilfe des Steinerschen Satzes errechnet.
    +
    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).
    @@ -137,21 +139,10 @@ def - ^ - (s : Shape) : Body - -
    Erstellt einen neuen Koerper der zusaetzlich die Form s enthaelt.
    - - - - - def - - - ^ - (b : Body) : Body + applyForce + (force : Vector2D, point : Vector2D) : Unit -
    Erstellt einen neuen Koerper der zusaetzlich die Formen von dem Koerper b enthaelt.
    +
    Applies a force to a point on this body. Warning: the point is considered to be contained within this body.
    @@ -162,7 +153,7 @@ applyForce (force : Vector2D) : Unit -
    Wendet eine Kraft auf den Schwerpunkt dieses Koerpers an.
    +
    Applies a force to the COM of this body.
    @@ -170,11 +161,10 @@ def - applyForce - (force : Vector2D, point : Vector2D) : Unit + applyImpulse + (impulse : Vector2D) : Unit -
    Wendet eine Kraft auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses - Koerpers ueberprueft.
    +
    Applies an impulse to the COM of this body.
    @@ -185,19 +175,7 @@ applyImpulse (impulse : Vector2D, point : Vector2D) : Unit -
    Wendet einen Impuls auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses - Koerpers ueberprueft.
    - - - - - def - - - applyImpulse - (impulse : Vector2D) : Unit - -
    Wendet einen Impuls auf den Schwerpunkt dieses Koerpers an.
    +
    Applies an impulse to a point on this body. Warning: the point is considered to be contained within this body.
    @@ -208,7 +186,7 @@ contains (point : Vector2D) : Boolean -
    Ueberprueft ob der gegebene Punkt point sich in diesem Koerper befindet.
    +
    Checks if the point point is contained in this body.
    @@ -219,7 +197,7 @@ fixed : Boolean -
    Gibt an ob dieser Koerper fixiert ist.
    +
    Returns whether this body is fixed or not.
    @@ -230,7 +208,7 @@ fixed_= (value : Boolean) : Unit -
    Fixiert oder unfixiert diesen Koerper.
    +
    Fixes or frees this body. By fixing, linear and angular velocities are set to zero.
    @@ -241,7 +219,8 @@ mass : Double -
    Ergibt die Masse dieses Koerpers. Die Masse ist gleich die Summe aller Massen seiner Formen.
    +
    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).
    @@ -252,7 +231,7 @@ pos : Vector2D -
    Ermittelt die Position dieses Koerpers. Die Position entspricht dem Schwerpunkt.
    +
    Returns the position of this body. The position is equivalent to the center of mass.
    @@ -263,7 +242,7 @@ pos_= (newPos : Vector2D) : Unit -
    Setzt die Position dieses Koerpers und verschiebt dadurch die Positionen seiner Formen.
    +
    Sets the position of this body. By doing so all its shapes are translated.
    @@ -274,7 +253,7 @@ rotation : Double -
    Ergibt die aktuelle Rotation dieses Koerpers.
    +
    Returns the current rotation of this body.
    @@ -285,7 +264,7 @@ rotation_= (newRotation : Double) : Unit -
    Setzt die Rotation dieses Koerpers. Dazu werden auch die Positionen und Rotationen seiner Formen entsprechend veraendert.
    +
    Sets the rotation of this body. Position and rotation of shapes are modified accordingly.
    @@ -307,7 +286,29 @@ velocityOfPoint (point : Vector2D) : Vector2D -
    Lineargeschwindigkeit des gegebenen Punktes auf diesem Koerper. In Weltkoordinaten.
    +
    Linear velocity of the given point on this body (in world coordinates).
    + + + + + def + + + ~ + (b : Body) : Body + +
    Creates a new body containing this body's shapes and the shapes of another body b.
    + + + + + def + + + ~ + (s : Shape) : Body + +
    Creates a new body containing this body's shapes and the shape s.
    @@ -340,7 +341,7 @@
    -
    Einzigartige Identifikationsnummer dieses Koerpers.
    +
    Unique identification number.

    @@ -352,7 +353,7 @@
    -
    Formen aus denen dieser Koerper besteht.
    +
    Shapes that belong to this body.

    @@ -364,7 +365,7 @@
    -
    Gibt an ob die Eigenschaften dieses Koerpers ueberwacht werden sollen.
    +
    Flag for a world to monitor the properties of this body.
    See Also
    World#monitors

    @@ -377,7 +378,7 @@
    -
    Lineargeschwindigkeit dieses Koerpers.
    +
    Linear velocity of this body.

    @@ -389,7 +390,7 @@
    -
    Winkelgeschwindigkeit dieses Koerpers.
    +
    Angular velocity of this body.

    @@ -401,7 +402,7 @@
    -
    Resultierende Kraft auf den Schwerpunkt dieses Koerpers.
    +
    Resulting force on the COM of this body.

    @@ -413,7 +414,7 @@
    -
    Resultierender Drehmoment zu dem Schwerpunkt dieses Koerpers.
    +
    Resulting torque on this body.

    @@ -427,7 +428,7 @@
    -
    Gibt an ob dieser Koerper fixiert ist.
    +
    Returns whether this body is fixed or not.

    @@ -439,7 +440,7 @@
    -
    Fixiert oder unfixiert diesen Koerper.
    +
    Fixes or frees this body. By fixing, linear and angular velocities are set to zero.

    @@ -451,9 +452,9 @@
    -
    Ermittelt die Position dieses Koerpers. Die Position entspricht dem Schwerpunkt.
    +
    Returns the position of this body. The position is equivalent to the center of mass.
    - Returns
    Position dieses Koerpers
    + Returns
    position of this body

    @@ -464,9 +465,9 @@
    -
    Setzt die Position dieses Koerpers und verschiebt dadurch die Positionen seiner Formen.
    +
    Sets the position of this body. By doing so all its shapes are translated.
    - Parameters
    newPos - neue Position
    + Parameters
    newPos - new position

    @@ -477,9 +478,8 @@
    -
    Ergibt die aktuelle Rotation dieses Koerpers.
    -
    - Returns
    aktuelle Rotation dieses Koerpers
    +
    Returns the current rotation of this body.
    +

    @@ -490,9 +490,9 @@
    -
    Setzt die Rotation dieses Koerpers. Dazu werden auch die Positionen und Rotationen seiner Formen entsprechend veraendert.
    +
    Sets the rotation of this body. Position and rotation of shapes are modified accordingly.
    - Parameters
    r - neue Rotation
    + Parameters
    r - new rotation

    @@ -503,7 +503,7 @@
    -
    Lineargeschwindigkeit des gegebenen Punktes auf diesem Koerper. In Weltkoordinaten.
    +
    Linear velocity of the given point on this body (in world coordinates).

    @@ -515,9 +515,10 @@
    -
    Ergibt die Masse dieses Koerpers. Die Masse ist gleich die Summe aller Massen seiner Formen.
    +
    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).
    - Returns
    Masse des Koerpers
    + Returns
    this body's mass

    @@ -528,9 +529,11 @@
    -
    Ergibt den Traegheitsmoment zu dem Schwerpunkt dieses Koerpers. Der Traegheitsmoment wird mit Hilfe des Steinerschen Satzes errechnet.
    +
    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).
    - Returns
    Traegheitsmoment relativ zu dem Schwerpunkt dieses Koerpers
    + Returns
    moment of inertia for rotations about the COM of this body

    @@ -541,9 +544,9 @@
    -
    Wendet eine Kraft auf den Schwerpunkt dieses Koerpers an.
    +
    Applies a force to the COM of this body.
    - Parameters
    force - anzuwendender Kraftvektor
    + Parameters
    force - applied force

    @@ -554,10 +557,9 @@
    -
    Wendet eine Kraft auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses - Koerpers ueberprueft.
    +
    Applies a force to a point on this body. Warning: the point is considered to be contained within this body.
    - Parameters
    force - anzuwendender Kraftvektor
    point - Ortsvektor des Punktes auf den die Kraft wirken soll (gegeben in Weltkoordinaten).
    + Parameters
    force - applied force
    point - position vector of the point (in world coordinates)

    @@ -568,9 +570,9 @@
    -
    Wendet einen Impuls auf den Schwerpunkt dieses Koerpers an.
    +
    Applies an impulse to the COM of this body.
    - Parameters
    impulse - anzuwendender Impulsvektor
    + Parameters
    impulse - applied impulse

    @@ -581,10 +583,9 @@
    -
    Wendet einen Impuls auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses - Koerpers ueberprueft.
    +
    Applies an impulse to a point on this body. Warning: the point is considered to be contained within this body.
    - Parameters
    impulse - anzuwendender Impulsvektor
    point - Ortsvektor des Punktes auf den der Impuls wirken soll (gegeben in Weltkoordinaten).
    + Parameters
    impulse - applied impulse
    point - position vector of the point (in world coordinates)

    @@ -595,7 +596,7 @@
    -
    Ueberprueft ob der gegebene Punkt point sich in diesem Koerper befindet.
    +
    Checks if the point point is contained in this body.

    @@ -613,33 +614,33 @@
    Returns
    a string representation of the object.


    -
    +
    def - ^(s : Shape) : Body + ~(s : Shape) : Body
    -
    Erstellt einen neuen Koerper der zusaetzlich die Form s enthaelt.
    +
    Creates a new body containing this body's shapes and the shape s.
    - Parameters
    s - zusaetzliche Form
    - Returns
    neuer Koerper
    + Parameters
    s - new shape
    + Returns
    new body

    -
    +
    def - ^(b : Body) : Body + ~(b : Body) : Body
    -
    Erstellt einen neuen Koerper der zusaetzlich die Formen von dem Koerper b enthaelt.
    +
    Creates a new body containing this body's shapes and the shapes of another body b.
    - Parameters
    b - Koerper mit zusaetzlichen Formen
    - Returns
    neuer Koerper
    + Parameters
    b - body with extra shapes
    + Returns
    new body

    diff --git a/doc/sims/dynamics/Circle.html b/doc/sims/dynamics/Circle.html index d6807a8..f5a1655 100644 --- a/doc/sims/dynamics/Circle.html +++ b/doc/sims/dynamics/Circle.html @@ -33,9 +33,9 @@
    extends Shape with scala.Product
    -
    Circle ist die Definition eines Kreises.
    +
    A circle.
    - Parameters
    radius - Radius dieses Kreises
    density - Dichte dieses Kreises
    + Parameters
    radius - radius of this circle
    density - density of this circle
    Direct Known Subclasses:
    GraphicalCircle
    @@ -52,7 +52,7 @@ I : Double -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    +
    Moment of inertia for a rotation about this shape's COM.
    @@ -63,7 +63,8 @@ volume : Double -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -71,7 +72,7 @@ Values and Variables inherited from Shape
    - uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes
    @@ -84,7 +85,7 @@ AABB : AABB -
    Gibt das umfassende AABB dieser Form zurueck.
    +
    Returns this shape's axis aligned bounding box.
    @@ -95,7 +96,7 @@ contains (point : Vector2D) : Boolean -
    Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
    +
    Checks if the point point is contained in this shape.
    @@ -162,8 +163,7 @@ project (axis : Vector2D) : Projection -
    Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den - Richtungsvektor axis.
    +
    Returns the projection of this shape onto the line given by the directional vector axis.
    @@ -182,7 +182,7 @@ Methods inherited from Shape
    - mass, asBody, ^, ^ + mass, body, asBody, ~, ~
    @@ -65,7 +65,7 @@ correctVelocity (h : Double) : Unit -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
    +
    Corrects the velocities of bodies according to this constraint.
    @@ -214,7 +214,8 @@
    -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -233,9 +234,8 @@
    -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    -
    - Returns
    Traegheitsmoment zum Schwerpunkt
    +
    Moment of inertia for a rotation about this shape's COM.
    +
    Overrides @@ -255,9 +255,8 @@
    -
    Gibt das umfassende AABB dieser Form zurueck.
    -
    - Returns
    umfassendes AABB
    +
    Returns this shape's axis aligned bounding box.
    +
    Overrides @@ -275,11 +274,10 @@
    -
    Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den - Richtungsvektor axis.
    +
    Returns the projection of this shape onto the line given by the directional vector axis.
    - Parameters
    axis - Richtungsvektor der Geraden
    - Returns
    Projektion dieser Form
    + Parameters
    axis - directional vector of the line
    + Returns
    projection of this shape
    Overrides @@ -297,7 +295,7 @@
    -
    Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
    +
    Checks if the point point is contained in this shape.
    diff --git a/doc/sims/dynamics/Constraint.html b/doc/sims/dynamics/Constraint.html index 556e5c3..570f522 100644 --- a/doc/sims/dynamics/Constraint.html +++ b/doc/sims/dynamics/Constraint.html @@ -33,9 +33,9 @@
    extends AnyRef
    -
    Randbedingungen erben von dem Trait Constraint. - Fuer jeden Constraint koennen Position und Geschwindigkeit korrigiert werden. - Ihre Implementierung wurde von Erin Catto's box2d inspiriert.
    +
    All constraints in SiMS implement this trait. + Position and velocity can be corrected for each constraint. + The implementation of constraints was inspired by Erin Catto's box2d.
    Direct Known Subclasses:
    @@ -54,7 +54,7 @@ correctPosition (h : Double) : Unit -
    Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
    +
    Corrects the positions of bodies according to this constraint.
    @@ -99,8 +99,9 @@
    -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
    -
    +
    Corrects the velocities of bodies according to this constraint.
    +
    + Parameters
    h - a time interval, used for converting forces and impulses

    @@ -111,8 +112,9 @@
    -
    Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
    -
    +
    Corrects the positions of bodies according to this constraint.
    +
    + Parameters
    h - a time interval, used for converting forces and impulses

    diff --git a/doc/sims/dynamics/Rectangle.html b/doc/sims/dynamics/Rectangle.html index a002d40..df238de 100644 --- a/doc/sims/dynamics/Rectangle.html +++ b/doc/sims/dynamics/Rectangle.html @@ -33,9 +33,9 @@
    extends Shape with ConvexPolygon with scala.Product
    -
    Rechteck ist eine Art Polygon.
    +
    A rectangle is a polygon.
    - Parameters
    halfWidth - halbe Breite dieses Rechtecks
    halfHeight - halbe Hoehe dieses Rechtecks
    density - dichte dieses Rechtecks
    + Parameters
    halfWidth - this rectangle's half width
    halfHeight - this rectangle's half height
    density - density of this rectangle
    Direct Known Subclasses:
    GraphicalRectangle
    @@ -52,7 +52,7 @@ I : Double -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    +
    Moment of inertia for a rotation about this shape's COM.
    @@ -63,7 +63,8 @@ volume : Double -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -71,7 +72,7 @@ Values and Variables inherited from Shape
    - uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes
    @@ -96,9 +97,9 @@ halfDiags : scala.Array[Vector2D] -
    Ergibt Vektoren vom Zentrum dieses Rectecks bis zu den Ecken. - Erste Ecke entspricht der Ecke oben rechts bei einer Rotation von 0. - Folgende Ecken sind gegen den Uhrzeigersinn geordnet.
    +
    Returns the vectors from the center to the vertices of this rectangle. + The first vertex is the upper-right vertex at a rotation of 0. + Vertices are ordered counter-clockwise.
    @@ -164,9 +165,9 @@ vertices : scala.Array[Vector2D] -
    Ergibt die Ortsvektoren der Ecken dieses Rechtecks. - Erste Ecke entspricht der Ecke oben rechts bei einer Rotation von 0. - Folgende Ecken sind gegen den Uhrzeigersinn geordnet.
    +
    Returns the position vectors of this rectangle's vertices. + The first vertex is the upper-right vertex at a rotation of 0. + Vertices are ordered counter-clockwise.
    @@ -181,7 +182,7 @@ Methods inherited from Shape
    - mass, asBody, ^, ^ + mass, body, asBody, ~, ~
    @@ -63,7 +64,8 @@ volume : Double -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -213,7 +214,8 @@
    -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -232,9 +234,8 @@
    -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    -
    - Returns
    Traegheitsmoment zum Schwerpunkt
    +
    Moment of inertia for a rotation about this shape's COM.
    +
    Overrides @@ -254,11 +255,10 @@
    -
    Ergibt Vektoren vom Zentrum dieses Rectecks bis zu den Ecken. - Erste Ecke entspricht der Ecke oben rechts bei einer Rotation von 0. - Folgende Ecken sind gegen den Uhrzeigersinn geordnet.
    -
    - Returns
    Vektoren vom Zentrum dieses Rectecks bis zu den Ecken
    +
    Returns the vectors from the center to the vertices of this rectangle. + The first vertex is the upper-right vertex at a rotation of 0. + Vertices are ordered counter-clockwise.
    +

    @@ -269,11 +269,10 @@
    -
    Ergibt die Ortsvektoren der Ecken dieses Rechtecks. - Erste Ecke entspricht der Ecke oben rechts bei einer Rotation von 0. - Folgende Ecken sind gegen den Uhrzeigersinn geordnet.
    -
    - Returns
    Ortsvektoren der Ecken dieses Rechtecks
    +
    Returns the position vectors of this rectangle's vertices. + The first vertex is the upper-right vertex at a rotation of 0. + Vertices are ordered counter-clockwise.
    +
    Overrides diff --git a/doc/sims/dynamics/RegularPolygon.html b/doc/sims/dynamics/RegularPolygon.html index 764f13c..e691f51 100644 --- a/doc/sims/dynamics/RegularPolygon.html +++ b/doc/sims/dynamics/RegularPolygon.html @@ -33,9 +33,10 @@
    extends Shape with ConvexPolygon with scala.Product
    -
    Ein regelmaessiges Polygon mit n Seiten, dass der Kreis mit radius radius umschreibt.
    +
    A regular polygon with n sides whose excircle has a radius radius.
    - Parameters
    n - Anzahl der Seiten.
    radius - Radius des umschreibenden Kreises.
    density - Dichte.
    + Parameters
    n - nmber of sides.
    radius - radius of the excircle
    density - density of this regular polygon
    + Throws
    IllegalArgumentException - if n is smaller than 3
    Direct Known Subclasses:
    GraphicalRegularPolygon
    @@ -52,7 +53,7 @@ I : Double -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    +
    Moment of inertia for a rotation about this shape's COM.
    @@ -71,7 +73,7 @@ Values and Variables inherited from Shape
    - uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes + uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, transientShapes
    @@ -162,7 +164,7 @@ vertices : scala.Array[Vector2D] -
    Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
    +
    Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.
    @@ -177,7 +179,7 @@ Methods inherited from Shape
    - mass, asBody, ^, ^ + mass, body, asBody, ~, ~
    - - - - @@ -73,7 +62,7 @@ collidable : Boolean -
    Kollisionsfaehigkeit.
    +
    Flag determining this shapes ability to collide with other shapes.
    @@ -84,7 +73,7 @@ density : Double -
    Dichte. (Masse pro Flaeche)
    +
    Density. (Mass per area)
    @@ -95,8 +84,8 @@ friction : Double -
    Teil des Reibungskoeffizienten bei einer Kollision zwischen dieser Form und einer anderen. - Der Reibungskoeffizient wird aus dem Produkt der beiden Teile der Formen errechnet.
    +
    Part of the coefficient of friction for a collision between this shape and another. + The coefficient of friction is calculated out of the product of this part and the other shape's part.
    @@ -107,7 +96,7 @@ pos : Vector2D -
    Position des Schwerpunktes in Welt.
    +
    Position of this shape's COM (in world coordinates).
    @@ -118,7 +107,7 @@ refLocalPos : Vector2D -
    Referenzposition in Koerper. Wird zur Rotation von Formen in Koerpern verwendet.
    +
    Local position of this shape's body COM to its COM at a body rotation of zero.
    @@ -129,8 +118,8 @@ restitution : Double -
    Teil der Stosszahl bei einer Kollision zwischen dieser Form und einer anderen. - Die Stosszahl wird aus dem Produkt der beiden Teile der Formen errechnet.
    +
    Part of the coefficient of restitution for a collision between this shape and another. + The coefficient of restitution is calculated out of the product of this part and the other shape's part.
    @@ -141,7 +130,7 @@ rotation : Double -
    Rotation. Entspricht Laenge des Rotationsvektors.
    +
    Rotation of this shape about its COM.
    @@ -152,7 +141,7 @@ rotation0 : Double -
    Initiale Rotation. (Rotation ohne Koerper)
    +
    Initial rotation. Rotation of this shape before it was added to a body.
    @@ -163,7 +152,7 @@ transientShapes : scala.collection.mutable.Set[Shape] -
    Formen mit denen diese Form nicht Kollidiert.
    +
    Shapes with which this shape cannot collide.
    @@ -174,7 +163,7 @@ uid : Int -
    Einzigartige Identifikationsnummer.
    +
    Unique identification number.
    @@ -185,7 +174,8 @@ volume : Double -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -209,7 +211,8 @@
    -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.
    @@ -228,9 +231,8 @@
    -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    -
    - Returns
    Traegheitsmoment zum Schwerpunkt
    +
    Moment of inertia for a rotation about this shape's COM.
    +
    Overrides @@ -259,9 +261,9 @@
    -
    Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
    +
    Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.
    - Returns
    Ortsvektoren der Ecken
    + Returns
    position vectors of the vertices
    Overrides diff --git a/doc/sims/dynamics/Shape.html b/doc/sims/dynamics/Shape.html index c62245d..f769f9b 100644 --- a/doc/sims/dynamics/Shape.html +++ b/doc/sims/dynamics/Shape.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Eine abstrakte Form.
    +
    An abstract shape.
    Direct Known Subclasses:
    @@ -51,18 +51,7 @@ I : Double -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    -
    - var - - body - : Body - -
    Beinhaltender Koerper. Sollte nicht selbst bei Initialisierung definiert werden.
    +
    Moment of inertia for a rotation about this shape's COM.
    @@ -199,7 +189,7 @@ AABB : AABB -
    Gibt das umfassende AABB dieser Form zurueck.
    +
    Returns this shape's axis aligned bounding box.
    @@ -207,21 +197,10 @@ def - ^ - (b : Body) : Body - -
    Erstellt einen Koerper aus dieser Form und den Formen des Koerpers b.
    - - - - - def - - - ^ - (s : Shape) : Body + asBody + : Body -
    Erstellt einen Koerper aus dieser Form und der Form s.
    +
    Creates a new body made out of tis shape.
    @@ -229,10 +208,10 @@ def - asBody + body : Body -
    Baut einen Koerper aus dieser Form.
    +
    Returns this shape's containing body.
    @@ -243,7 +222,7 @@ contains (point : Vector2D) : Boolean -
    Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
    +
    Checks if the point point is contained in this shape.
    @@ -254,7 +233,7 @@ mass : Double -
    Errechnet die Masse dieser Form. Masse ist gleich Volumen mal Dichte.
    +
    Returns the mass of this shape. The mass is given by volume times density.
    @@ -265,8 +244,29 @@ project (axis : Vector2D) : Projection -
    Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den - Richtungsvektor axis.
    +
    Returns the projection of this shape onto the line given by the directional vector axis.
    + + + + + def + + + ~ + (b : Body) : Body + +
    Creates a new body out of this shape and the shapes of body b.
    + + + + + def + + + ~ + (s : Shape) : Body + +
    Creates a new body out of this shape and the shape s.
    @@ -299,7 +299,7 @@
    -
    Einzigartige Identifikationsnummer.
    +
    Unique identification number.

    @@ -311,7 +311,7 @@
    -
    Kollisionsfaehigkeit.
    +
    Flag determining this shapes ability to collide with other shapes.

    @@ -323,8 +323,8 @@
    -
    Teil der Stosszahl bei einer Kollision zwischen dieser Form und einer anderen. - Die Stosszahl wird aus dem Produkt der beiden Teile der Formen errechnet.
    +
    Part of the coefficient of restitution for a collision between this shape and another. + The coefficient of restitution is calculated out of the product of this part and the other shape's part.

    @@ -336,8 +336,8 @@
    -
    Teil des Reibungskoeffizienten bei einer Kollision zwischen dieser Form und einer anderen. - Der Reibungskoeffizient wird aus dem Produkt der beiden Teile der Formen errechnet.
    +
    Part of the coefficient of friction for a collision between this shape and another. + The coefficient of friction is calculated out of the product of this part and the other shape's part.

    @@ -349,7 +349,7 @@
    -
    Position des Schwerpunktes in Welt.
    +
    Position of this shape's COM (in world coordinates).

    @@ -361,7 +361,7 @@
    -
    Rotation. Entspricht Laenge des Rotationsvektors.
    +
    Rotation of this shape about its COM.

    @@ -373,7 +373,7 @@
    -
    Initiale Rotation. (Rotation ohne Koerper)
    +
    Initial rotation. Rotation of this shape before it was added to a body.

    @@ -385,7 +385,7 @@
    -
    Referenzposition in Koerper. Wird zur Rotation von Formen in Koerpern verwendet.
    +
    Local position of this shape's body COM to its COM at a body rotation of zero.

    @@ -397,7 +397,7 @@
    -
    Dichte. (Masse pro Flaeche)
    +
    Density. (Mass per area)

    @@ -409,7 +409,8 @@
    -
    Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
    +
    Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + and is used with this shape's density to calculate its mass.

    @@ -421,20 +422,7 @@
    -
    Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
    -
    - Returns
    Traegheitsmoment zum Schwerpunkt
    -
    -
    -
    - - - var - body : Body -
    -
    -
    -
    Beinhaltender Koerper. Sollte nicht selbst bei Initialisierung definiert werden.
    +
    Moment of inertia for a rotation about this shape's COM.

    @@ -446,7 +434,7 @@
    -
    Formen mit denen diese Form nicht Kollidiert.
    +
    Shapes with which this shape cannot collide.

    @@ -460,9 +448,21 @@
    -
    Errechnet die Masse dieser Form. Masse ist gleich Volumen mal Dichte.
    +
    Returns the mass of this shape. The mass is given by volume times density.
    - Returns
    Masse der Form
    + Returns
    mass of this shape
    +
    +
    +
    + + + def + body : Body +
    +
    +
    +
    Returns this shape's containing body.
    +

    @@ -473,9 +473,8 @@
    -
    Gibt das umfassende AABB dieser Form zurueck.
    -
    - Returns
    umfassendes AABB
    +
    Returns this shape's axis aligned bounding box.
    +

    @@ -486,11 +485,10 @@
    -
    Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den - Richtungsvektor axis.
    +
    Returns the projection of this shape onto the line given by the directional vector axis.
    - Parameters
    axis - Richtungsvektor der Geraden
    - Returns
    Projektion dieser Form
    + Parameters
    axis - directional vector of the line
    + Returns
    projection of this shape

    @@ -501,7 +499,7 @@
    -
    Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
    +
    Checks if the point point is contained in this shape.

    @@ -513,32 +511,32 @@
    -
    Baut einen Koerper aus dieser Form.
    +
    Creates a new body made out of tis shape.
    - Returns
    ein Koerper bestehend aus dieser Form.
    + Returns
    a body made out of tis shape

    -
    +
    def - ^(s : Shape) : Body + ~(s : Shape) : Body
    -
    Erstellt einen Koerper aus dieser Form und der Form s.
    +
    Creates a new body out of this shape and the shape s.

    -
    +
    def - ^(b : Body) : Body + ~(b : Body) : Body
    -
    Erstellt einen Koerper aus dieser Form und den Formen des Koerpers b.
    +
    Creates a new body out of this shape and the shapes of body b.

    diff --git a/doc/sims/dynamics/World.html b/doc/sims/dynamics/World.html index f9b0217..d089cd9 100644 --- a/doc/sims/dynamics/World.html +++ b/doc/sims/dynamics/World.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Eine Welt enthaelt und Simuliert ein System aus Koerpern und Verbindungen.
    +
    A world contains and simulates a system of rigid bodies and joints.
    @@ -48,7 +48,7 @@ bodies : scala.collection.mutable.ArrayBuffer[Body] -
    Alle Koerper die diese Welt simuliert.
    +
    Bodies contained in this world.
    @@ -59,7 +59,7 @@ detector : Detector -
    Kollisionsdetektor dieser Welt.
    +
    Collsion detector who manages collision detection in this world.
    @@ -70,7 +70,7 @@ enableCollisionDetection : Boolean -
    Kollisionerkennung.
    +
    Flag to enable collision detection.
    @@ -81,7 +81,7 @@ enablePositionCorrection : Boolean -
    Positionskorrekturen.
    +
    Flag to enable position correction for constraints.
    @@ -92,7 +92,7 @@ gravity : Vector2D -
    Schwerkraft die in dieser Welt herrscht.
    +
    Gravity in this world.
    @@ -103,7 +103,7 @@ iterations : Int -
    Anzahl der Constraint-Korrekturen pro Zeitschritt.
    +
    Number of constraint corrections per time step.
    @@ -114,7 +114,7 @@ joints : scala.collection.mutable.ArrayBuffer[Joint] -
    Alle Verbindungen die diese Welt simuliert.
    +
    Joints contained in this world.
    @@ -125,7 +125,7 @@ minAngularVelocity : Double -
    Die minimale, nicht als null geltende Winkelgeschwindigkeit.
    +
    Minimal, non-zero angular velocity.
    @@ -136,7 +136,7 @@ minLinearVelocity : Double -
    Die minimale, nicht als null geltende Geschwindigkeit.
    +
    Minimal, non-zero linear velocity.
    @@ -147,7 +147,7 @@ monitors : scala.collection.mutable.ArrayBuffer[(java.lang.String, (Body) => java.lang.String)] -
    Ueberwachungsfunktionen fuer Koerper.
    +
    Monitoring methods for bodies.
    @@ -158,7 +158,7 @@ overCWarning : Boolean -
    Warnung wenn Koerper schneller als Lichtgeschwindigkeit.
    +
    Warning if a body's velocity exceeds the speed of light.
    @@ -169,7 +169,7 @@ time : Double -
    Aktuelle Zeit in Sekunden dieser Welt. Nach jedem Zeitschritt wird die Zeit erhoeht.
    +
    Current time in this world.
    @@ -180,7 +180,7 @@ timeStep : Double -
    Zeitschritt in dem diese Welt die Simulation vorranschreiten laesst.
    +
    Time intervals in which this world simulates.
    @@ -194,7 +194,7 @@ ++= (bs : scala.Seq[Body]) : Unit - +
    Adds the given sequence of bodies to this world.
    @@ -202,10 +202,10 @@ def - += - (p : Prefab) : Unit + += + (body : Body) : Unit -
    Fuegt dieser Welt ein vorangefertigtes System vaus Koerpern und Verbindungen hinzu.
    +
    Adds the given body to this world.
    @@ -213,10 +213,10 @@ def - += - (joint : Joint) : Unit + += + (p : Prefab) : Unit -
    Fuegt dieser Welt eine Verbindung hinzu.
    +
    Adds the given prefabricated system of bodies and joints to this world.
    @@ -224,10 +224,10 @@ def - += - (body : Body) : Unit + += + (joint : Joint) : Unit -
    Fuegt dieser Welt einen Koerper hinzu.
    +
    Adds the given joint to this world.
    @@ -238,7 +238,7 @@ --= (bs : scala.Seq[Body]) : Unit - +
    Removes the given sequence of bodies from this world.
    @@ -249,7 +249,7 @@ -= (p : Prefab) : Unit -
    Entfernt das gegebene System aus Koerpern und Verbindungen aus dieser Welt.
    +
    Removes the given prefabricated system of bodies and joints from this world.
    @@ -260,7 +260,7 @@ -= (body : Body) : Unit -
    Entfernt den gegebenen Koerper aus dieser Welt.
    +
    Removes the given body from this world.
    @@ -271,7 +271,7 @@ -= (joint : Joint) : Unit -
    Entfernt die gegebene Verbindung aus dieser Welt.
    +
    Removes the given joint from this world.
    @@ -282,7 +282,7 @@ clear : Unit -
    Entfernt alle Koerper, Verbindungen und Ueberwachungsfunktionen dieser Welt.
    +
    Removes all bodies, joints and monitoring methods from this world.
    @@ -293,7 +293,7 @@ info : java.lang.String -
    Ergibt Informationen ueber diese Welt.
    +
    Returns information about this world.
    @@ -304,7 +304,8 @@ postStep : Unit -
    Wird nach jedem Zeitschritt ausgefuehrt.
    +
    Initially empty method that is executed after each time step. This method + may be overriden to create custom behaviour in a world.
    @@ -315,7 +316,7 @@ shapes : scala.Seq[Shape] -
    Ergibt alle Formen aus allen Koerpern in dieser Welt.
    +
    Returns all shapes of all bodies in this world.
    @@ -326,9 +327,7 @@ step : Unit -
    Simuliert einen von timeStep angegebenen Zeitschritt. - Ihre Aufgabe ist es die Koerper dieser Welt so zu simulieren wie diese sich in einer Welt mit den gegebenen - Bedingungen verhalten wuerden.
    +
    Simulates a time step of the duration timeStep.
    @@ -361,7 +360,7 @@
    -
    Zeitschritt in dem diese Welt die Simulation vorranschreiten laesst.
    +
    Time intervals in which this world simulates.

    @@ -373,7 +372,7 @@
    -
    Anzahl der Constraint-Korrekturen pro Zeitschritt.
    +
    Number of constraint corrections per time step.

    @@ -385,7 +384,7 @@
    -
    Schwerkraft die in dieser Welt herrscht.
    +
    Gravity in this world.

    @@ -397,7 +396,7 @@
    -
    Alle Koerper die diese Welt simuliert.
    +
    Bodies contained in this world.

    @@ -409,7 +408,7 @@
    -
    Alle Verbindungen die diese Welt simuliert.
    +
    Joints contained in this world.

    @@ -421,9 +420,12 @@
    -
    Ueberwachungsfunktionen fuer Koerper. +
    Monitoring methods for bodies.

    - Das erste Element des Tuples ist die Ueberschrift und das zweite Element, der Wert.

    + 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.

    @@ -435,7 +437,7 @@
    -
    Kollisionsdetektor dieser Welt.
    +
    Collsion detector who manages collision detection in this world.

    @@ -447,7 +449,7 @@
    -
    Warnung wenn Koerper schneller als Lichtgeschwindigkeit.
    +
    Warning if a body's velocity exceeds the speed of light.

    @@ -459,7 +461,7 @@
    -
    Kollisionerkennung.
    +
    Flag to enable collision detection.

    @@ -471,7 +473,7 @@
    -
    Positionskorrekturen.
    +
    Flag to enable position correction for constraints.

    @@ -483,7 +485,7 @@
    -
    Die minimale, nicht als null geltende Geschwindigkeit.
    +
    Minimal, non-zero linear velocity.

    @@ -495,7 +497,7 @@
    -
    Die minimale, nicht als null geltende Winkelgeschwindigkeit.
    +
    Minimal, non-zero angular velocity.

    @@ -507,7 +509,7 @@
    -
    Aktuelle Zeit in Sekunden dieser Welt. Nach jedem Zeitschritt wird die Zeit erhoeht.
    +
    Current time in this world.

    @@ -521,7 +523,7 @@
    -
    Ergibt alle Formen aus allen Koerpern in dieser Welt.
    +
    Returns all shapes of all bodies in this world.

    @@ -533,7 +535,7 @@
    -
    Fuegt dieser Welt einen Koerper hinzu.
    +
    Adds the given body to this world.

    @@ -545,7 +547,7 @@
    -
    Fuegt dieser Welt eine Verbindung hinzu.
    +
    Adds the given joint to this world.

    @@ -557,7 +559,7 @@
    -
    Fuegt dieser Welt ein vorangefertigtes System vaus Koerpern und Verbindungen hinzu.
    +
    Adds the given prefabricated system of bodies and joints to this world.

    @@ -568,7 +570,10 @@ ++=(bs : scala.Seq[Body]) : Unit
    -

    + +
    Adds the given sequence of bodies to this world.
    +
    +
    @@ -578,7 +583,7 @@
    -
    Entfernt den gegebenen Koerper aus dieser Welt.
    +
    Removes the given body from this world.

    @@ -590,7 +595,7 @@
    -
    Entfernt die gegebene Verbindung aus dieser Welt.
    +
    Removes the given joint from this world.

    @@ -602,7 +607,7 @@
    -
    Entfernt das gegebene System aus Koerpern und Verbindungen aus dieser Welt.
    +
    Removes the given prefabricated system of bodies and joints from this world.

    @@ -613,7 +618,10 @@ --=(bs : scala.Seq[Body]) : Unit
    -

    + +
    Removes the given sequence of bodies from this world.
    +
    +
    @@ -623,7 +631,7 @@
    -
    Entfernt alle Koerper, Verbindungen und Ueberwachungsfunktionen dieser Welt.
    +
    Removes all bodies, joints and monitoring methods from this world.

    @@ -635,18 +643,16 @@
    -
    Simuliert einen von timeStep angegebenen Zeitschritt. - Ihre Aufgabe ist es die Koerper dieser Welt so zu simulieren wie diese sich in einer Welt mit den gegebenen - Bedingungen verhalten wuerden. +
    Simulates a time step of the duration timeStep.

    - Der Zeitschritt wird in folgenden Phasen ausgefuehrt: + The time step is simulated in the following phases:

      -
    1. Kraefte wirken auf die Koerper (z.B Schwerkraft, andere Kraftfaehige Objekte).
    2. -
    3. Beschleunigungen werden integriert.
    4. -
    5. Geschwindigkeiten werden korrigiert.
    6. -
    7. Geschwindigkeiten werden integriert.
    8. -
    9. Positionen werden korrigiert.
    10. -
    11. Die Methode postStep() wird ausgefuehrt.
    12. +
    13. Forces are applied to bodies.
    14. +
    15. Accelerations are integrated.
    16. +
    17. Velocities are corrected.
    18. +
    19. Velocities are integrated.
    20. +
    21. Postions are corrected.
    22. +
    23. The method postStep() is executed.

    @@ -659,7 +665,8 @@
    -
    Wird nach jedem Zeitschritt ausgefuehrt.
    +
    Initially empty method that is executed after each time step. This method + may be overriden to create custom behaviour in a world.

    @@ -671,7 +678,7 @@
    -
    Ergibt Informationen ueber diese Welt.
    +
    Returns information about this world.

    diff --git a/doc/sims/dynamics/joints$content.html b/doc/sims/dynamics/joints$content.html index 4652a21..141c3e3 100644 --- a/doc/sims/dynamics/joints$content.html +++ b/doc/sims/dynamics/joints$content.html @@ -13,7 +13,7 @@ DistanceJoint (val node1 : Body, val anchor1 : Vector2D, val node2 : Body, val anchor2 : Vector2D) extends Joint with scala.Product -
    DistanceJoints halten die Bindungspunkte auf ihren Bindungskoerpern bei einem konstanten Abstand.
    +
    DistanceJoints keep their connection points at a constant distance.
    @@ -24,7 +24,7 @@ ForceJoint extends AnyRef -
    Eine Verbindung die Kraft auf ihre Bindungskoerper ausueben kann.
    +
    A joint which can apply a force to its anchor bodies, thus adding or removing energy to the system.
    @@ -35,8 +35,8 @@ Joint extends Constraint with AnyRef -
    Joints sind Verbindungen die die Bewegung zwischen zwei Koerpern einschraenken. - Ihre Implementierung wurde von Erin Catto's box2d inspiriert.
    +
    Joints constrain the movement of two bodies. + Their implementation was inspired by Erin Catto's box2d.
    @@ -47,7 +47,9 @@ RevoluteJoint (val node1 : Body, val node2 : Body, val anchor : Vector2D) extends Joint with scala.Product -
    Ein Gelenk, dass zwei Koerper an einem Punkt verbindet. Inspiriert von JBox2D.
    +
    A revolute joint that connects two bodies at a singe point. Inspired from JBox2D. + Warning: there are still several bugs with revolute joints, if they are between two free + bodies and not connected at their respective COMs.
    @@ -58,7 +60,7 @@ SpringJoint (val node1 : Body, val anchor1 : Vector2D, val node2 : Body, val anchor2 : Vector2D, val springConstant : Double, val initialLength : Double) extends Joint with ForceJoint with scala.Product -
    Eine Hooksche Feder.
    +
    A spring obeying Hooke's law.
    diff --git a/doc/sims/dynamics/joints/DistanceJoint.html b/doc/sims/dynamics/joints/DistanceJoint.html index 80a0f2d..bae5f5d 100644 --- a/doc/sims/dynamics/joints/DistanceJoint.html +++ b/doc/sims/dynamics/joints/DistanceJoint.html @@ -33,9 +33,9 @@
    extends Joint with scala.Product
    -
    DistanceJoints halten die Bindungspunkte auf ihren Bindungskoerpern bei einem konstanten Abstand.
    +
    DistanceJoints keep their connection points at a constant distance.
    - Parameters
    node1 - erster Koerper der Verbindung
    anchor1 - Bindungspunkt auf Koerper eins
    node2 - zweiter Koerper der Verbindung
    anchor2 - Bindungspunkt auf Koerper zwei
    + Parameters
    node1 - first associated body
    anchor1 - first connection point
    node2 - second associated body
    anchor2 - second connection point
    @@ -62,7 +62,7 @@ distance : Double -
    Abstand der beiden Bindungspunkte bei initialisierung (der gewollte Abstand).
    +
    Distance between the two connection points at initialisation (the desired distance).
    Additional Constructor Summary
    @@ -76,7 +76,7 @@ connection1 : Vector2D -
    Ergibt den Bindungspunkt auf Koerper eins.
    +
    Returns the connection point on body one (in world coordinates).
    @@ -87,7 +87,7 @@ connection2 : Vector2D -
    Ergibt den Bindungspunkt auf Koerper zwei.
    +
    Returns the connection point on body two (in world coordinates).
    @@ -98,7 +98,7 @@ correctPosition (h : Double) : Unit -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    @@ -109,7 +109,7 @@ correctVelocity (h : Double) : Unit -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -187,7 +187,7 @@ v : Vector2D -
    Relative Geschwindigkeit der Bindungspunkte.
    +
    Relative velocity of the connection points.
    @@ -198,7 +198,7 @@ x : Vector2D -
    Relative Position der Bindungspunkte.
    +
    Relative position of the connection points.
    @@ -241,7 +241,7 @@
    -
    Abstand der beiden Bindungspunkte bei initialisierung (der gewollte Abstand).
    +
    Distance between the two connection points at initialisation (the desired distance).

    @@ -255,7 +255,7 @@
    -
    Ergibt den Bindungspunkt auf Koerper eins.
    +
    Returns the connection point on body one (in world coordinates).

    @@ -267,7 +267,7 @@
    -
    Ergibt den Bindungspunkt auf Koerper zwei.
    +
    Returns the connection point on body two (in world coordinates).

    @@ -279,7 +279,7 @@
    -
    Relative Position der Bindungspunkte.
    +
    Relative position of the connection points.

    @@ -291,7 +291,7 @@
    -
    Relative Geschwindigkeit der Bindungspunkte.
    +
    Relative velocity of the connection points.

    @@ -303,7 +303,7 @@
    -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -322,7 +322,7 @@
    -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    diff --git a/doc/sims/dynamics/joints/ForceJoint.html b/doc/sims/dynamics/joints/ForceJoint.html index bf8ac9f..58215b4 100644 --- a/doc/sims/dynamics/joints/ForceJoint.html +++ b/doc/sims/dynamics/joints/ForceJoint.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Eine Verbindung die Kraft auf ihre Bindungskoerper ausueben kann.
    +
    A joint which can apply a force to its anchor bodies, thus adding or removing energy to the system.
    Direct Known Subclasses:
    @@ -52,7 +52,7 @@ applyForce : Unit -
    Uebt eine Kraft auf die Bindungskoerper aus.
    +
    Applies a force on the achor bodies.
    @@ -86,7 +86,7 @@
    -
    Uebt eine Kraft auf die Bindungskoerper aus.
    +
    Applies a force on the achor bodies.

    diff --git a/doc/sims/dynamics/joints/Joint.html b/doc/sims/dynamics/joints/Joint.html index a577cde..0e6908f 100644 --- a/doc/sims/dynamics/joints/Joint.html +++ b/doc/sims/dynamics/joints/Joint.html @@ -33,12 +33,12 @@
    extends Constraint with AnyRef
    -
    Joints sind Verbindungen die die Bewegung zwischen zwei Koerpern einschraenken. - Ihre Implementierung wurde von Erin Catto's box2d inspiriert.
    +
    Joints constrain the movement of two bodies. + Their implementation was inspired by Erin Catto's box2d.
    Direct Known Subclasses:
    -
    DistanceJoint, RevoluteJoint, SpringJoint
    +
    DistanceJoint, RevoluteJoint, SpringJoint, PrismaticJoint, UnitCircleJoint

    @@ -52,7 +52,7 @@ node1 : Body -
    Erster Koerper der Verbindung.
    +
    First body of the joint.
    @@ -63,7 +63,7 @@ node2 : Body -
    Zweiter Koerper der Verbindung.
    +
    Second body of the joint.
    @@ -77,7 +77,7 @@ correctPosition (h : Double) : Unit -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    @@ -88,7 +88,7 @@ correctVelocity (h : Double) : Unit -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -121,7 +121,7 @@
    -
    Erster Koerper der Verbindung.
    +
    First body of the joint.

    @@ -133,7 +133,7 @@
    -
    Zweiter Koerper der Verbindung.
    +
    Second body of the joint.

    @@ -147,7 +147,7 @@
    -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -166,7 +166,7 @@
    -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    diff --git a/doc/sims/dynamics/joints/RevoluteJoint.html b/doc/sims/dynamics/joints/RevoluteJoint.html index b3059de..5184b29 100644 --- a/doc/sims/dynamics/joints/RevoluteJoint.html +++ b/doc/sims/dynamics/joints/RevoluteJoint.html @@ -33,7 +33,9 @@
    extends Joint with scala.Product
    -
    Ein Gelenk, dass zwei Koerper an einem Punkt verbindet. Inspiriert von JBox2D.
    +
    A revolute joint that connects two bodies at a singe point. Inspired from JBox2D. + Warning: there are still several bugs with revolute joints, if they are between two free + bodies and not connected at their respective COMs.
    @@ -71,7 +73,7 @@ correctPosition (h : Double) : Unit -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    @@ -82,7 +84,7 @@ correctVelocity (h : Double) : Unit -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -241,7 +243,7 @@
    -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -260,7 +262,7 @@
    -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    diff --git a/doc/sims/dynamics/joints/SpringJoint.html b/doc/sims/dynamics/joints/SpringJoint.html index b361835..4819b16 100644 --- a/doc/sims/dynamics/joints/SpringJoint.html +++ b/doc/sims/dynamics/joints/SpringJoint.html @@ -33,9 +33,9 @@
    extends Joint with ForceJoint with scala.Product
    -
    Eine Hooksche Feder.
    +
    A spring obeying Hooke's law.
    - Parameters
    node1 - erster Koerper der Verbindung
    anchor1 - Bindungspunkt auf Koerper eins
    node2 - zweiter Koerper der Verbindung
    anchor2 - Bindungspunkt auf Koerper zwei
    springConstant - Federkonstante
    initialLength - Initiallaenge
    + Parameters
    node1 - first associated body
    anchor1 - first connection point
    node2 - second associated body
    anchor2 - second connection point
    springConstant - spring constant
    initialLength - initial length
    @@ -44,8 +44,8 @@ def @@ -66,8 +66,8 @@ def @@ -84,7 +84,7 @@ damping : Double -
    Daempfung.
    +
    Damping.
    Additional Constructor Summary
    - this - (node1 : Body, node2 : Body, springConstant : Double) : SpringJoint + this + (node1 : Body, node2 : Body, springConstant : Double, initialLength : Double) : SpringJoint - this - (node1 : Body, node2 : Body, springConstant : Double, initialLength : Double) : SpringJoint + this + (node1 : Body, node2 : Body, springConstant : Double) : SpringJoint
    @@ -98,7 +98,7 @@ applyForce : Unit -
    Uebt die Federkraft auf die Bindungspunkte aus.
    +
    Applies the spring force to the connection points.
    @@ -109,7 +109,7 @@ connection1 : Vector2D -
    Ergibt den Bindungspunkt auf Koerper eins.
    +
    Returns the connection point on body one (in world coordinates).
    @@ -120,7 +120,7 @@ connection2 : Vector2D -
    Ergibt den Bindungspunkt auf Koerper zwei.
    +
    Returns the connection point on body two (in world coordinates).
    @@ -131,7 +131,7 @@ correctPosition (h : Double) : Unit -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    @@ -142,7 +142,7 @@ correctVelocity (h : Double) : Unit -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    @@ -165,7 +165,7 @@ force : Double -
    Ergibt die Federkraft nach dem Hookschen Gesetz.
    +
    Returns the spring force.
    @@ -223,6 +223,17 @@
    Returns a string representation of the object.
    + + + def + + + v + : Vector2D + +
    Relative velocity of the connection points.
    + + def @@ -231,7 +242,7 @@ x : Vector2D -
    Relative Position der Bindungspunkte.
    +
    Relative position of the connection points.
    @@ -292,7 +303,7 @@
    -
    Daempfung.
    +
    Damping.

    @@ -306,7 +317,7 @@
    -
    Ergibt den Bindungspunkt auf Koerper eins.
    +
    Returns the connection point on body one (in world coordinates).

    @@ -318,7 +329,7 @@
    -
    Ergibt den Bindungspunkt auf Koerper zwei.
    +
    Returns the connection point on body two (in world coordinates).

    @@ -330,7 +341,19 @@
    -
    Relative Position der Bindungspunkte.
    +
    Relative position of the connection points.
    +
    +
    +
    +
    + + + def + v : Vector2D +
    +
    +
    +
    Relative velocity of the connection points.

    @@ -342,7 +365,7 @@
    -
    Ergibt die Federkraft nach dem Hookschen Gesetz.
    +
    Returns the spring force.

    @@ -354,7 +377,7 @@
    -
    Uebt die Federkraft auf die Bindungspunkte aus.
    +
    Applies the spring force to the connection points.
    @@ -364,42 +387,42 @@ ForceJoint.applyForce

    -
    +
    def - correctPosition(h : Double) : Unit + correctVelocity(h : Double) : Unit
    -
    Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the velocities of this joint's associated bodies.
    Overrides
    - Joint.correctPosition + Joint.correctVelocity

    -
    +
    def - correctVelocity(h : Double) : Unit + correctPosition(h : Double) : Unit
    -
    Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
    +
    Corrects the positions of this joint's associated bodies.
    Overrides
    - Joint.correctVelocity + Joint.correctPosition

    diff --git a/doc/sims/dynamics/joints/test$content.html b/doc/sims/dynamics/joints/test$content.html new file mode 100644 index 0000000..6509725 --- /dev/null +++ b/doc/sims/dynamics/joints/test$content.html @@ -0,0 +1,45 @@ + + + All classes and objects in sims.dynamics.joints.test + + +
    Simple Mechanics Simulator (SiMS) API

    This document is the API specification for SiMS

    + + + + + + + + + +
    Class Summary
    + case class + + PrismaticJoint + (val node1 : Body, val anchor1 : Vector2D, val node2 : Body, val anchor2 : Vector2D) extends Joint with scala.Product + + +
    + class + + UnitCircleJoint + (body : Body, anchor : Vector2D) extends Joint + + +
    + + + + + + +
    Object Summary
    + object + + PrismaticJoint + extends (Body, Vector2D, Body, Vector2D) => PrismaticJoint + + +
    + \ No newline at end of file diff --git a/doc/sims/dynamics/joints/test$package.html b/doc/sims/dynamics/joints/test$package.html new file mode 100644 index 0000000..b34f98d --- /dev/null +++ b/doc/sims/dynamics/joints/test$package.html @@ -0,0 +1,17 @@ + + + List of classes and objects in package sims.dynamics.joints.test + + + + +
    Classes
    +
    Objects
    + \ No newline at end of file diff --git a/doc/sims/dynamics/joints/test/PrismaticJoint$object.html b/doc/sims/dynamics/joints/test/PrismaticJoint$object.html new file mode 100644 index 0000000..e460df7 --- /dev/null +++ b/doc/sims/dynamics/joints/test/PrismaticJoint$object.html @@ -0,0 +1,82 @@ + + + object PrismaticJoint in sims.dynamics.joints.test + + + + + + + + + + + +
    + sims.dynamics.joints.test +

    + object PrismaticJoint +

    +
    +
    +
    + + + object + PrismaticJoint +
    +
    extends (Body, Vector2D, Body, Vector2D) => PrismaticJoint
    +
    + + + + + + +
    + Methods inherited from scala.Function4 +
    + scala.Function4.toString, scala.Function4.curry +
    + + +
    + Methods inherited from AnyRef +
    + getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
    + + +
    + Methods inherited from Any +
    + ==, !=, isInstanceOf, asInstanceOf +
    + + + + + + + + +
    + + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/joints/test/PrismaticJoint.html b/doc/sims/dynamics/joints/test/PrismaticJoint.html new file mode 100644 index 0000000..a5c5a94 --- /dev/null +++ b/doc/sims/dynamics/joints/test/PrismaticJoint.html @@ -0,0 +1,502 @@ + + + class PrismaticJoint in sims.dynamics.joints.test + + + + + + + + + + + +
    + sims.dynamics.joints.test +

    + class PrismaticJoint +

    +
    +
    +
    + + case + class + PrismaticJoint(val node1 : Body, val anchor1 : Vector2D, val node2 : Body, val anchor2 : Vector2D) +
    +
    extends Joint with scala.Product
    +
    + + + + + + +
    Additional Constructor Summary
    + def + + this + (node1 : Body, node2 : Body) : PrismaticJoint + + +
    + + + + + + + +
    Value Summary
    + val + + angle + : Double + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    + def + + connection1 + : Vector2D + + +
    + def + + connection2 + : Vector2D + + +
    + def + + correctAngular + (h : Double) : Unit + + +
    + def + + correctLinear + (h : Double) : Unit + + +
    + def + + correctPosition + (h : Double) : Unit + +
    Corrects the positions of this joint's associated bodies.
    +
    + def + + correctVelocity + (h : Double) : Unit + +
    Corrects the velocities of this joint's associated bodies.
    +
    + override def + + equals + (arg0 : Any) : Boolean + +
    This method is used to compare the receiver object (this) + with the argument object (arg0) for equivalence.
    +
    + override def + + hashCode + : Int + +
    Returns a hash code value for the object.
    +
    + override def + + productArity + : Int + + +
    + override def + + productElement + (arg0 : Int) : Any + + +
    + override def + + productPrefix + : java.lang.String + + +
    + override def + + toString + : java.lang.String + +
    Returns a string representation of the object.
    +
    + def + + v + : Vector2D + + +
    + def + + x + : Vector2D + + +
    + + +
    + Methods inherited from AnyRef +
    + getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
    + + +
    + Methods inherited from Any +
    + ==, !=, isInstanceOf, asInstanceOf +
    + + + + +
    Additional Constructor Details
    +
    + + + def + this(node1 : Body, node2 : Body) : PrismaticJoint +
    +
    +

    + + + +
    Value Details
    +
    + + + val + angle : Double +
    +
    +

    + + +
    Method Details
    +
    + + + def + connection1 : Vector2D +
    +
    +

    +
    +
    + + + def + connection2 : Vector2D +
    +
    +

    +
    +
    + + + def + x : Vector2D +
    +
    +

    +
    +
    + + + def + v : Vector2D +
    +
    +

    +
    +
    + + + def + correctVelocity(h : Double) : Unit +
    +
    +
    +
    Corrects the velocities of this joint's associated bodies.
    +
    +
    +
    + Overrides +
    +
    + Joint.correctVelocity +
    +

    +
    +
    + + + def + correctLinear(h : Double) : Unit +
    +
    +

    +
    +
    + + + def + correctAngular(h : Double) : Unit +
    +
    +

    +
    +
    + + + def + correctPosition(h : Double) : Unit +
    +
    +
    +
    Corrects the positions of this joint's associated bodies.
    +
    +
    +
    + Overrides +
    +
    + Joint.correctPosition +
    +

    +
    +
    + + override + def + hashCode : Int +
    +
    +
    +
    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
    the hash code value for the object.

    +
    +
    +
    + + override + def + toString : java.lang.String +
    +
    +
    +
    Returns a string representation of the object. +

    + The default representation is platform dependent.

    +
    + Returns
    a string representation of the object.

    +
    +
    +
    + + override + def + equals(arg0 : Any) : Boolean +
    +
    +
    +
    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: +

      +
    • It is reflexive: for any instance x of type Any, + x.equals(x) should return true.
    • +
    • It is symmetric: for any instances x and y of type + Any, x.equals(y) should return true if and only + if y.equals(x) returns true.
    • +
    • It is transitive: for any instances + 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)).

    +
    + Parameters
    arg0 - the object to compare against this object for equality.
    + Returns
    true if the receiver object is equivalent to the argument; false otherwise.

    +
    +
    +
    + + override + def + productPrefix : java.lang.String +
    +
    +
    +
    + Overrides +
    +
    + scala.Product.scala.Product.productPrefix +
    +

    +
    +
    + + override + def + productArity : Int +
    +
    +
    +
    + Overrides +
    +
    + scala.Product.scala.Product.productArity +
    +

    +
    +
    + + override + def + productElement(arg0 : Int) : Any +
    +
    +
    +
    + Overrides +
    +
    + scala.Product.scala.Product.productElement +
    +

    + + +
    + + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/joints/test/UnitCircleJoint.html b/doc/sims/dynamics/joints/test/UnitCircleJoint.html new file mode 100644 index 0000000..b580f30 --- /dev/null +++ b/doc/sims/dynamics/joints/test/UnitCircleJoint.html @@ -0,0 +1,261 @@ + + + class UnitCircleJoint in sims.dynamics.joints.test + + + + + + + + + + + +
    + sims.dynamics.joints.test +

    + class UnitCircleJoint +

    +
    +
    +
    + + + class + UnitCircleJoint(body : Body, anchor : Vector2D) +
    +
    extends Joint
    +
    + + + + + + + + + + + + +
    Value Summary
    + val + + node1 + : Body + +
    First body of the joint.
    +
    + val + + node2 + : Body + +
    Second body of the joint.
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    Method Summary
    + def + + connection + : Vector2D + + +
    + def + + correctPosition + (h : Double) : Unit + +
    Corrects the positions of this joint's associated bodies.
    +
    + def + + correctVelocity + (h : Double) : Unit + +
    Corrects the velocities of this joint's associated bodies.
    +
    + def + + v + : Vector2D + + +
    + def + + x + : Vector2D + + +
    + + +
    + 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
    +
    + + + val + node1 : Body +
    +
    +
    +
    First body of the joint.
    +
    +
    +
    + Overrides +
    +
    + Joint.node1 +
    +

    +
    +
    + + + val + node2 : Body +
    +
    +
    +
    Second body of the joint.
    +
    +
    +
    + Overrides +
    +
    + Joint.node2 +
    +

    + + +
    Method Details
    +
    + + + def + connection : Vector2D +
    +
    +

    +
    +
    + + + def + x : Vector2D +
    +
    +

    +
    +
    + + + def + v : Vector2D +
    +
    +

    +
    +
    + + + def + correctVelocity(h : Double) : Unit +
    +
    +
    +
    Corrects the velocities of this joint's associated bodies.
    +
    +
    +
    + Overrides +
    +
    + Joint.correctVelocity +
    +

    +
    +
    + + + def + correctPosition(h : Double) : Unit +
    +
    +
    +
    Corrects the positions of this joint's associated bodies.
    +
    +
    +
    + Overrides +
    +
    + Joint.correctPosition +
    +

    + + +
    + + + + + + + + + \ No newline at end of file diff --git a/doc/sims/geometry$content.html b/doc/sims/geometry$content.html index e3cf2bb..d5e1e86 100644 --- a/doc/sims/geometry$content.html +++ b/doc/sims/geometry$content.html @@ -13,7 +13,7 @@ ConvexPolygon extends AnyRef -
    Gemeinsame Eigenschaften aller konvexen Polygone.
    +
    Common properties of all convex polygons.
    @@ -24,7 +24,7 @@ Projection (val axis : Vector2D, val lower : Double, val upper : Double) extends scala.Product -
    Projektion auf eine Achse.
    +
    Projection on an axis.
    @@ -35,7 +35,7 @@ Ray (val point : Vector2D, val direction : Vector2D) extends scala.Product -
    Eine Halbgerade wird definiert durch:
    +
    A ray.
    @@ -46,7 +46,7 @@ Segment (val vertex1 : Vector2D, val vertex2 : Vector2D) extends scala.Product -
    Ein Segment wird durch seine beiden Extrempunkte gegeben.
    +
    A segment is given by its vertices.
    @@ -57,7 +57,7 @@ Vector2D (val x : Double, val y : Double) extends scala.Product -
    Ein 2-dimensionaler Vektor.
    +
    A 2D vector.
    @@ -104,7 +104,7 @@ Vector2D extends AnyRef -
    Dieses Objekt enthaelt spezielle Vektoren.
    +
    Contains special vectors.
    diff --git a/doc/sims/geometry/ConvexPolygon.html b/doc/sims/geometry/ConvexPolygon.html index 0545761..5db8789 100644 --- a/doc/sims/geometry/ConvexPolygon.html +++ b/doc/sims/geometry/ConvexPolygon.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Gemeinsame Eigenschaften aller konvexen Polygone.
    +
    Common properties of all convex polygons.
    Direct Known Subclasses:
    @@ -52,7 +52,7 @@ AABB : AABB -
    Errechnet das AABB dieses Polygons
    +
    Returns this polygon's axis aligned bounding box.
    @@ -63,7 +63,7 @@ contains (point : Vector2D) : Boolean -
    Ueberprueft ob sich der gegebene Punkt point in diesem Polygon befindet.
    +
    Checks if the point point is contained in this polygon.
    @@ -74,8 +74,7 @@ project (axis : Vector2D) : Projection -
    Ergibt die Projektion dieses Polygons auf eine Gerade gegeben durch den - Richtungsvektor axis
    +
    Returns the projection of this polygon onto the line given by the directional vector axis.
    @@ -86,7 +85,8 @@ sides : scala.Array[Segment] -
    Ergibt alle Seiten dieses Polygons.
    +
    Returns all sides of this polygon. The sides are ordered counter-clockwise, the first vertex of the side + giving the side index.
    @@ -97,7 +97,7 @@ vertices : scala.Seq[Vector2D] -
    Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
    +
    Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.
    @@ -131,9 +131,9 @@
    -
    Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
    +
    Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.
    - Returns
    Ortsvektoren der Ecken
    + Returns
    position vectors of the vertices

    @@ -144,9 +144,9 @@
    -
    Ergibt alle Seiten dieses Polygons.
    -
    - Returns
    Seiten dieses Polygons
    +
    Returns all sides of this polygon. The sides are ordered counter-clockwise, the first vertex of the side + giving the side index.
    +

    @@ -157,11 +157,10 @@
    -
    Ergibt die Projektion dieses Polygons auf eine Gerade gegeben durch den - Richtungsvektor axis
    +
    Returns the projection of this polygon onto the line given by the directional vector axis.
    - Parameters
    axis - Richtungsvektor der Geraden
    - Returns
    Projektion dieses Polygons
    + Parameters
    axis - directional vector of the line
    + Returns
    projection of this polygon

    @@ -172,9 +171,8 @@
    -
    Errechnet das AABB dieses Polygons
    +
    Returns this polygon's axis aligned bounding box.
    - Returns
    umfassendes AABB
    See Also
    collision.AABB

    @@ -186,15 +184,12 @@
    -
    Ueberprueft ob sich der gegebene Punkt point in diesem Polygon befindet. +
    Checks if the point point is contained in this polygon.

    - Hierzu wird eine Halbgerade von dem Punkt in Richtung der X-Achse gezogen (koennte aber auch beliebig sein). - Dann wird die Anzahl der Ueberschneidungen der Halbgeraden mit den Seiten und Ecken des Polygons ermittelt. - Ist die Anzahl der Ueberschneidungen ungerade, so befindet sich der Punkt in dem Polygon. - Es gibt jedoch Ausnahmen, und zwar wenn die Halbgerade eine Ecke ueberschneidet, ueberschneidet sie sowohl auch zwei Seiten. - Daher wird eine generelle Anzahl von Uerberschneidungen errechnet, gegeben durch die Anzahl der Ueberschneidungen mit den Seiten minus - die mit den Ecken. - Diese Zahl wird dann wie oben geschildert geprueft.

    + A ray is created, originating from the point and following an arbitrary direction (X-Axis was chosen). + The number of intersections between the ray and this polygon's sides (including vertices) is counted. + The amount of intersections with vertices is substracted form the previuos number. + If the latter number is odd, the point is contained in the polygon.

    diff --git a/doc/sims/geometry/Projection.html b/doc/sims/geometry/Projection.html index 3599777..ad69275 100644 --- a/doc/sims/geometry/Projection.html +++ b/doc/sims/geometry/Projection.html @@ -33,11 +33,11 @@
    extends scala.Product
    -
    Projektion auf eine Achse. +
    Projection on an axis.

    - Ueblicherweise werden Projektionen in SiMS fuer Kollisionserkennung benutzt.

    + Projections are commonly used in SiMS for collision detection.
    - Parameters
    axis - Achse der Projektion
    lower - unterer Wert der Projektion
    upper - oberer Wert der Projektion
    + Parameters
    axis - directional vector of the axis of the projection
    lower - lower value of the projection
    upper - upper value of the projection
    @@ -75,7 +75,7 @@ overlap (other : Projection) : Double -
    Ergibt die Ueberlappung dieser Projektion und der Projektion other.
    +
    Returns the overlap between this projection and another projection other.
    @@ -86,7 +86,7 @@ overlaps (other : Projection) : Boolean -
    Ueberprueft ob sich diese Projektion mit der Projektion other ueberschneidet.
    +
    Checks this projection for overlap with another projection other.
    @@ -164,8 +164,9 @@
    -
    Ueberprueft ob sich diese Projektion mit der Projektion other ueberschneidet.
    -
    +
    Checks this projection for overlap with another projection other.
    +
    + Throws
    IllegalArgumentExcepion - if both projections axes aren't the same

    @@ -176,8 +177,9 @@
    -
    Ergibt die Ueberlappung dieser Projektion und der Projektion other.
    -
    +
    Returns the overlap between this projection and another projection other.
    +
    + Throws
    IllegalArgumentExcepion - if both projections axes aren't the same

    diff --git a/doc/sims/geometry/Ray.html b/doc/sims/geometry/Ray.html index 558153d..79288ce 100644 --- a/doc/sims/geometry/Ray.html +++ b/doc/sims/geometry/Ray.html @@ -33,9 +33,10 @@
    extends scala.Product
    -
    Eine Halbgerade wird definiert durch:
    +
    A ray.
    - Parameters
    point - ein Aufpunkt
    direction - ein Richtungsvektor
    + Parameters
    point - a point on the ray
    direction - this ray's directional vector
    + Throws
    IllegalArgumentException - if the directional vector is the null vector
    @@ -50,10 +51,7 @@ contains (p : Vector2D) : Boolean -
    Ueberprueft ob diese Halbgerade den gegebenen Punkt enthaelt. -
    - Hierzu wird der Vektor von dem Ursprungspunkt zu dem zu ueberpruefenden Punkt gebildet. Dieser wird dann mit dem Richtungsvektor - auf Kolinearitaet geprueft.
    +
    Checks if this ray contains the point p.
    @@ -87,7 +85,7 @@ intersects (s : Segment) : Boolean -
    Ueberprueft ob diese Halbgerade das gegebene Segment ueberschneidet.
    +
    Checks this ray and the given segment for intersection.
    @@ -165,9 +163,9 @@
    -
    Ueberprueft ob diese Halbgerade das gegebene Segment ueberschneidet.
    +
    Checks this ray and the given segment for intersection.
    - Parameters
    das - auf Ueberschneidung zu uerberpruefende Segment
    + Parameters
    s - the segment to test for intersection

    @@ -178,12 +176,8 @@
    -
    Ueberprueft ob diese Halbgerade den gegebenen Punkt enthaelt. -
    - Hierzu wird der Vektor von dem Ursprungspunkt zu dem zu ueberpruefenden Punkt gebildet. Dieser wird dann mit dem Richtungsvektor - auf Kolinearitaet geprueft.
    -
    - Parameters
    p - Ortsvektor des oben genannten Punkt
    +
    Checks if this ray contains the point p.
    +

    diff --git a/doc/sims/geometry/Segment.html b/doc/sims/geometry/Segment.html index 2cc0453..084cfb6 100644 --- a/doc/sims/geometry/Segment.html +++ b/doc/sims/geometry/Segment.html @@ -33,9 +33,10 @@
    extends scala.Product
    -
    Ein Segment wird durch seine beiden Extrempunkte gegeben.
    +
    A segment is given by its vertices.
    - Parameters
    vertex1 - Ortsvektor des 1. Extrempunkts
    vertex2 - Ortsvektor des 2. Extrempunkts
    + Parameters
    vertex1 - position vector of the first vertex
    vertex2 - position vector of the second vertex
    + Throws
    IllegalArgumentException - if both vertices are equal
    @@ -49,7 +50,7 @@ d : Vector2D -
    Vektor von EP1 zu EP2.
    +
    Vector from vertex1 to vertex2.
    @@ -60,7 +61,7 @@ d0 : Vector2D -
    Einheitsrichtungsvektor.
    +
    Unit directional vector.
    @@ -71,7 +72,7 @@ length : Double -
    Laenge dieses Segments.
    +
    Length of this segment.
    @@ -82,7 +83,7 @@ n : Vector2D -
    Normalenvektor. Richtung: 90 Grad rechts zu d.
    +
    Right normal vector.
    @@ -93,7 +94,7 @@ n0 : Vector2D -
    Normaleneinheitsvektor. Richtung: 90 Grad rechts zu d.
    +
    Right normal unit vector.
    @@ -118,7 +119,7 @@ distance (point : Vector2D) : Double -
    Kleinster Abstand zwischen diesem Segment und dem Punkt p.
    +
    Smallest distance between this segment and the point point.
    @@ -218,7 +219,7 @@
    -
    Laenge dieses Segments.
    +
    Length of this segment.

    @@ -230,7 +231,7 @@
    -
    Vektor von EP1 zu EP2.
    +
    Vector from vertex1 to vertex2.

    @@ -242,7 +243,7 @@
    -
    Einheitsrichtungsvektor.
    +
    Unit directional vector.

    @@ -254,7 +255,7 @@
    -
    Normalenvektor. Richtung: 90 Grad rechts zu d.
    +
    Right normal vector.

    @@ -266,7 +267,7 @@
    -
    Normaleneinheitsvektor. Richtung: 90 Grad rechts zu d.
    +
    Right normal unit vector.

    @@ -280,7 +281,7 @@
    -
    Kleinster Abstand zwischen diesem Segment und dem Punkt p.
    +
    Smallest distance between this segment and the point point.

    diff --git a/doc/sims/geometry/Vector2D$object.html b/doc/sims/geometry/Vector2D$object.html index 188f206..ee73bb6 100644 --- a/doc/sims/geometry/Vector2D$object.html +++ b/doc/sims/geometry/Vector2D$object.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Dieses Objekt enthaelt spezielle Vektoren.
    +
    Contains special vectors.
    @@ -48,7 +48,7 @@ Null : Vector2D -
    Nullvektor.
    +
    Null vector.
    @@ -59,7 +59,7 @@ i : Vector2D -
    Ein horizontaler Einheitsvektor mit den Komponenten (1;0).
    +
    Horizontal unit vector. (1,0)
    @@ -70,7 +70,7 @@ j : Vector2D -
    Ein vertikaler Einheitsvektor mit den Komponenten (0;1).
    +
    Vertical unit vector. (0,1)
    @@ -104,7 +104,7 @@
    -
    Nullvektor.
    +
    Null vector.

    @@ -116,7 +116,7 @@
    -
    Ein horizontaler Einheitsvektor mit den Komponenten (1;0).
    +
    Horizontal unit vector. (1,0)

    @@ -128,7 +128,7 @@
    -
    Ein vertikaler Einheitsvektor mit den Komponenten (0;1).
    +
    Vertical unit vector. (0,1)

    diff --git a/doc/sims/geometry/Vector2D.html b/doc/sims/geometry/Vector2D.html index 5e541fb..816428e 100644 --- a/doc/sims/geometry/Vector2D.html +++ b/doc/sims/geometry/Vector2D.html @@ -33,9 +33,9 @@
    extends scala.Product
    -
    Ein 2-dimensionaler Vektor.
    +
    A 2D vector.
    - Parameters
    x - 1. Komponente
    y - 2. Komponente
    + Parameters
    x - 1st component
    y - 2nd component
    @@ -49,7 +49,7 @@ length : Double -
    Norm dieses Vektors.
    +
    Norm or length of this vector.
    @@ -63,7 +63,7 @@ * (n : Double) : Vector2D -
    Multiplikation mit einem Skalar.
    +
    Scalar multiplication.
    @@ -74,7 +74,7 @@ + (v : Vector2D) : Vector2D -
    Vektoraddition.
    +
    Vector addition.
    @@ -85,7 +85,7 @@ - (v : Vector2D) : Vector2D -
    Vektorsubstraktion.
    +
    Vector substraction.
    @@ -96,7 +96,7 @@ / (n : Double) : Vector2D -
    Division durch ein Skalar.
    +
    Scalar division.
    @@ -107,7 +107,7 @@ components : scala.List[Double] -
    Ergibt eine Liste der Komponenten dieses Vektors.
    +
    Returns a list of this vector's components.
    @@ -118,7 +118,7 @@ cross (v : Vector2D) : Double -
    Kreuzprodukt. (Norm des Kreuzproduktes)
    +
    Cross product. Length only because in 2D. The direction would be given by the x3-axis.
    @@ -129,7 +129,7 @@ dot (v : Vector2D) : Double -
    Skalarprodukt.
    +
    Dot product.
    @@ -163,7 +163,7 @@ isNull : Boolean -
    Ueberprueft, ob die Komponenten dieses Vektors gleich Null sind.
    +
    Checks if this vector is the null vector.
    @@ -174,7 +174,7 @@ leftNormal : Vector2D -
    Linker Normalenvektor. (-y, x)
    +
    Left normal vector. (-y, x)
    @@ -218,7 +218,7 @@ project (v : Vector2D) : Vector2D -
    Errechnet die Projektion dieses- auf einen anderen Vektor.
    +
    Returns the projection of this vector onto the vector v.
    @@ -229,7 +229,7 @@ rightNormal : Vector2D -
    Rechter Normalenvektor. (y, -x)
    +
    Right normal vector. (y, -x)
    @@ -240,7 +240,7 @@ rotate (angle : Double) : Vector2D -
    Errechnet eine Rotation dieses Vektors.
    +
    Returns a rotation of this vector by angle radian.
    @@ -262,7 +262,7 @@ unary_- : Vector2D -
    Minusvorzeichen.
    +
    Unary minus.
    @@ -273,7 +273,7 @@ unit : Vector2D -
    Einheitsvektor dieses Vektors.
    +
    Unit vector.
    @@ -306,7 +306,7 @@
    -
    Norm dieses Vektors.
    +
    Norm or length of this vector.

    @@ -320,10 +320,8 @@
    -
    Vektoraddition.
    -
    - Parameters
    v - zu addierender Vektor
    - Returns
    dieser Vektor addiert mit v
    +
    Vector addition.
    +

    @@ -334,10 +332,8 @@
    -
    Vektorsubstraktion.
    -
    - Parameters
    v - zu substrahierender Vektor
    - Returns
    dieser Vektor substrahiert mit v
    +
    Vector substraction.
    +

    @@ -348,10 +344,8 @@
    -
    Multiplikation mit einem Skalar.
    -
    - Parameters
    n - Faktor
    - Returns
    dieser Vektor multipliziert mit n
    +
    Scalar multiplication.
    +

    @@ -362,10 +356,8 @@
    -
    Division durch ein Skalar.
    -
    - Parameters
    n - Nenner
    - Returns
    dieser Vektor dividiert durch n
    +
    Scalar division.
    +

    @@ -376,7 +368,7 @@
    -
    Minusvorzeichen.
    +
    Unary minus.

    @@ -388,10 +380,8 @@
    -
    Skalarprodukt.
    -
    - Parameters
    v - ein anderer Vektor
    - Returns
    Skalarprodukt von diesem Vektor mit v
    +
    Dot product.
    +

    @@ -402,10 +392,8 @@
    -
    Kreuzprodukt. (Norm des Kreuzproduktes)
    -
    - Parameters
    v - ein anderer Vektor
    - Returns
    Norm des Kreuzproduktes dieses Vektors mit v. Die Richtung wuerde der x3-Achse entsprechen.
    +
    Cross product. Length only because in 2D. The direction would be given by the x3-axis.
    +

    @@ -416,7 +404,7 @@
    -
    Einheitsvektor dieses Vektors.
    +
    Unit vector.

    @@ -428,10 +416,8 @@
    -
    Errechnet die Projektion dieses- auf einen anderen Vektor.
    -
    - Parameters
    v - oben gennanter Vektor
    - Returns
    Projektion dieses Vektors auf v
    +
    Returns the projection of this vector onto the vector v.
    +

    @@ -442,10 +428,8 @@
    -
    Errechnet eine Rotation dieses Vektors.
    -
    - Parameters
    angle - Winkel in Radian
    - Returns
    der um angle rad rotierte Vektor
    +
    Returns a rotation of this vector by angle radian.
    +

    @@ -456,7 +440,7 @@
    -
    Linker Normalenvektor. (-y, x)
    +
    Left normal vector. (-y, x)

    @@ -468,7 +452,7 @@
    -
    Rechter Normalenvektor. (y, -x)
    +
    Right normal vector. (y, -x)

    @@ -480,7 +464,7 @@
    -
    Ueberprueft, ob die Komponenten dieses Vektors gleich Null sind.
    +
    Checks if this vector is the null vector.

    @@ -492,7 +476,7 @@
    -
    Ergibt eine Liste der Komponenten dieses Vektors.
    +
    Returns a list of this vector's components.

    diff --git a/doc/sims/math$content.html b/doc/sims/math$content.html index 871d764..8d2df26 100644 --- a/doc/sims/math$content.html +++ b/doc/sims/math$content.html @@ -13,7 +13,7 @@ Matrix22 (val c11 : Double, val c12 : Double, val c21 : Double, val c22 : Double) extends scala.Product -
    Eine 2x2, quadratische Matrix.
    +
    A 2x2 matrix.
    diff --git a/doc/sims/math/Matrix22.html b/doc/sims/math/Matrix22.html index b3a5906..b07482d 100644 --- a/doc/sims/math/Matrix22.html +++ b/doc/sims/math/Matrix22.html @@ -33,9 +33,9 @@
    extends scala.Product
    -
    Eine 2x2, quadratische Matrix.
    +
    A 2x2 matrix.
    - Parameters
    c11 - Komponente 1,1
    c12 - Komponente 1,2
    c21 - Komponente 2,1
    c22 - Komponente 2,2
    + Parameters
    c11 - component 1,1
    c12 - component 1,2
    c21 - component 2,1
    c22 - component 2,2
    @@ -47,8 +47,7 @@ this (c1 : Vector2D, c2 : Vector2D) : Matrix22 -
    Eine 2x2-dimensionale, quadratische Matrix kann auch mit zwei 2-dimensionalen - Vektoren erstellt werden. In diesem Fall repraesentiert jeder Vektor eine Spalte.
    +
    A 2x2 matrix can be created with two 2D vectors. In this case, each column is represented by a vector.
    Additional Constructor Summary
    @@ -61,10 +60,10 @@ def - * - (n : Double) : Matrix22 + * + (v : Vector2D) : Vector2D -
    Multiplikation mit einem Skalar.
    +
    Multiplikation with a 2D vector.
    @@ -72,10 +71,10 @@ def - * - (v : Vector2D) : Vector2D + * + (m : Matrix22) : Matrix22 -
    Multiplikation mit einer 2x1-Matrix (2-dimensionaler Vektor).
    +
    Matrix multiplication.
    @@ -83,10 +82,10 @@ def - * - (m : Matrix22) : Matrix22 + * + (n : Double) : Matrix22 -
    Multiplikation mit einer anderen 2x2-Matrix.
    +
    Scalar multiplication.
    @@ -108,7 +107,7 @@ det : Double -
    Ergibt die Determinante dieser Matrix.
    +
    Determinant of this matrix.
    @@ -217,10 +216,9 @@
    -
    Eine 2x2-dimensionale, quadratische Matrix kann auch mit zwei 2-dimensionalen - Vektoren erstellt werden. In diesem Fall repraesentiert jeder Vektor eine Spalte.
    +
    A 2x2 matrix can be created with two 2D vectors. In this case, each column is represented by a vector.
    - Parameters
    c1 - erste Spalte
    c2 - zweite Spalte
    + Parameters
    c1 - first column
    c2 - second column

    @@ -235,9 +233,8 @@
    -
    Ergibt die Determinante dieser Matrix.
    -
    - Returns
    Determinante dieser Matrix
    +
    Determinant of this matrix.
    +

    @@ -260,7 +257,7 @@
    -
    Multiplikation mit einem Skalar.
    +
    Scalar multiplication.

    @@ -272,7 +269,7 @@
    -
    Multiplikation mit einer anderen 2x2-Matrix.
    +
    Matrix multiplication.

    @@ -284,7 +281,7 @@
    -
    Multiplikation mit einer 2x1-Matrix (2-dimensionaler Vektor).
    +
    Multiplikation with a 2D vector.

    diff --git a/doc/sims/util$content.html b/doc/sims/util$content.html index 48b8a1e..8db8c6c 100644 --- a/doc/sims/util$content.html +++ b/doc/sims/util$content.html @@ -13,7 +13,7 @@ Polar (val distance : Double, val angle : Double) extends scala.Product -
    Polare Koordinaten.
    +
    Polar coordinates.
    @@ -49,7 +49,7 @@ Positioning extends AnyRef -
    Objekt mit Hiflsfunktionen fuer komfortables Positionieren von Koerpern.
    +
    Utility functions for comfortable positioning of bodies.
    diff --git a/doc/sims/util/Polar.html b/doc/sims/util/Polar.html index 7f3f444..78fa78d 100644 --- a/doc/sims/util/Polar.html +++ b/doc/sims/util/Polar.html @@ -33,7 +33,7 @@
    extends scala.Product
    -
    Polare Koordinaten.
    +
    Polar coordinates.
    @@ -105,7 +105,7 @@ toCarthesian : Vector2D -
    Ergibt die Vektorrepraesantation dieser polaren Koordinaten.
    +
    Returns the vector representation of these polar coordinates.
    @@ -150,7 +150,7 @@
    -
    Ergibt die Vektorrepraesantation dieser polaren Koordinaten.
    +
    Returns the vector representation of these polar coordinates.

    diff --git a/doc/sims/util/Positioning$object.html b/doc/sims/util/Positioning$object.html index eecdee9..3a9b6c0 100644 --- a/doc/sims/util/Positioning$object.html +++ b/doc/sims/util/Positioning$object.html @@ -33,7 +33,7 @@
    extends AnyRef
    -
    Objekt mit Hiflsfunktionen fuer komfortables Positionieren von Koerpern.
    +
    Utility functions for comfortable positioning of bodies.
    diff --git a/doc/sims/util/RelativeVector.html b/doc/sims/util/RelativeVector.html index 323edb5..b2512f4 100644 --- a/doc/sims/util/RelativeVector.html +++ b/doc/sims/util/RelativeVector.html @@ -109,8 +109,8 @@ def - left - (s : Shape) : Vector2D + left + (point : Vector2D) : Vector2D @@ -120,8 +120,8 @@ def - left - (point : Vector2D) : Vector2D + left + (s : Shape) : Vector2D @@ -131,8 +131,8 @@ def - right - (s : Shape) : Vector2D + right + (point : Vector2D) : Vector2D @@ -142,8 +142,8 @@ def - right - (point : Vector2D) : Vector2D + right + (s : Shape) : Vector2D diff --git a/src/graphyx/tests/Friction2.scala b/src/graphyx/tests/Friction2.scala index 6eb445b..f6731e2 100644 --- a/src/graphyx/tests/Friction2.scala +++ b/src/graphyx/tests/Friction2.scala @@ -26,7 +26,7 @@ object Friction2 extends Test{ ground.rotation = -0.2 world += ground - val b: Body = (new Circle(0.1,10)) ^ (new Circle(0.1,10) {pos = Vector2D(0.2,0)}) ^ (new Circle(0.1,10) {pos = Vector2D(0.4,0)}) + val b: Body = (new Circle(0.1,10)) ~ (new Circle(0.1,10) {pos = Vector2D(0.2,0)}) ~ (new Circle(0.1,10) {pos = Vector2D(0.4,0)}) b.pos = Vector2D(0.1,0.1) world += b } diff --git a/src/graphyx/tests/General1.scala b/src/graphyx/tests/General1.scala index 1a71c24..7d8703b 100644 --- a/src/graphyx/tests/General1.scala +++ b/src/graphyx/tests/General1.scala @@ -103,7 +103,7 @@ object General1 extends Test{ ground.fixed = true world += ground - world += (new Circle(0.1,1) {pos = Vector2D(2,2)}) ^ (new Circle(0.1,1) {pos = Vector2D(2,2.2)}) + world += (new Circle(0.1,1) {pos = Vector2D(2,2)}) ~ (new Circle(0.1,1) {pos = Vector2D(2,2.2)}) } override def fireEvent() = blastBomb diff --git a/src/graphyx/tests/Spring.scala b/src/graphyx/tests/Spring.scala index 4eec8de..439259f 100644 --- a/src/graphyx/tests/Spring.scala +++ b/src/graphyx/tests/Spring.scala @@ -7,8 +7,8 @@ import java.io._ object Spring extends Test{ val title = "Spring" - val fout = new java.io.FileOutputStream("out.csv") - val sout = new java.io.PrintStream(fout) + //val fout = new java.io.FileOutputStream("out.csv") + //val sout = new java.io.PrintStream(fout) val world = new World { override def postStep = { //for (b <- bodies; if (b.monitor)) sout.println(monitors(0)._2(b)) diff --git a/src/sims/collision/AABB.scala b/src/sims/collision/AABB.scala index 51b3e12..ea696f2 100644 --- a/src/sims/collision/AABB.scala +++ b/src/sims/collision/AABB.scala @@ -9,18 +9,17 @@ package sims.collision import geometry._ /** - * Axis Aligned Bounding Boxes, kurz AABBs, sind Rechtecke die eine bestimmte Form umhuellen. - * Da AABBs nach den X- und Y-Achsen orientiert sind, ermoeglichen sie eine schnelle - * und einfache Feststellung ob zwei AABBs sich ueberschneiden. - * @param minVertex Ortsvektor der minimalen Ecke des AABBs - * @param maxVertex Ortsvektor der maximalen Ecke des AABBs + * Axis Aligned Bounding Boxes (AABBs) are rectangles that frame a shape. + * Their X-Axis and Y-Axis orientation makes it easy to test two AABBs for overlap. + * @param minVertex Position vector of the bottom-left vertex + * @param maxVertex Position vector of the upper-right vertex */ case class AABB(val minVertex: Vector2D, val maxVertex: Vector2D) { /** - * Ueberprueft ob dieses AABB sich mit dem AABB box ueberschneidet. - * @param box das mit diesem auf Ueberschneidung zu ueberpruefende AABB*/ + * Checks this AABB with box for overlap. + * @param box AABB with which to check for overlap*/ def overlaps(box: AABB): Boolean = { val d1 = box.minVertex - maxVertex val d2 = minVertex - box.maxVertex diff --git a/src/sims/collision/CircleCollision.scala b/src/sims/collision/CircleCollision.scala index baf401a..e77c8e2 100644 --- a/src/sims/collision/CircleCollision.scala +++ b/src/sims/collision/CircleCollision.scala @@ -9,7 +9,7 @@ package sims.collision import geometry._ import dynamics._ -/**Kollision zwischen zwei Kreisen.*/ +/**Collision between two circles.*/ case class CircleCollision(c1: Circle, c2: Circle) extends Collision { val shape1 = c1 val shape2 = c2 diff --git a/src/sims/collision/Collision.scala b/src/sims/collision/Collision.scala index d674b30..ce09ac2 100644 --- a/src/sims/collision/Collision.scala +++ b/src/sims/collision/Collision.scala @@ -9,19 +9,19 @@ package sims.collision import dynamics._ import geometry._ -/**Kollisionen zwischen zwei Formen enthalten Methoden zur Berrechnen der Kollisionsreaktion.*/ +/**Collision between two shapes. Contains methods to compute the collision response.*/ abstract class Collision extends Constraint { - /**Erste Kollisionsform (Referenz).*/ + /**First colliding shape (reference shape).*/ val shape1: Shape - /**Zweite Kollisionsform (eindringend).*/ + /**Second colliding shape (incident shape).*/ val shape2: Shape - /**Kollisionspunkte.*/ + /**Collision points.*/ val points: Iterable[Vector2D] - /**Normalenvektor zu der Kollisionsebene.*/ + /**Normal vector to the collision face.*/ val normal: Vector2D /* C = delta @@ -103,6 +103,6 @@ abstract class Collision extends Constraint { object Collision { - /**Erlaubte Ueberlappung.*/ + /**Tolerated overlap. Collision response will only be applied if the overlap of two shapes exceeds the tolerated overlap.*/ val ToleratedOverlap: Double = 0.01 } diff --git a/src/sims/collision/Detector.scala b/src/sims/collision/Detector.scala index e847235..0a3ad5b 100644 --- a/src/sims/collision/Detector.scala +++ b/src/sims/collision/Detector.scala @@ -12,12 +12,12 @@ import sims.dynamics._ import scala.collection._ import scala.collection.mutable._ -/**Eine Welt ermittelt ihre Kollisionen durch konkrete Implementierungen dieser Klasse.*/ +/**A world detects its collisions through concrete implementations of this class.*/ abstract class Detector { - /**Die Welt dessen Formen auf Kollisionen ueberprueft werden sollen.*/ + /**The world whose shapes are to be checked for collisions.*/ val world: World - /**Ergibt alle Kollisionen zwischen Formen der Welt world.*/ + /**Returns all collisions between shapes in the world world.*/ def collisions: Seq[Collision] } \ No newline at end of file diff --git a/src/sims/collision/GridDetector.scala b/src/sims/collision/GridDetector.scala index 2c027a3..f5ed99a 100644 --- a/src/sims/collision/GridDetector.scala +++ b/src/sims/collision/GridDetector.scala @@ -11,11 +11,11 @@ import sims.geometry._ import scala.collection._ import scala.collection.mutable._ -/**Eine konkrete Implementierung von Detector. GridDetector ermittelt - * alle Kollisionen mit einem Gittersystem.*/ +/**A conrete implementation of Detector. GridDetector divides the world into a grid + * for faster collision detection.*/ class GridDetector(override val world: World) extends Detector { - /**Array von Kollisionserkennungsmethoden fuer Formenpaare.*/ + /**Array of collision detection methods. These methods return true if two shapes are colliding.*/ val detectionMethods = new ArrayBuffer[PartialFunction[(Shape, Shape), Boolean]] detectionMethods += { case (c1: Circle, c2: Circle) => { //Kollision wenn Distanz <= Summe der Radien @@ -41,7 +41,7 @@ class GridDetector(override val world: World) extends Detector { } } - /**Array von Kollisionsmethoden fuer Formenpaare.*/ + /**Array of methods returning collisions. It is assumed that both shapes are colliding.*/ val collisionMethods = new ArrayBuffer[PartialFunction[(Shape, Shape), Collision]] collisionMethods += { case (c1: Circle, c2: Circle) => CircleCollision(c1, c2) @@ -50,34 +50,34 @@ class GridDetector(override val world: World) extends Detector { case (c: Circle, p: ConvexPolygon) => PolyCircleCollision(p, c) } - /**Gibt an, ob das Formenpaar p kollidiert. - * @param p Formenpaar.*/ + /**Checks the pair of shapes p for collision. + * @param p Pair of shapes.*/ def colliding(p: Pair) = { if (detectionMethods.exists(_.isDefinedAt(p))) detectionMethods.find(_.isDefinedAt(p)).get.apply(p) else throw new IllegalArgumentException("No collision method for colliding pair!") } - /**Gibt die Kollision des Formenpaares p zurueck. - * @param p Formenpaar.*/ + /**Returns the collision between both shapes of the pair p. + * @param p Pair of shapes.*/ def collision(p: Pair): Collision = { if (collisionMethods.exists(_.isDefinedAt(p))) collisionMethods.find(_.isDefinedAt(p)).get.apply(p) else throw new IllegalArgumentException("No collision found in colliding pair!") } - /**Breite und Hoehe einer Gitterzelle.*/ + /**Width and height of a grid cell.*/ var gridSide: Double = 2 - /**Ergibt potenzielle Kollisionspaare der Welt world. + /**Returns potential colliding pairs of shapes of the world world. *

    - * Ein Kollisionspaar ist ein Paar aus zwei verschiedenen Formen, das folgenden Bedingungen unterliegt: + * A potential colliding pair is a pair of two shapes that comply with the following criteria: *

      - *
    • Die Formen muessen sich in der gleichen Gitterzelle befinden.
    • - *
    • Ihre AABBs muessen sich ueberlappen.
    • - *
    • Die Formen duerfen nicht von dem gleichen Koerper sein.
    • - *
    • Mindestens eine Form darf nicht Fixiert sein.
    • - *
    • Beide muessen {@link dynamics.Shape#collidable collidierbar} sein.
    • + *
    • The shapes are situated in the same grid cell.
    • + *
    • Their AABBs overlap.
    • + *
    • The shapes do not belong to the same body.
    • + *
    • At least one shape is not fixed.
    • + *
    • Both shapes are {@link dynamics.Shape#collidable}.
    • *
    */ def getPairs = { val grid = new HashMap[(Int, Int), List[Shape]] @@ -110,13 +110,13 @@ class GridDetector(override val world: World) extends Detector { private var cache = (world.time, getPairs) - /**Alle potentiellen Kollisionspaare der Welt. + /**All potential colliding pairs of the world. * @see getPairs*/ def pairs = {if (world.time != cache._1) cache = (world.time, getPairs); cache._2} - /**Ergibt alle kollidierenden Paare.*/ + /**Returns all colliding pairs.*/ def collidingPairs: Seq[Pair] = for(p <- pairs; if (colliding(p))) yield p - /**Ergibt alle Kollisionen.*/ + /**Returns all collisions.*/ def collisions: Seq[Collision] = for(p <- pairs; if (colliding(p))) yield collision(p) } diff --git a/src/sims/collision/Pair.scala b/src/sims/collision/Pair.scala index 048748d..e4ae947 100644 --- a/src/sims/collision/Pair.scala +++ b/src/sims/collision/Pair.scala @@ -8,7 +8,7 @@ package sims.collision import sims.dynamics._ -/**Formenpaar.*/ +/**Pair of shapes.*/ case class Pair(s1: Shape, s2: Shape) extends Tuple2(s1, s2){ def this(t: Tuple2[Shape, Shape]) = this(t._1, t._2) diff --git a/src/sims/collision/PolyCircleCollision.scala b/src/sims/collision/PolyCircleCollision.scala index 1bf982e..20f1d49 100644 --- a/src/sims/collision/PolyCircleCollision.scala +++ b/src/sims/collision/PolyCircleCollision.scala @@ -9,7 +9,7 @@ package sims.collision import sims.dynamics._ import sims.geometry._ -/**Kollision zwischen einem konvexen Polygon und einem Kreis.*/ +/**Collision between a convex polygon and a circle.*/ case class PolyCircleCollision(p: ConvexPolygon, c: Circle) extends Collision { require(p.isInstanceOf[Shape]) val shape1 = p.asInstanceOf[Shape] @@ -33,6 +33,4 @@ case class PolyCircleCollision(p: ConvexPolygon, c: Circle) extends Collision { val points = List( c.pos - normal * c.radius ) - - } diff --git a/src/sims/collision/PolyCollision.scala b/src/sims/collision/PolyCollision.scala index 3eeb7ca..b4fa917 100644 --- a/src/sims/collision/PolyCollision.scala +++ b/src/sims/collision/PolyCollision.scala @@ -11,7 +11,7 @@ import sims.dynamics._ import scala.collection.mutable.Map import scala.collection.mutable._ -/**Kollision zwischen zwei konvexen Polygonen.*/ +/**Collision between two convex polygons.*/ case class PolyCollision(p1: ConvexPolygon, p2: ConvexPolygon) extends Collision { require(p1.isInstanceOf[Shape]) require(p2.isInstanceOf[Shape]) diff --git a/src/sims/dynamics/Body.scala b/src/sims/dynamics/Body.scala index d5b2a0e..8c0e2ee 100644 --- a/src/sims/dynamics/Body.scala +++ b/src/sims/dynamics/Body.scala @@ -1,3 +1,4 @@ + /* * Simple Mechanics Simulator (SiMS) * copyright (c) 2009 Jakob Odersky @@ -9,17 +10,17 @@ package sims.dynamics import sims.geometry._ import sims.dynamics.joints._ -/**Ein 2-Dimensionaler Koerper besteht aus mehreren Formen. Im gegensatz zu letzteren, enthaelt ein Koerper dynamische Informationen (v, F, etc...). - * @param shps zu dem Koerper gehoerende Formen.*/ +/**A two dimensional rigid body is made out of shapes. + * @param shps shapes that belong to this body.*/ class Body(shps: Shape*){ - /**Einzigartige Identifikationsnummer dieses Koerpers.*/ + /**Unique identification number.*/ val uid = Body.nextUid - /**Formen aus denen dieser Koerper besteht.*/ + /**Shapes that belong to this body.*/ val shapes: List[Shape] = shps.toList - //Formen werden bei Initialisierung eingefuegt + //Shapes are added during initialisation. for (s <- shapes) { s.body = this s.refLocalPos = s.pos - pos @@ -28,41 +29,40 @@ class Body(shps: Shape*){ private var isFixed: Boolean = false - /**Gibt an ob dieser Koerper fixiert ist.*/ + /**Returns whether this body is fixed or not.*/ def fixed = isFixed - /**Fixiert oder unfixiert diesen Koerper.*/ + /**Fixes or frees this body. By fixing, linear and angular velocities are set to zero.*/ def fixed_=(value: Boolean) = { if (value) {linearVelocity = Vector2D.Null; angularVelocity = 0.0} isFixed = value } - /**Gibt an ob die Eigenschaften dieses Koerpers ueberwacht werden sollen. + /**Flag for a world to monitor the properties of this body. * @see World#monitors*/ var monitor: Boolean = false - /**Ermittelt die Position dieses Koerpers. Die Position entspricht dem Schwerpunkt. - * @return Position dieses Koerpers*/ - def pos: Vector2D = // Shwerpunkt = sum(pos*mass)/M + /**Returns the position of this body. The position is equivalent to the center of mass. + * @return position of this body*/ + def pos: Vector2D = // COM = sum(pos*mass)/M (Vector2D.Null /: shapes)((v: Vector2D, s: Shape) => v + s.pos * s.mass) / (0.0 /: shapes)((i: Double, s: Shape) => i + s.mass) - /**Setzt die Position dieses Koerpers und verschiebt dadurch die Positionen seiner Formen. - * @param newPos neue Position*/ + /**Sets the position of this body. By doing so all its shapes are translated. + * @param newPos new position*/ def pos_=(newPos: Vector2D) = { val stepPos = pos shapes.foreach((s: Shape) => s.pos = s.pos - stepPos + newPos) } - /**Enthaelt die aktuelle Rotation dieses Koerpers.*/ - private var _rotation: Double = 0.0 //shapes(0).rotation + /**Contains the current rotation of this body.*/ + private var _rotation: Double = 0.0 - /**Ergibt die aktuelle Rotation dieses Koerpers. - * @return aktuelle Rotation dieses Koerpers*/ + /**Returns the current rotation of this body.*/ def rotation: Double = _rotation - /**Setzt die Rotation dieses Koerpers. Dazu werden auch die Positionen und Rotationen seiner Formen entsprechend veraendert. - * @param r neue Rotation*/ + /**Sets the rotation of this body. Position and rotation of shapes are modified accordingly. + * @param r new rotation*/ def rotation_=(newRotation: Double) = { _rotation = newRotation val stepPos = pos @@ -72,69 +72,67 @@ class Body(shps: Shape*){ } } - /**Lineargeschwindigkeit dieses Koerpers.*/ + /**Linear velocity of this body.*/ var linearVelocity: Vector2D = Vector2D.Null - /**Winkelgeschwindigkeit dieses Koerpers.*/ + /**Angular velocity of this body.*/ var angularVelocity: Double = 0 - /**Lineargeschwindigkeit des gegebenen Punktes auf diesem Koerper. In Weltkoordinaten.*/ + /**Linear velocity of the given point on this body (in world coordinates).*/ def velocityOfPoint(point: Vector2D) = linearVelocity + ((point - pos).leftNormal * angularVelocity) - /**Resultierende Kraft auf den Schwerpunkt dieses Koerpers.*/ + /**Resulting force on the COM of this body.*/ var force: Vector2D = Vector2D.Null - /**Resultierender Drehmoment zu dem Schwerpunkt dieses Koerpers.*/ + /**Resulting torque on this body.*/ var torque: Double = 0 - /**Ergibt die Masse dieses Koerpers. Die Masse ist gleich die Summe aller Massen seiner Formen. - * @return Masse des Koerpers*/ + /**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). + * @return this body's mass*/ def mass: Double = if (fixed) Double.PositiveInfinity else (0.0 /: shapes)((i: Double, s: Shape) => i + s.mass) - /**Ergibt den Traegheitsmoment zu dem Schwerpunkt dieses Koerpers. Der Traegheitsmoment wird mit Hilfe des Steinerschen Satzes errechnet. - * @return Traegheitsmoment relativ zu dem Schwerpunkt dieses Koerpers*/ + /**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). + * @return moment of inertia for rotations about the COM of this body*/ def I: Double = if (fixed) Double.PositiveInfinity else (0.0 /: (for (s <- shapes) yield (s.I + s.mass * ((s.pos - pos) dot (s.pos - pos)))))(_+_) - /**Wendet eine Kraft auf den Schwerpunkt dieses Koerpers an. - * @param force anzuwendender Kraftvektor*/ + /**Applies a force to the COM of this body. + * @param force applied force*/ def applyForce(force: Vector2D) = if (!fixed) this.force += force - /**Wendet eine Kraft auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses - * Koerpers ueberprueft. - * @param force anzuwendender Kraftvektor - * @param point Ortsvektor des Punktes auf den die Kraft wirken soll (gegeben in Weltkoordinaten).*/ + /**Applies a force to a point on this body. Warning: the point is considered to be contained within this body. + * @param force applied force + * @param point position vector of the point (in world coordinates)*/ def applyForce(force: Vector2D, point: Vector2D) = if (!fixed) {this.force += force; torque += (point - pos) cross force} - /**Wendet einen Impuls auf den Schwerpunkt dieses Koerpers an. - * @param impulse anzuwendender Impulsvektor*/ + /**Applies an impulse to the COM of this body. + * @param impulse applied impulse*/ def applyImpulse(impulse: Vector2D) = if (!fixed) linearVelocity += impulse / mass - /**Wendet einen Impuls auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses - * Koerpers ueberprueft. - * @param impulse anzuwendender Impulsvektor - * @param point Ortsvektor des Punktes auf den der Impuls wirken soll (gegeben in Weltkoordinaten).*/ + /**Applies an impulse to a point on this body. Warning: the point is considered to be contained within this body. + * @param impulse applied impulse + * @param point position vector of the point (in world coordinates)*/ def applyImpulse(impulse: Vector2D, point: Vector2D) = if (!fixed) {linearVelocity += impulse / mass; angularVelocity += ((point - pos) cross impulse) / I} - /**Ueberprueft ob der gegebene Punkt point sich in diesem Koerper befindet.*/ + /**Checks if the point point is contained in this body.*/ def contains(point: Vector2D) = shapes.exists(_.contains(point)) override def toString: String = { "Body" + uid + " " + shapes + " fixed=" + fixed + " m=" + mass + " I=" + I + " pos=" + pos + " rot=" + rotation + " v=" + linearVelocity + " w=" + angularVelocity + " F=" + force + " tau=" + torque } - /**Erstellt einen neuen Koerper der zusaetzlich die Form s enthaelt. - * @param s zusaetzliche Form - * @return neuer Koerper*/ - def ^(s: Shape) = new Body((s :: shapes): _*) - - /**Erstellt einen neuen Koerper der zusaetzlich die Formen von dem Koerper b enthaelt. - * @param b Koerper mit zusaetzlichen Formen - * @return neuer Koerper*/ - def ^(b: Body) = { - val shapes = this.shapes ::: b.shapes - new Body(shapes: _*) - } + /**Creates a new body containing this body's shapes and the shape s. + * @param s new shape + * @return new body*/ + def ~(s: Shape) = new Body((s :: shapes): _*) + + /**Creates a new body containing this body's shapes and the shapes of another body b. + * @param b body with extra shapes + * @return new body*/ + def ~(b: Body) = new Body((this.shapes ::: b.shapes): _*) } object Body { diff --git a/src/sims/dynamics/Circle.scala b/src/sims/dynamics/Circle.scala index 26f3ad4..b1d3703 100644 --- a/src/sims/dynamics/Circle.scala +++ b/src/sims/dynamics/Circle.scala @@ -10,18 +10,16 @@ import sims.geometry._ import sims.collision._ /** - * Circle ist die Definition eines Kreises. - * @param radius Radius dieses Kreises - * @param density Dichte dieses Kreises + * A circle. + * @param radius radius of this circle + * @param density density of this circle */ -case class Circle(radius: Double, // Radius - density: Double) extends Shape{ // Dichte +case class Circle(radius: Double, density: Double) extends Shape{ val volume = Math.Pi * radius * radius val I = mass * radius * radius / 2 - // AABB(Zentrum - Radius, Zentrum + Radius) def AABB = new AABB(pos - Vector2D(radius,radius), pos + Vector2D(radius,radius)) @@ -32,6 +30,5 @@ case class Circle(radius: Double, // Radius (pos.project(axis).y / axis.y) - radius, (pos.project(axis).y / axis.y) + radius) - //Ist der gegebene punkt im Radius dieses kreises? def contains(point: Vector2D) = (point - pos).length <= radius } diff --git a/src/sims/dynamics/Constraint.scala b/src/sims/dynamics/Constraint.scala index 74c2af3..eaa6952 100644 --- a/src/sims/dynamics/Constraint.scala +++ b/src/sims/dynamics/Constraint.scala @@ -6,14 +6,16 @@ package sims.dynamics -/**Randbedingungen erben von dem Trait Constraint. - * Fuer jeden Constraint koennen Position und Geschwindigkeit korrigiert werden. - * Ihre Implementierung wurde von Erin Catto's box2d inspiriert.*/ +/**All constraints in SiMS implement this trait. + * Position and velocity can be corrected for each constraint. + * The implementation of constraints was inspired by Erin Catto's box2d.*/ trait Constraint { - /**Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.*/ + /**Corrects the velocities of bodies according to this constraint. + * @param h a time interval, used for converting forces and impulses*/ def correctVelocity(h: Double): Unit - /**Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.*/ + /**Corrects the positions of bodies according to this constraint. + * @param h a time interval, used for converting forces and impulses*/ def correctPosition(h: Double): Unit } diff --git a/src/sims/dynamics/Rectangle.scala b/src/sims/dynamics/Rectangle.scala index adaa634..89ab4c0 100644 --- a/src/sims/dynamics/Rectangle.scala +++ b/src/sims/dynamics/Rectangle.scala @@ -9,10 +9,10 @@ package sims.dynamics import sims.geometry._ import sims.collision._ -/**Rechteck ist eine Art Polygon. - * @param halfWidth halbe Breite dieses Rechtecks - * @param halfHeight halbe Hoehe dieses Rechtecks - * @param density dichte dieses Rechtecks +/**A rectangle is a polygon. + * @param halfWidth this rectangle's half width + * @param halfHeight this rectangle's half height + * @param density density of this rectangle */ case class Rectangle(halfWidth: Double, halfHeight : Double, @@ -22,19 +22,17 @@ case class Rectangle(halfWidth: Double, val I = 1.0 / 12.0 * mass * ((2 * halfWidth) * (2 * halfWidth) + (2 * halfHeight) * (2 * halfHeight)) - /**Ergibt Vektoren vom Zentrum dieses Rectecks bis zu den Ecken. - * Erste Ecke entspricht der Ecke oben rechts bei einer Rotation von 0. - * Folgende Ecken sind gegen den Uhrzeigersinn geordnet. - * @return Vektoren vom Zentrum dieses Rectecks bis zu den Ecken*/ + /**Returns the vectors from the center to the vertices of this rectangle. + * The first vertex is the upper-right vertex at a rotation of 0. + * Vertices are ordered counter-clockwise.*/ def halfDiags: Array[Vector2D] = Array(Vector2D(halfWidth, halfHeight), Vector2D(-halfWidth, halfHeight), Vector2D(-halfWidth, -halfHeight), Vector2D(halfWidth, -halfHeight)) map (_ rotate rotation) - /**Ergibt die Ortsvektoren der Ecken dieses Rechtecks. - * Erste Ecke entspricht der Ecke oben rechts bei einer Rotation von 0. - * Folgende Ecken sind gegen den Uhrzeigersinn geordnet. - * @return Ortsvektoren der Ecken dieses Rechtecks*/ + /**Returns the position vectors of this rectangle's vertices. + * The first vertex is the upper-right vertex at a rotation of 0. + * Vertices are ordered counter-clockwise.*/ def vertices = for (h <- halfDiags) yield pos + h } \ No newline at end of file diff --git a/src/sims/dynamics/RegularPolygon.scala b/src/sims/dynamics/RegularPolygon.scala index c5b8a13..b49d100 100644 --- a/src/sims/dynamics/RegularPolygon.scala +++ b/src/sims/dynamics/RegularPolygon.scala @@ -9,17 +9,17 @@ package sims.dynamics import Math._ import sims.geometry._ -/**Ein regelmaessiges Polygon mit n Seiten, dass der Kreis mit radius radius umschreibt. - * @param n Anzahl der Seiten. - * @param radius Radius des umschreibenden Kreises. - * @param density Dichte. - */ +/**A regular polygon with n sides whose excircle has a radius radius. + * @param n nmber of sides. + * @param radius radius of the excircle + * @param density density of this regular polygon + * @throws IllegalArgumentException if n is smaller than 3 */ case class RegularPolygon(n: Int, radius: Double, density: Double) extends Shape with ConvexPolygon{ - require(n >= 3, "Polygon must have at least 3 sides.") + require(n >= 3, "A polygon must have at least 3 sides.") - /**Hoehe eines der konstituierneden Dreiecke des Polygons.*/ + /**Height of one of the constituting triangles.*/ private val h: Double = radius * cos(Pi / n) - /**Halbe Breite eines der konstituierneden Dreiecke des Polygons.*/ + /**Half width of one of the constituting triangles.*/ private val b: Double = radius * sin(Pi / n) def halfDiags = (for (i: Int <- (0 until n).toArray) yield (Vector2D(0, radius) rotate (2 * Pi * i / n))) map (_ rotate rotation) @@ -28,7 +28,7 @@ case class RegularPolygon(n: Int, radius: Double, density: Double) extends Shape val volume = n * h * b - /**Traegheitsmoment eines der konstituierneden Dreiecke im Zentrum des Polygons.*/ + /**Moment of inertia of one of the constituting triangles about the center of this polygon.*/ private val Ic: Double = density * b * (3 * b + 16) * h * h * h * h / 54 val I = n * Ic diff --git a/src/sims/dynamics/Shape.scala b/src/sims/dynamics/Shape.scala index f57bbc6..47a4199 100644 --- a/src/sims/dynamics/Shape.scala +++ b/src/sims/dynamics/Shape.scala @@ -10,78 +10,82 @@ import sims.geometry._ import sims.collision._ /** -* Eine abstrakte Form. +* An abstract shape. */ abstract class Shape{ - /**Einzigartige Identifikationsnummer.*/ + /**Unique identification number.*/ val uid: Int = Shape.nextUid - /**Kollisionsfaehigkeit.*/ + /**Flag determining this shapes ability to collide with other shapes.*/ var collidable: Boolean = true - /**Teil der Stosszahl bei einer Kollision zwischen dieser Form und einer anderen. - * Die Stosszahl wird aus dem Produkt der beiden Teile der Formen errechnet.*/ + /**Part of the coefficient of restitution for a collision between this shape and another. + * The coefficient of restitution is calculated out of the product of this part and the other shape's part.*/ var restitution: Double = 0.7 - /**Teil des Reibungskoeffizienten bei einer Kollision zwischen dieser Form und einer anderen. - * Der Reibungskoeffizient wird aus dem Produkt der beiden Teile der Formen errechnet.*/ + /**Part of the coefficient of friction for a collision between this shape and another. + * The coefficient of friction is calculated out of the product of this part and the other shape's part.*/ var friction: Double = 0.707 - /**Position des Schwerpunktes in Welt.*/ + /**Position of this shape's COM (in world coordinates).*/ var pos: Vector2D = Vector2D.Null - /**Rotation. Entspricht Laenge des Rotationsvektors.*/ + /**Rotation of this shape about its COM.*/ var rotation: Double = 0 - /**Initiale Rotation. (Rotation ohne Koerper)*/ + /**Initial rotation. Rotation of this shape before it was added to a body.*/ var rotation0 = 0.0 - /**Referenzposition in Koerper. Wird zur Rotation von Formen in Koerpern verwendet.*/ + /**Local position of this shape's body COM to its COM at a body rotation of zero.*/ var refLocalPos: Vector2D = Vector2D.Null - /**Dichte. (Masse pro Flaeche)*/ + /**Density. (Mass per area)*/ val density: Double - /**Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.*/ + /**Volume. The volume is actually equivalent to this shape's area (SiMS is in 2D) + * and is used with this shape's density to calculate its mass.*/ val volume: Double - /**Errechnet die Masse dieser Form. Masse ist gleich Volumen mal Dichte. - @return Masse der Form*/ + /**Returns the mass of this shape. The mass is given by volume times density. + @return mass of this shape*/ def mass = volume * density - /**Errechnet Traegheitsmoment zum Schwerpunkt dieser Form. - @return Traegheitsmoment zum Schwerpunkt*/ + /**Moment of inertia for a rotation about this shape's COM.*/ val I: Double - /**Beinhaltender Koerper. Sollte nicht selbst bei Initialisierung definiert werden.*/ - var body: Body = _ + /**Containing body.*/ + private var _body: Body = _ - /**Gibt das umfassende AABB dieser Form zurueck. - @return umfassendes AABB*/ + /**Returns this shape's containing body.*/ + def body = _body + + /**Sets this shape's containing body.*/ + private[dynamics] def body_=(b: Body) = _body = b + + /**Returns this shape's axis aligned bounding box.*/ def AABB: AABB - /**Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den - * Richtungsvektor axis. - * @param axis Richtungsvektor der Geraden - * @return Projektion dieser Form*/ + /**Returns the projection of this shape onto the line given by the directional vector axis. + * @param axis directional vector of the line + * @return projection of this shape*/ def project(axis: Vector2D): Projection - /**Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.*/ + /**Checks if the point point is contained in this shape.*/ def contains(point: Vector2D): Boolean - /**Baut einen Koerper aus dieser Form. - @return ein Koerper bestehend aus dieser Form. */ + /**Creates a new body made out of tis shape. + @return a body made out of tis shape*/ def asBody = new Body(this) - /**Formen mit denen diese Form nicht Kollidiert.*/ + /**Shapes with which this shape cannot collide.*/ val transientShapes: collection.mutable.Set[Shape] = collection.mutable.Set() - /**Erstellt einen Koerper aus dieser Form und der Form s.*/ - def ^(s: Shape) = new Body(this, s) + /**Creates a new body out of this shape and the shape s.*/ + def ~(s: Shape) = new Body(this, s) - /**Erstellt einen Koerper aus dieser Form und den Formen des Koerpers b.*/ - def ^(b: Body) = { + /**Creates a new body out of this shape and the shapes of body b.*/ + def ~(b: Body) = { val shapes = this :: b.shapes new Body(shapes: _*) } diff --git a/src/sims/dynamics/World.scala b/src/sims/dynamics/World.scala index 7b165f5..0230a50 100644 --- a/src/sims/dynamics/World.scala +++ b/src/sims/dynamics/World.scala @@ -11,104 +11,107 @@ import sims.collision._ import sims.dynamics.joints._ import scala.collection.mutable._ -/**Eine Welt enthaelt und Simuliert ein System aus Koerpern und Verbindungen.*/ +/**A world contains and simulates a system of rigid bodies and joints.*/ class World { - /**Zeitschritt in dem diese Welt die Simulation vorranschreiten laesst.*/ + /**Time intervals in which this world simulates.*/ var timeStep: Double = 1.0 / 60 - /**Anzahl der Constraint-Korrekturen pro Zeitschritt.*/ + /**Number of constraint corrections per time step.*/ var iterations: Int = 10 - /**Schwerkraft die in dieser Welt herrscht.*/ + /**Gravity in this world.*/ var gravity = Vector2D(0, -9.81) - /**Alle Koerper die diese Welt simuliert.*/ + /**Bodies contained in this world.*/ val bodies = new ArrayBuffer[Body] - /**Alle Verbindungen die diese Welt simuliert.*/ + /**Joints contained in this world.*/ val joints = new ArrayBuffer[Joint] - /**Ueberwachungsfunktionen fuer Koerper. + /**Monitoring methods for bodies. *

    - * Das erste Element des Tuples ist die Ueberschrift und das zweite Element, der Wert.*/ + * 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 monitors = new ArrayBuffer[(String, Body => String)] - /**Kollisionsdetektor dieser Welt.*/ + /**Collsion detector who manages collision detection in this world.*/ val detector: Detector = new GridDetector(this) - /**Warnung wenn Koerper schneller als Lichtgeschwindigkeit.*/ + /**Warning if a body's velocity exceeds the speed of light.*/ var overCWarning = false - /**Kollisionerkennung.*/ + /**Flag to enable collision detection.*/ var enableCollisionDetection = true - /**Positionskorrekturen.*/ + /**Flag to enable position correction for constraints.*/ var enablePositionCorrection = true - /**Die minimale, nicht als null geltende Geschwindigkeit.*/ + /**Minimal, non-zero linear velocity.*/ var minLinearVelocity: Double = 0.0001 - /**Die minimale, nicht als null geltende Winkelgeschwindigkeit.*/ + /**Minimal, non-zero angular velocity.*/ var minAngularVelocity: Double = 0.0001 - /**Ergibt alle Formen aus allen Koerpern in dieser Welt.*/ + /**Returns all shapes of all bodies in this world.*/ def shapes = for (b <- bodies; s <- b.shapes) yield s - /**Fuegt dieser Welt einen Koerper hinzu.*/ + /**Adds the given body to this world.*/ def +=(body: Body) = bodies += body - /**Fuegt dieser Welt eine Verbindung hinzu.*/ + /**Adds the given joint to this world.*/ def +=(joint: Joint): Unit = joints += joint - /**Fuegt dieser Welt ein vorangefertigtes System vaus Koerpern und Verbindungen hinzu.*/ + /**Adds the given prefabricated system of bodies and joints to this world.*/ def +=(p: prefabs.Prefab): Unit = { for (b <- p.bodies) this += b for (j <- p.joints) this += j } + /**Adds the given sequence of bodies to this world.*/ def ++=(bs: Seq[Body]): Unit = for(b <- bs) this += b - /**Entfernt den gegebenen Koerper aus dieser Welt.*/ + /**Removes the given body from this world.*/ def -=(body: Body): Unit = bodies -= body - /**Entfernt die gegebene Verbindung aus dieser Welt.*/ + /**Removes the given joint from this world.*/ def -=(joint: Joint): Unit = joints -= joint - /**Entfernt das gegebene System aus Koerpern und Verbindungen aus dieser Welt.*/ + /**Removes the given prefabricated system of bodies and joints from this world.*/ def -=(p: prefabs.Prefab): Unit = { for (b <- p.bodies) this -= b for (j <- p.joints) this -= j } + /**Removes the given sequence of bodies from this world.*/ def --=(bs: Seq[Body]) = for(b <- bs) this -= b - /**Entfernt alle Koerper, Verbindungen und Ueberwachungsfunktionen dieser Welt.*/ + /**Removes all bodies, joints and monitoring methods from this world.*/ def clear() = {joints.clear(); bodies.clear(); monitors.clear()} - /**Aktuelle Zeit in Sekunden dieser Welt. Nach jedem Zeitschritt wird die Zeit erhoeht.*/ + /**Current time in this world.*/ var time: Double = 0.0 - /**Simuliert einen von timeStep angegebenen Zeitschritt. - * Ihre Aufgabe ist es die Koerper dieser Welt so zu simulieren wie diese sich in einer Welt mit den gegebenen - * Bedingungen verhalten wuerden. + /**Simulates a time step of the duration timeStep. *

    - * Der Zeitschritt wird in folgenden Phasen ausgefuehrt: + * The time step is simulated in the following phases: *

      - *
    1. Kraefte wirken auf die Koerper (z.B Schwerkraft, andere Kraftfaehige Objekte).
    2. - *
    3. Beschleunigungen werden integriert.
    4. - *
    5. Geschwindigkeiten werden korrigiert.
    6. - *
    7. Geschwindigkeiten werden integriert.
    8. - *
    9. Positionen werden korrigiert.
    10. - *
    11. Die Methode postStep() wird ausgefuehrt.
    12. + *
    13. Forces are applied to bodies.
    14. + *
    15. Accelerations are integrated.
    16. + *
    17. Velocities are corrected.
    18. + *
    19. Velocities are integrated.
    20. + *
    21. Postions are corrected.
    22. + *
    23. The method postStep() is executed.
    24. *
    */ def step() = { time += timeStep - //Kraftobjekte + //force applying objects for (j <- joints) j match {case f: ForceJoint => f.applyForce; case _ => ()} - //integriert v + //integration of acclerations, yields velocities for (b <- bodies) { val m = b.mass b.applyForce(gravity * b.mass) @@ -118,13 +121,13 @@ class World { b.angularVelocity = b.angularVelocity + alpha * timeStep } - //korrigiert v + //correction of velocities for (i <- 0 until iterations){ for(c <- joints) c.correctVelocity(timeStep) if (enableCollisionDetection) for (c <- detector.collisions) c.correctVelocity(timeStep) } - //integriert pos + //integration of velocities, yields positions for (b <- bodies) { //warning when body gets faster than speed of light if (b.linearVelocity.length >= 300000000) overCWarning = true @@ -136,7 +139,7 @@ class World { b.torque = 0.0 } - //korrigiert pos + //correction of positions if (enablePositionCorrection) for (i <- 0 until iterations){ for (c <- joints) c.correctPosition(timeStep) if (enableCollisionDetection) for (c <- detector.collisions) c.correctPosition(timeStep) @@ -145,10 +148,11 @@ class World { postStep() } - /**Wird nach jedem Zeitschritt ausgefuehrt.*/ + /**Initially empty method that is executed after each time step. This method + * may be overriden to create custom behaviour in a world.*/ def postStep() = {} - /**Ergibt Informationen ueber diese Welt.*/ + /**Returns information about this world.*/ def info = { "Bodies = " + bodies.length + "\n" + "Shapes = " + shapes.length + "\n" + diff --git a/src/sims/dynamics/joints/DistanceJoint.scala b/src/sims/dynamics/joints/DistanceJoint.scala index 2d5633f..efb49e5 100644 --- a/src/sims/dynamics/joints/DistanceJoint.scala +++ b/src/sims/dynamics/joints/DistanceJoint.scala @@ -8,15 +8,15 @@ package sims.dynamics.joints import sims.geometry._ -/** DistanceJoints halten die Bindungspunkte auf ihren Bindungskoerpern bei einem konstanten Abstand. - * @param node1 erster Koerper der Verbindung - * @param anchor1 Bindungspunkt auf Koerper eins - * @param node2 zweiter Koerper der Verbindung - * @param anchor2 Bindungspunkt auf Koerper zwei*/ +/** DistanceJoints keep their connection points at a constant distance. + * @param node1 first associated body + * @param anchor1 first connection point + * @param node2 second associated body + * @param anchor2 second connection point*/ case class DistanceJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: Vector2D) extends Joint{ def this(node1: Body, node2: Body) = this(node1, node1.pos, node2, node2.pos) - /**Abstand der beiden Bindungspunkte bei initialisierung (der gewollte Abstand).*/ + /**Distance between the two connection points at initialisation (the desired distance).*/ val distance = (anchor2 - anchor1).length private val a1 = anchor1 - node1.pos @@ -24,16 +24,16 @@ case class DistanceJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: V private val initRotation1 = node1.rotation private val initRotation2 = node2.rotation - /**Ergibt den Bindungspunkt auf Koerper eins.*/ + /**Returns the connection point on body one (in world coordinates).*/ def connection1 = (a1 rotate (node1.rotation - initRotation1)) + node1.pos - /**Ergibt den Bindungspunkt auf Koerper zwei.*/ + /**Returns the connection point on body two (in world coordinates).*/ def connection2 = (a2 rotate (node2.rotation - initRotation2)) + node2.pos - /**Relative Position der Bindungspunkte.*/ + /**Relative position of the connection points.*/ def x = connection2 - connection1 - /**Relative Geschwindigkeit der Bindungspunkte.*/ + /**Relative velocity of the connection points.*/ def v = node2.velocityOfPoint(connection2) - node1.velocityOfPoint(connection1) /* x = connection2 - connection1 @@ -45,15 +45,15 @@ case class DistanceJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: V * 1/m = J * M^-1 * JT * = 1/m1 * u * u + 1/m2 * u * u + 1/I1 * (r1 cross u)^2 + 1/I2 * (r2 cross u)^2*/ override def correctVelocity(h: Double) = { - val x = this.x //relativer Abstand - val v = this.v //relative Geschwindigkeit - val r1 = (connection1 - node1.pos) //Abstand Punkt-Schwerpunkt, Koerper 1 - val r2 = (connection2 - node2.pos) //Abstand Punkt-Schwerpunkt, Koerper 2 - val cr1 = r1 cross x.unit //Kreuzprodukt - val cr2 = r2 cross x.unit //Kreuzprodukt - val Cdot = x.unit dot v //Velocity-Constraint + val x = this.x //relative position + val v = this.v //relative velocity + val r1 = (connection1 - node1.pos) + val r2 = (connection2 - node2.pos) + val cr1 = r1 cross x.unit + val cr2 = r2 cross x.unit + val Cdot = x.unit dot v //velocity constraint val invMass = 1/node1.mass + 1/node1.I * cr1 * cr1 + 1/node2.mass + 1/node2.I * cr2 * cr2 //=J M^-1 JT - val m = if (invMass == 0.0) 0.0 else 1/invMass //Test um Nulldivision zu vermeiden + val m = if (invMass == 0.0) 0.0 else 1/invMass //avoid division by zero val lambda = -m * Cdot //=-JV/JM^-1JT val impulse = x.unit * lambda //P=J lambda node1.applyImpulse(-impulse, connection1) diff --git a/src/sims/dynamics/joints/ForceJoint.scala b/src/sims/dynamics/joints/ForceJoint.scala index fa17eac..1eed850 100644 --- a/src/sims/dynamics/joints/ForceJoint.scala +++ b/src/sims/dynamics/joints/ForceJoint.scala @@ -6,9 +6,9 @@ package sims.dynamics.joints -/**Eine Verbindung die Kraft auf ihre Bindungskoerper ausueben kann.*/ +/**A joint which can apply a force to its anchor bodies, thus adding or removing energy to the system.*/ trait ForceJoint { - /**Uebt eine Kraft auf die Bindungskoerper aus.*/ + /**Applies a force on the achor bodies.*/ def applyForce(): Unit } diff --git a/src/sims/dynamics/joints/Joint.scala b/src/sims/dynamics/joints/Joint.scala index 9690af2..652df97 100644 --- a/src/sims/dynamics/joints/Joint.scala +++ b/src/sims/dynamics/joints/Joint.scala @@ -9,19 +9,19 @@ package sims.dynamics.joints import sims.geometry._ import sims.dynamics._ -/**Joints sind Verbindungen die die Bewegung zwischen zwei Koerpern einschraenken. - * Ihre Implementierung wurde von Erin Catto's box2d inspiriert.*/ +/**Joints constrain the movement of two bodies. + * Their implementation was inspired by Erin Catto's box2d.*/ abstract class Joint extends Constraint{ - /**Erster Koerper der Verbindung.*/ + /**First body of the joint.*/ val node1: Body - /**Zweiter Koerper der Verbindung.*/ + /**Second body of the joint.*/ val node2: Body - /**Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.*/ + /**Corrects the velocities of this joint's associated bodies.*/ def correctVelocity(h: Double): Unit - /**Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.*/ + /**Corrects the positions of this joint's associated bodies.*/ def correctPosition(h: Double): Unit } \ No newline at end of file diff --git a/src/sims/dynamics/joints/RevoluteJoint.scala b/src/sims/dynamics/joints/RevoluteJoint.scala index 7a7ae1c..66a4c06 100644 --- a/src/sims/dynamics/joints/RevoluteJoint.scala +++ b/src/sims/dynamics/joints/RevoluteJoint.scala @@ -11,7 +11,9 @@ import sims.math._ import sims.dynamics._ import Math._ -/**Ein Gelenk, dass zwei Koerper an einem Punkt verbindet. Inspiriert von JBox2D.*/ +/**A revolute joint that connects two bodies at a singe point. Inspired from JBox2D. + * Warning: there are still several bugs with revolute joints, if they are between two free + * bodies and not connected at their respective COMs.*/ case class RevoluteJoint(node1: Body, node2: Body, anchor: Vector2D) extends Joint{ private val a1 = anchor - node1.pos private val a2 = anchor - node2.pos diff --git a/src/sims/dynamics/joints/SpringJoint.scala b/src/sims/dynamics/joints/SpringJoint.scala index 67ea57f..1267ccf 100644 --- a/src/sims/dynamics/joints/SpringJoint.scala +++ b/src/sims/dynamics/joints/SpringJoint.scala @@ -8,13 +8,13 @@ package sims.dynamics.joints import sims.geometry._ -/**Eine Hooksche Feder. - * @param node1 erster Koerper der Verbindung - * @param anchor1 Bindungspunkt auf Koerper eins - * @param node2 zweiter Koerper der Verbindung - * @param anchor2 Bindungspunkt auf Koerper zwei - * @param springConstant Federkonstante - * @param initialLength Initiallaenge +/**A spring obeying Hooke's law. + * @param node1 first associated body + * @param anchor1 first connection point + * @param node2 second associated body + * @param anchor2 second connection point + * @param springConstant spring constant + * @param initialLength initial length */ case class SpringJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: Vector2D, springConstant: Double, initialLength: Double) extends Joint with ForceJoint{ @@ -34,25 +34,25 @@ case class SpringJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: Vec private val initRotation1 = node1.rotation private val initRotation2 = node2.rotation - /**Ergibt den Bindungspunkt auf Koerper eins.*/ + /**Returns the connection point on body one (in world coordinates).*/ def connection1 = (a1 rotate (node1.rotation - initRotation1)) + node1.pos - /**Ergibt den Bindungspunkt auf Koerper zwei.*/ + /**Returns the connection point on body two (in world coordinates).*/ def connection2 = (a2 rotate (node2.rotation - initRotation2)) + node2.pos - /**Daempfung.*/ + /**Damping.*/ var damping = 0.0 - /**Relative Position der Bindungspunkte.*/ + /**Relative position of the connection points.*/ def x = connection2 - connection1 - /**Relative Geschwindigkeit der Bindungspunkte.*/ + /**Relative velocity of the connection points.*/ def v = node2.velocityOfPoint(connection2) - node1.velocityOfPoint(connection1) - /**Ergibt die Federkraft nach dem Hookschen Gesetz.*/ + /**Returns the spring force.*/ def force = (x.length - initialLength) * springConstant - /**Uebt die Federkraft auf die Bindungspunkte aus.*/ + /**Applies the spring force to the connection points.*/ def applyForce() = { node1.applyForce(x.unit * force - (v * damping) project x, connection1) node2.applyForce(-x.unit * force - (v * damping) project x, connection2) @@ -61,15 +61,15 @@ case class SpringJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: Vec def correctVelocity(h: Double) = { /* - val x = this.x //relativer Abstand - val v = this.v //relative Geschwindigkeit - val r1 = (connection1 - node1.pos) //Abstand Punkt-Schwerpunkt, Koerper 1 - val r2 = (connection2 - node2.pos) //Abstand Punkt-Schwerpunkt, Koerper 2 - val cr1 = r1 cross x.unit //Kreuzprodukt - val cr2 = r2 cross x.unit //Kreuzprodukt - val Cdot = x.unit dot v //Velocity-Constraint + val x = this.x + val v = this.v + val r1 = (connection1 - node1.pos) + val r2 = (connection2 - node2.pos) + val cr1 = r1 cross x.unit + val cr2 = r2 cross x.unit + val Cdot = x.unit dot v val invMass = 1/node1.mass + 1/node1.I * cr1 * cr1 + 1/node2.mass + 1/node2.I * cr2 * cr2 //=J M^-1 JT - val m = if (invMass == 0.0) 0.0 else 1/invMass //Test um Nulldivision zu vermeiden + val m = if (invMass == 0.0) 0.0 else 1/invMass val lambda = Math.min(Math.max(-this.force * h, (-m * Cdot)), this.force * h) println (force * h, -m * Cdot) val impulse = x.unit * lambda diff --git a/src/sims/dynamics/joints/test/PrismaticJoint.scala b/src/sims/dynamics/joints/test/PrismaticJoint.scala index f163261..d4b43b2 100644 --- a/src/sims/dynamics/joints/test/PrismaticJoint.scala +++ b/src/sims/dynamics/joints/test/PrismaticJoint.scala @@ -15,10 +15,8 @@ case class PrismaticJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: def connection1 = (a1 rotate (node1.rotation - initRotation1)) + node1.pos def connection2 = (a2 rotate (node2.rotation - initRotation2)) + node2.pos - /**Relative Position der Bindungspunkte.*/ def x = connection2 - connection1 - /**Relative Geschwindigkeit der Bindungspunkte.*/ def v = node2.velocityOfPoint(connection2) - node1.velocityOfPoint(connection1) @@ -28,13 +26,13 @@ case class PrismaticJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: } def correctLinear(h: Double) = { - val x = this.x.unit //relativer Abstand + val x = this.x.unit val n0 = x.leftNormal - val v = this.v //relative Geschwindigkeit - val r1 = (connection1 - node1.pos) //Abstand Punkt-Schwerpunkt, Koerper 1 - val r2 = (connection2 - node2.pos) //Abstand Punkt-Schwerpunkt, Koerper 2 - val cr1 = r1 cross n0 //Kreuzprodukt - val cr2 = r2 cross n0 //Kreuzprodukt + val v = this.v + val r1 = (connection1 - node1.pos) + val r2 = (connection2 - node2.pos) + val cr1 = r1 cross n0 + val cr2 = r2 cross n0 val Cdot = n0 dot v val invMass = 1/node1.mass + 1/node1.I * cr1 * cr1 + 1/node2.mass + 1/node2.I * cr2 * cr2 val m = if (invMass == 0.0) 0.0 else 1/invMass @@ -57,13 +55,13 @@ case class PrismaticJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: def correctPosition(h: Double) = { /* - val x = this.x.unit //relativer Abstand + val x = this.x.unit val n0 = x.leftNormal - val v = this.v //relative Geschwindigkeit - val r1 = (connection1 - node1.pos) //Abstand Punkt-Schwerpunkt, Koerper 1 - val r2 = (connection2 - node2.pos) //Abstand Punkt-Schwerpunkt, Koerper 2 - val cr1 = r1 cross n0 //Kreuzprodukt - val cr2 = r2 cross n0 //Kreuzprodukt + val v = this.v + val r1 = (connection1 - node1.pos) + val r2 = (connection2 - node2.pos) + val cr1 = r1 cross n0 + val cr2 = r2 cross n0 val C = n0 dot x val invMass = 1/node1.mass + 1/node1.I * cr1 * cr1 + 1/node2.mass + 1/node2.I * cr2 * cr2 val m = if (invMass == 0.0) 0.0 else 1/invMass diff --git a/src/sims/geometry/ConvexPolygon.scala b/src/sims/geometry/ConvexPolygon.scala index 7bf881c..cb4a429 100644 --- a/src/sims/geometry/ConvexPolygon.scala +++ b/src/sims/geometry/ConvexPolygon.scala @@ -9,21 +9,20 @@ package sims.geometry import sims.collision._ import sims.geometry._ -/**Gemeinsame Eigenschaften aller konvexen Polygone.*/ +/**Common properties of all convex polygons.*/ trait ConvexPolygon { - /**Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend. - * @return Ortsvektoren der Ecken*/ + /**Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise. + * @return position vectors of the vertices*/ def vertices: Seq[Vector2D] - /**Ergibt alle Seiten dieses Polygons. - * @return Seiten dieses Polygons*/ + /**Returns all sides of this polygon. The sides are ordered counter-clockwise, the first vertex of the side + * giving the side index.*/ def sides = (for (i <- 0 until vertices.length) yield (new Segment(vertices(i), vertices((i + 1) % vertices.length)))).toArray - /**Ergibt die Projektion dieses Polygons auf eine Gerade gegeben durch den - * Richtungsvektor axis - * @param axis Richtungsvektor der Geraden - * @return Projektion dieses Polygons*/ + /**Returns the projection of this polygon onto the line given by the directional vector axis. + * @param axis directional vector of the line + * @return projection of this polygon*/ def project(axis: Vector2D) = { val points = for (v <- vertices) yield {v project axis} val bounds = for (p <- points) yield {if (axis.x != 0) p.x / axis.x else p.y / axis.y} @@ -32,8 +31,7 @@ trait ConvexPolygon { (bounds(0) /: bounds)(Math.max(_,_))) } - /**Errechnet das AABB dieses Polygons - * @return umfassendes AABB + /**Returns this polygon's axis aligned bounding box. * @see collision.AABB*/ def AABB = { val xs = vertices map (_.x) @@ -42,15 +40,12 @@ trait ConvexPolygon { Vector2D(Iterable.max(xs), Iterable.max(ys))) } - /**Ueberprueft ob sich der gegebene Punkt point in diesem Polygon befindet. + /**Checks if the point point is contained in this polygon. *

    - * Hierzu wird eine Halbgerade von dem Punkt in Richtung der X-Achse gezogen (koennte aber auch beliebig sein). - * Dann wird die Anzahl der Ueberschneidungen der Halbgeraden mit den Seiten und Ecken des Polygons ermittelt. - * Ist die Anzahl der Ueberschneidungen ungerade, so befindet sich der Punkt in dem Polygon. - * Es gibt jedoch Ausnahmen, und zwar wenn die Halbgerade eine Ecke ueberschneidet, ueberschneidet sie sowohl auch zwei Seiten. - * Daher wird eine generelle Anzahl von Uerberschneidungen errechnet, gegeben durch die Anzahl der Ueberschneidungen mit den Seiten minus - * die mit den Ecken. - * Diese Zahl wird dann wie oben geschildert geprueft.*/ + * A ray is created, originating from the point and following an arbitrary direction (X-Axis was chosen). + * The number of intersections between the ray and this polygon's sides (including vertices) is counted. + * The amount of intersections with vertices is substracted form the previuos number. + * If the latter number is odd, the point is contained in the polygon.*/ def contains(point: Vector2D) = { val r = new Ray(point, Vector2D.i) var intersections = 0 diff --git a/src/sims/geometry/Projection.scala b/src/sims/geometry/Projection.scala index 5f2d0f0..0c340f0 100644 --- a/src/sims/geometry/Projection.scala +++ b/src/sims/geometry/Projection.scala @@ -8,25 +8,26 @@ package sims.geometry import sims.math._ -/**Projektion auf eine Achse. +/**Projection on an axis. *

    - * Ueblicherweise werden Projektionen in SiMS fuer Kollisionserkennung benutzt. - * @param axis Achse der Projektion - * @param lower unterer Wert der Projektion - * @param upper oberer Wert der Projektion*/ + * Projections are commonly used in SiMS for collision detection. + * @param axis directional vector of the axis of the projection + * @param lower lower value of the projection + * @param upper upper value of the projection*/ case class Projection(axis: Vector2D, lower: Double, upper: Double) { - require(axis != Vector2D.Null) + require(axis != Vector2D.Null, "A projection's axis cannot be given by a null vector!") - /**Ueberprueft ob sich diese Projektion mit der Projektion other ueberschneidet.*/ + /**Checks this projection for overlap with another projection other. + * @throws IllegalArgumentExcepion if both projections axes aren't the same*/ def overlaps(other: Projection): Boolean = { require(axis == other.axis, "Cannot compare two projections on different axes!") !((other.lower - this.upper) > 0 || (this.lower - other.upper) > 0) } - - /**Ergibt die Ueberlappung dieser Projektion und der Projektion other.*/ + /**Returns the overlap between this projection and another projection other. + * @throws IllegalArgumentExcepion if both projections axes aren't the same*/ def overlap(other: Projection): Double = { require(axis == other.axis, "Cannot compare two projections on different axes!") (Math.max(lower, other.lower) - Math.min(upper, other.upper)).abs diff --git a/src/sims/geometry/Ray.scala b/src/sims/geometry/Ray.scala index c898e03..feb18a9 100644 --- a/src/sims/geometry/Ray.scala +++ b/src/sims/geometry/Ray.scala @@ -9,16 +9,16 @@ package sims.geometry import sims.math._ import Math._ -/**Eine Halbgerade wird definiert durch: - * @param point ein Aufpunkt - * @param direction ein Richtungsvektor*/ +/**A ray. + * @param point a point on the ray + * @param direction this ray's directional vector + * @throws IllegalArgumentException if the directional vector is the null vector*/ case class Ray(point: Vector2D, direction: Vector2D) { - //Ein Nullvektor hat keine Richtung - require(direction != Vector2D.Null) + require(direction != Vector2D.Null, "A ray's direction cannot be given by a null vector!") - /**Ueberprueft ob diese Halbgerade das gegebene Segment ueberschneidet. - * @param das auf Ueberschneidung zu uerberpruefende Segment*/ + /**Checks this ray and the given segment for intersection. + * @param s the segment to test for intersection*/ def intersects(s: Segment) = { val p1 = point val p2 = point + direction @@ -38,11 +38,7 @@ case class Ray(point: Vector2D, direction: Vector2D) { } } - /**Ueberprueft ob diese Halbgerade den gegebenen Punkt enthaelt. - *
    - * Hierzu wird der Vektor von dem Ursprungspunkt zu dem zu ueberpruefenden Punkt gebildet. Dieser wird dann mit dem Richtungsvektor - * auf Kolinearitaet geprueft. - * @param p Ortsvektor des oben genannten Punkt*/ + /**Checks if this ray contains the point p.*/ def contains(p: Vector2D) = { val v = p - point p == point || diff --git a/src/sims/geometry/Segment.scala b/src/sims/geometry/Segment.scala index 8700979..4aaec21 100644 --- a/src/sims/geometry/Segment.scala +++ b/src/sims/geometry/Segment.scala @@ -6,37 +6,39 @@ package sims.geometry -/**Ein Segment wird durch seine beiden Extrempunkte gegeben. - * @param vertex1 Ortsvektor des 1. Extrempunkts - * @param vertex2 Ortsvektor des 2. Extrempunkts*/ +/**A segment is given by its vertices. + * @param vertex1 position vector of the first vertex + * @param vertex2 position vector of the second vertex + * @throws IllegalArgumentException if both vertices are equal + */ case class Segment(vertex1: Vector2D, vertex2: Vector2D){ require(vertex1 != vertex2, "A segment must have 2 distinct vertices!") - /**Laenge dieses Segments.*/ + /**Length of this segment.*/ val length = (vertex2 - vertex1).length - /**Vektor von EP1 zu EP2.*/ + /**Vector from vertex1 to vertex2.*/ val d = vertex2 - vertex1 - /**Einheitsrichtungsvektor.*/ + /**Unit directional vector.*/ val d0 = d.unit - /**Normalenvektor. Richtung: 90 Grad rechts zu d.*/ + /**Right normal vector.*/ val n = d.rightNormal - /**Normaleneinheitsvektor. Richtung: 90 Grad rechts zu d.*/ + /**Right normal unit vector.*/ val n0 = n.unit - /**Kleinster Abstand zwischen diesem Segment und dem Punkt p.*/ + /**Smallest distance between this segment and the point point.*/ def distance(point: Vector2D): Double = { - val v = point - vertex1 //Vektor von EP1 zu point + val v = point - vertex1 //vector from vertex1 to point val projection = v project d val alpha = if (d.x != 0) d.x / projection.x else d.y / projection.y - if (alpha >= 0 && projection.length <= length) //Punkt ist naeher zu der Geraden zwischen EP1 und EP2 + if (alpha >= 0 && projection.length <= length) //point is closer to line between vertex1 and vertex2 (v project n0).length - else if (alpha < 0) //Punkt ist naeher zu EP1 + else if (alpha < 0) //point is closer to vertex1 (point - vertex1).length - else if (alpha > 0) //Punkt ist naeher zu EP2 + else if (alpha > 0) //point is closer to vertex2 (point - vertex2).length else throw new IllegalArgumentException("Error occured trying to compute distance between segment and point.") diff --git a/src/sims/geometry/Vector2D.scala b/src/sims/geometry/Vector2D.scala index 03d1ea4..4468a90 100644 --- a/src/sims/geometry/Vector2D.scala +++ b/src/sims/geometry/Vector2D.scala @@ -8,54 +8,40 @@ package sims.geometry import scala.Math._ -/**Ein 2-dimensionaler Vektor. - * @param x 1. Komponente - * @param y 2. Komponente*/ +/**A 2D vector. + * @param x 1st component + * @param y 2nd component*/ case class Vector2D(x: Double, y: Double) { - /**Vektoraddition. - * @param v zu addierender Vektor - * @return dieser Vektor addiert mit v*/ + /**Vector addition.*/ def +(v: Vector2D): Vector2D = Vector2D(x + v.x, y + v.y) - /**Vektorsubstraktion. - * @param v zu substrahierender Vektor - * @return dieser Vektor substrahiert mit v*/ + /**Vector substraction.*/ def -(v: Vector2D): Vector2D = this + (v * -1) - /**Multiplikation mit einem Skalar. - * @param n Faktor - * @return dieser Vektor multipliziert mit n*/ + /**Scalar multiplication.*/ def *(n: Double): Vector2D = Vector2D(x * n, y * n) - /**Division durch ein Skalar. - * @param n Nenner - * @return dieser Vektor dividiert durch n*/ + /**Scalar division.*/ def /(n: Double): Vector2D = this * (1/n) - /**Minusvorzeichen.*/ + /**Unary minus.*/ def unary_- : Vector2D = Vector2D(-x, -y) - /**Skalarprodukt. - * @param v ein anderer Vektor - * @return Skalarprodukt von diesem Vektor mit v*/ + /**Dot product.*/ def dot(v: Vector2D): Double = x * v.x + y * v.y - /**Kreuzprodukt. (Norm des Kreuzproduktes) - * @param v ein anderer Vektor - * @return Norm des Kreuzproduktes dieses Vektors mit v. Die Richtung wuerde der x3-Achse entsprechen.*/ + /**Cross product. Length only because in 2D. The direction would be given by the x3-axis.*/ def cross(v: Vector2D): Double = x * v.y - y * v.x - /**Norm dieses Vektors.*/ + /**Norm or length of this vector.*/ val length: Double = Math.sqrt(x * x + y * y) - /**Einheitsvektor dieses Vektors.*/ + /**Unit vector.*/ def unit: Vector2D = if (!(x == 0.0 && y == 0.0)) Vector2D(x / length, y / length) else throw new IllegalArgumentException("Null vector does not have a unit vector.") - /**Errechnet die Projektion dieses- auf einen anderen Vektor. - * @param v oben gennanter Vektor - * @return Projektion dieses Vektors auf v*/ + /**Returns the projection of this vector onto the vector v.*/ def project(v: Vector2D): Vector2D = { if (v != Vector2D.Null) v * ((this dot v) / (v dot v)) @@ -63,37 +49,35 @@ case class Vector2D(x: Double, y: Double) { Vector2D.Null } - /**Errechnet eine Rotation dieses Vektors. - * @param angle Winkel in Radian - * @return der um angle rad rotierte Vektor*/ + /**Returns a rotation of this vector by angle radian.*/ def rotate(angle: Double): Vector2D = { Vector2D(cos(angle) * x - sin(angle) * y, cos(angle) * y + sin(angle) * x) } - /**Linker Normalenvektor. (-y, x)*/ + /**Left normal vector. (-y, x)*/ def leftNormal: Vector2D = Vector2D(-y, x) - /**Rechter Normalenvektor. (y, -x)*/ + /**Right normal vector. (y, -x)*/ def rightNormal: Vector2D = Vector2D(y, -x) - /**Ueberprueft, ob die Komponenten dieses Vektors gleich Null sind.*/ + /**Checks if this vector is the null vector.*/ def isNull: Boolean = this == Vector2D.Null - /**Ergibt eine Liste der Komponenten dieses Vektors.*/ + /**Returns a list of this vector's components.*/ def components = List(x, y) } -/**Dieses Objekt enthaelt spezielle Vektoren.*/ +/**Contains special vectors.*/ object Vector2D { - /**Nullvektor.*/ + /**Null vector.*/ val Null = Vector2D(0,0) - /**Ein horizontaler Einheitsvektor mit den Komponenten (1;0).*/ + /**Horizontal unit vector. (1,0)*/ val i = Vector2D(1,0) - /**Ein vertikaler Einheitsvektor mit den Komponenten (0;1).*/ + /**Vertical unit vector. (0,1)*/ val j = Vector2D(0,1) } diff --git a/src/sims/materials/Steel.scala b/src/sims/materials/Steel.scala index 71594b8..1d14563 100644 --- a/src/sims/materials/Steel.scala +++ b/src/sims/materials/Steel.scala @@ -2,4 +2,4 @@ package sims.materials object Steel { -} +} \ No newline at end of file diff --git a/src/sims/math/Matrix22.scala b/src/sims/math/Matrix22.scala index b10e02a..54d24c7 100644 --- a/src/sims/math/Matrix22.scala +++ b/src/sims/math/Matrix22.scala @@ -8,22 +8,20 @@ package sims.math import sims.geometry._ -/**Eine 2x2, quadratische Matrix. - * @param c11 Komponente 1,1 - * @param c12 Komponente 1,2 - * @param c21 Komponente 2,1 - * @param c22 Komponente 2,2 +/**A 2x2 matrix. + * @param c11 component 1,1 + * @param c12 component 1,2 + * @param c21 component 2,1 + * @param c22 component 2,2 */ case class Matrix22(c11: Double, c12: Double, c21: Double, c22: Double) { - /**Eine 2x2-dimensionale, quadratische Matrix kann auch mit zwei 2-dimensionalen - * Vektoren erstellt werden. In diesem Fall repraesentiert jeder Vektor eine Spalte. - * @param c1 erste Spalte - * @param c2 zweite Spalte*/ + /**A 2x2 matrix can be created with two 2D vectors. In this case, each column is represented by a vector. + * @param c1 first column + * @param c2 second column*/ def this(c1: Vector2D, c2: Vector2D) = this(c1.x, c2.x, c1.y, c2.y) - /**Ergibt die Determinante dieser Matrix. - * @return Determinante dieser Matrix*/ + /**Determinant of this matrix.*/ def det = c11 * c22 - c21 * c12 /**Addition.*/ @@ -31,17 +29,17 @@ case class Matrix22(c11: Double, c12: Double, c21: Double, c22: Double) { new Matrix22(c11 + m.c11, c12 + m.c12, c21 + m.c21, c22 + m.c22) - /**Multiplikation mit einem Skalar.*/ + /**Scalar multiplication.*/ def *(n: Double) = new Matrix22(c11 * n, c12 * n, c21 * n, c22 * n) - /**Multiplikation mit einer anderen 2x2-Matrix.*/ + /**Matrix multiplication.*/ def *(m: Matrix22) = new Matrix22(c11 * m.c11 + c12 * m.c21, c11 * m.c12 + c12 * m.c22, c21 * m.c11 + c22 * m.c21, c21 * m.c12 + c22 * m.c22) - /**Multiplikation mit einer 2x1-Matrix (2-dimensionaler Vektor).*/ + /**Multiplikation with a 2D vector.*/ def *(v: Vector2D) = new Vector2D(c11 * v.x + c12 * v.y, c21 * v.x + c22 * v.y) diff --git a/src/sims/util/Polar.scala b/src/sims/util/Polar.scala index 931be08..c4009b5 100644 --- a/src/sims/util/Polar.scala +++ b/src/sims/util/Polar.scala @@ -9,9 +9,9 @@ package sims.util import sims.geometry._ import scala.Math._ -/**Polare Koordinaten.*/ +/**Polar coordinates.*/ case class Polar(distance: Double, angle: Double) { - /**Ergibt die Vektorrepraesantation dieser polaren Koordinaten.*/ + /**Returns the vector representation of these polar coordinates.*/ def toCarthesian = Vector2D(distance * sin(angle), distance * cos(angle)) } diff --git a/src/sims/util/Positioning.scala b/src/sims/util/Positioning.scala index 433feaf..cf72276 100644 --- a/src/sims/util/Positioning.scala +++ b/src/sims/util/Positioning.scala @@ -9,7 +9,7 @@ package sims.util import sims.geometry._ import sims.dynamics._ -/**Objekt mit Hiflsfunktionen fuer komfortables Positionieren von Koerpern.*/ +/**Utility functions for comfortable positioning of bodies.*/ object Positioning { implicit def int2RelativeVector(x: Int): RelativeVector = new RelativeVector(x, 0) -- cgit v1.2.3