From 9d20024aa35cd7f923ebfc1ed9a2ffbf2731da70 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 5 Nov 2009 21:02:40 +0000 Subject: Initial import. --- .classpath | 7 + .project | 18 + .settings/org.eclipse.jdt.core.prefs | 4 + README.txt | 10 + doc/all-classes.html | 131 ++++ doc/graphyx$content.html | 21 + doc/graphyx$package.html | 14 + doc/graphyx/Graphyx$object.html | 221 +++++++ doc/graphyx/actors$content.html | 100 +++ doc/graphyx/actors$package.html | 22 + doc/graphyx/actors/Exit$object.html | 205 ++++++ doc/graphyx/actors/FireEvent$object.html | 205 ++++++ doc/graphyx/actors/GUIActor.html | 162 +++++ doc/graphyx/actors/PhysicsActor.html | 202 ++++++ doc/graphyx/actors/SetWorld$object.html | 82 +++ doc/graphyx/actors/SetWorld.html | 276 ++++++++ doc/graphyx/actors/Start$object.html | 205 ++++++ doc/graphyx/actors/Stop$object.html | 205 ++++++ doc/graphyx/graphics$content.html | 332 ++++++++++ doc/graphyx/graphics$package.html | 43 ++ doc/graphyx/graphics/Drawable.html | 397 ++++++++++++ doc/graphyx/graphics/GraphicalAABB$object.html | 82 +++ doc/graphyx/graphics/GraphicalAABB.html | 355 +++++++++++ doc/graphyx/graphics/GraphicalBody$object.html | 82 +++ doc/graphyx/graphics/GraphicalBody.html | 383 ++++++++++++ doc/graphyx/graphics/GraphicalCircle$object.html | 82 +++ doc/graphyx/graphics/GraphicalCircle.html | 369 +++++++++++ .../graphics/GraphicalCollision$object.html | 82 +++ doc/graphyx/graphics/GraphicalCollision.html | 363 +++++++++++ .../graphics/GraphicalDistanceJoint$object.html | 82 +++ doc/graphyx/graphics/GraphicalDistanceJoint.html | 356 +++++++++++ doc/graphyx/graphics/GraphicalJoint.html | 132 ++++ doc/graphyx/graphics/GraphicalObject.html | 154 +++++ doc/graphyx/graphics/GraphicalPair$object.html | 82 +++ doc/graphyx/graphics/GraphicalPair.html | 363 +++++++++++ .../graphics/GraphicalRectangle$object.html | 82 +++ doc/graphyx/graphics/GraphicalRectangle.html | 376 +++++++++++ .../graphics/GraphicalRegularPolygon$object.html | 82 +++ doc/graphyx/graphics/GraphicalRegularPolygon.html | 376 +++++++++++ .../graphics/GraphicalRevoluteJoint$object.html | 82 +++ doc/graphyx/graphics/GraphicalRevoluteJoint.html | 336 ++++++++++ doc/graphyx/graphics/GraphicalShape.html | 176 ++++++ .../graphics/GraphicalSpringJoint$object.html | 82 +++ doc/graphyx/graphics/GraphicalSpringJoint.html | 356 +++++++++++ doc/graphyx/graphics/GraphicalWorld$object.html | 82 +++ doc/graphyx/graphics/GraphicalWorld.html | 439 +++++++++++++ doc/graphyx/graphics/Parser$object.html | 221 +++++++ doc/graphyx/graphics/Scene$object.html | 82 +++ doc/graphyx/graphics/Scene.html | 439 +++++++++++++ doc/graphyx/gui$content.html | 142 +++++ doc/graphyx/gui$package.html | 25 + doc/graphyx/gui/BodyPopup.html | 251 ++++++++ doc/graphyx/gui/Container.html | 181 ++++++ doc/graphyx/gui/ControlPanel.html | 295 +++++++++ doc/graphyx/gui/GrabbedBody.html | 141 +++++ doc/graphyx/gui/GravityPanel.html | 292 +++++++++ doc/graphyx/gui/InfoPanel.html | 198 ++++++ doc/graphyx/gui/MainFrame.html | 161 +++++ doc/graphyx/gui/MainPanel.html | 329 ++++++++++ doc/graphyx/gui/OptionsPanel.html | 625 +++++++++++++++++++ doc/graphyx/gui/PopupMenu.html | 207 ++++++ doc/graphyx/gui/ShapeInfoPanel.html | 262 ++++++++ doc/graphyx/gui/WorldPanel.html | 638 +++++++++++++++++++ doc/graphyx/tests$content.html | 188 ++++++ doc/graphyx/tests$package.html | 30 + doc/graphyx/tests/BallStack$object.html | 169 +++++ doc/graphyx/tests/Chain$object.html | 169 +++++ doc/graphyx/tests/CompositeShape$object.html | 169 +++++ doc/graphyx/tests/Cup$object.html | 169 +++++ doc/graphyx/tests/EmptyTest$object.html | 169 +++++ doc/graphyx/tests/Friction$object.html | 256 ++++++++ doc/graphyx/tests/Friction2$object.html | 169 +++++ doc/graphyx/tests/General1$object.html | 216 +++++++ doc/graphyx/tests/General2$object.html | 169 +++++ doc/graphyx/tests/Joints1$object.html | 169 +++++ doc/graphyx/tests/Joints2$object.html | 169 +++++ doc/graphyx/tests/Net$object.html | 169 +++++ doc/graphyx/tests/RagdollTest$object.html | 169 +++++ doc/graphyx/tests/Restitution$object.html | 169 +++++ doc/graphyx/tests/Stacking$object.html | 169 +++++ doc/graphyx/tests/Test.html | 190 ++++++ doc/index.html | 14 + doc/modules.html | 34 + doc/nav-classes.html | 27 + doc/root-content.html | 69 ++ doc/script.js | 112 ++++ doc/sims/collision$content.html | 191 ++++++ doc/sims/collision$package.html | 30 + doc/sims/collision/AABB$object.html | 82 +++ doc/sims/collision/AABB.html | 309 +++++++++ doc/sims/collision/CircleCollision$object.html | 82 +++ doc/sims/collision/CircleCollision.html | 409 ++++++++++++ doc/sims/collision/Collision$object.html | 101 +++ doc/sims/collision/Collision.html | 259 ++++++++ doc/sims/collision/Detector.html | 133 ++++ doc/sims/collision/GridDetector.html | 311 +++++++++ doc/sims/collision/Overlap$object.html | 82 +++ doc/sims/collision/Overlap.html | 276 ++++++++ doc/sims/collision/Pair$object.html | 82 +++ doc/sims/collision/Pair.html | 257 ++++++++ doc/sims/collision/PolyCircleCollision$object.html | 82 +++ doc/sims/collision/PolyCircleCollision.html | 409 ++++++++++++ doc/sims/collision/PolyCollision$object.html | 82 +++ doc/sims/collision/PolyCollision.html | 469 ++++++++++++++ doc/sims/dynamics$content.html | 146 +++++ doc/sims/dynamics$package.html | 26 + doc/sims/dynamics/Body$object.html | 75 +++ doc/sims/dynamics/Body.html | 659 ++++++++++++++++++++ doc/sims/dynamics/Circle$object.html | 82 +++ doc/sims/dynamics/Circle.html | 456 ++++++++++++++ doc/sims/dynamics/Constraint.html | 132 ++++ doc/sims/dynamics/Rectangle$object.html | 82 +++ doc/sims/dynamics/Rectangle.html | 431 +++++++++++++ doc/sims/dynamics/RegularPolygon$object.html | 82 +++ doc/sims/dynamics/RegularPolygon.html | 419 +++++++++++++ doc/sims/dynamics/Shape$object.html | 75 +++ doc/sims/dynamics/Shape.html | 559 +++++++++++++++++ doc/sims/dynamics/World.html | 692 +++++++++++++++++++++ doc/sims/dynamics/joints$content.html | 101 +++ doc/sims/dynamics/joints$package.html | 22 + doc/sims/dynamics/joints/DistanceJoint$object.html | 82 +++ doc/sims/dynamics/joints/DistanceJoint.html | 481 ++++++++++++++ doc/sims/dynamics/joints/ForceJoint.html | 107 ++++ doc/sims/dynamics/joints/Joint.html | 194 ++++++ doc/sims/dynamics/joints/RevoluteJoint$object.html | 82 +++ doc/sims/dynamics/joints/RevoluteJoint.html | 419 +++++++++++++ doc/sims/dynamics/joints/SpringJoint$object.html | 82 +++ doc/sims/dynamics/joints/SpringJoint.html | 551 ++++++++++++++++ doc/sims/geometry$content.html | 111 ++++ doc/sims/geometry$package.html | 23 + doc/sims/geometry/ConvexPolygon.html | 215 +++++++ doc/sims/geometry/Projection$object.html | 82 +++ doc/sims/geometry/Projection.html | 328 ++++++++++ doc/sims/geometry/Ray$object.html | 82 +++ doc/sims/geometry/Ray.html | 334 ++++++++++ doc/sims/geometry/Segment$object.html | 82 +++ doc/sims/geometry/Segment.html | 441 +++++++++++++ doc/sims/geometry/Vector2D$object.html | 150 +++++ doc/sims/geometry/Vector2D.html | 644 +++++++++++++++++++ doc/sims/math$content.html | 34 + doc/sims/math$package.html | 16 + doc/sims/math/Matrix22$object.html | 98 +++ doc/sims/math/Matrix22.html | 448 +++++++++++++ doc/sims/prefabs$content.html | 54 ++ doc/sims/prefabs$package.html | 17 + doc/sims/prefabs/Net.html | 232 +++++++ doc/sims/prefabs/Prefab.html | 121 ++++ doc/sims/prefabs/Pylon.html | 272 ++++++++ doc/sims/prefabs/Ragdoll.html | 432 +++++++++++++ doc/sims/util$content.html | 56 ++ doc/sims/util$package.html | 18 + doc/sims/util/Polar$object.html | 82 +++ doc/sims/util/Polar.html | 302 +++++++++ doc/sims/util/Positioning$object.html | 201 ++++++ doc/sims/util/RelativeVector.html | 278 +++++++++ doc/style.css | 148 +++++ src/graphyx/Graphyx.scala | 60 ++ src/graphyx/actors/GUIActor.scala | 32 + src/graphyx/actors/PhysicsActor.scala | 72 +++ src/graphyx/graphics/Drawable.scala | 118 ++++ src/graphyx/graphics/GraphicalAABB.scala | 18 + src/graphyx/graphics/GraphicalBody.scala | 42 ++ src/graphyx/graphics/GraphicalCircle.scala | 22 + src/graphyx/graphics/GraphicalCollision.scala | 18 + src/graphyx/graphics/GraphicalDistanceJoint.scala | 19 + src/graphyx/graphics/GraphicalJoint.scala | 12 + src/graphyx/graphics/GraphicalObject.scala | 15 + src/graphyx/graphics/GraphicalPair.scala | 18 + src/graphyx/graphics/GraphicalRectangle.scala | 18 + src/graphyx/graphics/GraphicalRegularPolygon.scala | 20 + src/graphyx/graphics/GraphicalRevoluteJoint.scala | 20 + src/graphyx/graphics/GraphicalShape.scala | 15 + src/graphyx/graphics/GraphicalSpringJoint.scala | 18 + src/graphyx/graphics/GraphicalWorld.scala | 19 + src/graphyx/graphics/Parser.scala | 34 + src/graphyx/graphics/Scene.scala | 24 + src/graphyx/gui/AboutHelpFrame.scala | 22 + src/graphyx/gui/BodyPopup.scala | 41 ++ src/graphyx/gui/Container.scala | 33 + src/graphyx/gui/ControlPanel.scala | 36 ++ src/graphyx/gui/GravityPanel.scala | 83 +++ src/graphyx/gui/InfoPanel.scala | 28 + src/graphyx/gui/MainFrame.scala | 23 + src/graphyx/gui/MainPanel.scala | 77 +++ src/graphyx/gui/MenuHelp.scala | 19 + src/graphyx/gui/MenuPanel.scala | 12 + src/graphyx/gui/OptionsPanel.scala | 122 ++++ src/graphyx/gui/PopupMenu.scala | 20 + src/graphyx/gui/ShapeInfoPanel.scala | 35 ++ src/graphyx/gui/WorldPanel.scala | 150 +++++ src/graphyx/tests/BallStack.scala | 25 + src/graphyx/tests/Chain.scala | 26 + src/graphyx/tests/CompositeShape.scala | 36 ++ src/graphyx/tests/Cup.scala | 31 + src/graphyx/tests/EmptyTest.scala | 15 + src/graphyx/tests/Friction.scala | 56 ++ src/graphyx/tests/Friction2.scala | 33 + src/graphyx/tests/General1.scala | 125 ++++ src/graphyx/tests/General2.scala | 28 + src/graphyx/tests/Joints1.scala | 24 + src/graphyx/tests/Joints2.scala | 29 + src/graphyx/tests/Net.scala | 22 + src/graphyx/tests/RagdollTest.scala | 26 + src/graphyx/tests/Restitution.scala | 21 + src/graphyx/tests/Stacking.scala | 24 + src/graphyx/tests/Test.scala | 16 + src/sims/collision/AABB.scala | 29 + src/sims/collision/CircleCollision.scala | 22 + src/sims/collision/Collision.scala | 109 ++++ src/sims/collision/Detector.scala | 23 + src/sims/collision/GridDetector.scala | 122 ++++ src/sims/collision/Overlap.scala | 11 + src/sims/collision/Pair.scala | 21 + src/sims/collision/PolyCircleCollision.scala | 38 ++ src/sims/collision/PolyCollision.scala | 50 ++ src/sims/dynamics/Body.scala | 143 +++++ src/sims/dynamics/Circle.scala | 37 ++ src/sims/dynamics/Constraint.scala | 19 + src/sims/dynamics/Rectangle.scala | 40 ++ src/sims/dynamics/RegularPolygon.scala | 35 ++ src/sims/dynamics/Shape.scala | 93 +++ src/sims/dynamics/World.scala | 163 +++++ src/sims/dynamics/joints/DistanceJoint.scala | 76 +++ src/sims/dynamics/joints/ForceJoint.scala | 14 + src/sims/dynamics/joints/Joint.scala | 27 + src/sims/dynamics/joints/RevoluteJoint.scala | 55 ++ src/sims/dynamics/joints/SpringJoint.scala | 60 ++ .../dynamics/joints/test/UnitCircleJoint.scala | 45 ++ src/sims/geometry/ConvexPolygon.scala | 61 ++ src/sims/geometry/Projection.scala | 34 + src/sims/geometry/Ray.scala | 53 ++ src/sims/geometry/Segment.scala | 70 +++ src/sims/geometry/Vector2D.scala | 99 +++ src/sims/math/Matrix22.scala | 57 ++ src/sims/prefabs/Net.scala | 47 ++ src/sims/prefabs/Prefab.scala | 15 + src/sims/prefabs/Pylon.scala | 47 ++ src/sims/prefabs/Ragdoll.scala | 43 ++ src/sims/util/Polar.scala | 17 + src/sims/util/Positioning.scala | 24 + src/sims/util/RelativeVector.scala | 24 + 241 files changed, 34779 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 README.txt create mode 100644 doc/all-classes.html create mode 100644 doc/graphyx$content.html create mode 100644 doc/graphyx$package.html create mode 100644 doc/graphyx/Graphyx$object.html create mode 100644 doc/graphyx/actors$content.html create mode 100644 doc/graphyx/actors$package.html create mode 100644 doc/graphyx/actors/Exit$object.html create mode 100644 doc/graphyx/actors/FireEvent$object.html create mode 100644 doc/graphyx/actors/GUIActor.html create mode 100644 doc/graphyx/actors/PhysicsActor.html create mode 100644 doc/graphyx/actors/SetWorld$object.html create mode 100644 doc/graphyx/actors/SetWorld.html create mode 100644 doc/graphyx/actors/Start$object.html create mode 100644 doc/graphyx/actors/Stop$object.html create mode 100644 doc/graphyx/graphics$content.html create mode 100644 doc/graphyx/graphics$package.html create mode 100644 doc/graphyx/graphics/Drawable.html create mode 100644 doc/graphyx/graphics/GraphicalAABB$object.html create mode 100644 doc/graphyx/graphics/GraphicalAABB.html create mode 100644 doc/graphyx/graphics/GraphicalBody$object.html create mode 100644 doc/graphyx/graphics/GraphicalBody.html create mode 100644 doc/graphyx/graphics/GraphicalCircle$object.html create mode 100644 doc/graphyx/graphics/GraphicalCircle.html create mode 100644 doc/graphyx/graphics/GraphicalCollision$object.html create mode 100644 doc/graphyx/graphics/GraphicalCollision.html create mode 100644 doc/graphyx/graphics/GraphicalDistanceJoint$object.html create mode 100644 doc/graphyx/graphics/GraphicalDistanceJoint.html create mode 100644 doc/graphyx/graphics/GraphicalJoint.html create mode 100644 doc/graphyx/graphics/GraphicalObject.html create mode 100644 doc/graphyx/graphics/GraphicalPair$object.html create mode 100644 doc/graphyx/graphics/GraphicalPair.html create mode 100644 doc/graphyx/graphics/GraphicalRectangle$object.html create mode 100644 doc/graphyx/graphics/GraphicalRectangle.html create mode 100644 doc/graphyx/graphics/GraphicalRegularPolygon$object.html create mode 100644 doc/graphyx/graphics/GraphicalRegularPolygon.html create mode 100644 doc/graphyx/graphics/GraphicalRevoluteJoint$object.html create mode 100644 doc/graphyx/graphics/GraphicalRevoluteJoint.html create mode 100644 doc/graphyx/graphics/GraphicalShape.html create mode 100644 doc/graphyx/graphics/GraphicalSpringJoint$object.html create mode 100644 doc/graphyx/graphics/GraphicalSpringJoint.html create mode 100644 doc/graphyx/graphics/GraphicalWorld$object.html create mode 100644 doc/graphyx/graphics/GraphicalWorld.html create mode 100644 doc/graphyx/graphics/Parser$object.html create mode 100644 doc/graphyx/graphics/Scene$object.html create mode 100644 doc/graphyx/graphics/Scene.html create mode 100644 doc/graphyx/gui$content.html create mode 100644 doc/graphyx/gui$package.html create mode 100644 doc/graphyx/gui/BodyPopup.html create mode 100644 doc/graphyx/gui/Container.html create mode 100644 doc/graphyx/gui/ControlPanel.html create mode 100644 doc/graphyx/gui/GrabbedBody.html create mode 100644 doc/graphyx/gui/GravityPanel.html create mode 100644 doc/graphyx/gui/InfoPanel.html create mode 100644 doc/graphyx/gui/MainFrame.html create mode 100644 doc/graphyx/gui/MainPanel.html create mode 100644 doc/graphyx/gui/OptionsPanel.html create mode 100644 doc/graphyx/gui/PopupMenu.html create mode 100644 doc/graphyx/gui/ShapeInfoPanel.html create mode 100644 doc/graphyx/gui/WorldPanel.html create mode 100644 doc/graphyx/tests$content.html create mode 100644 doc/graphyx/tests$package.html create mode 100644 doc/graphyx/tests/BallStack$object.html create mode 100644 doc/graphyx/tests/Chain$object.html create mode 100644 doc/graphyx/tests/CompositeShape$object.html create mode 100644 doc/graphyx/tests/Cup$object.html create mode 100644 doc/graphyx/tests/EmptyTest$object.html create mode 100644 doc/graphyx/tests/Friction$object.html create mode 100644 doc/graphyx/tests/Friction2$object.html create mode 100644 doc/graphyx/tests/General1$object.html create mode 100644 doc/graphyx/tests/General2$object.html create mode 100644 doc/graphyx/tests/Joints1$object.html create mode 100644 doc/graphyx/tests/Joints2$object.html create mode 100644 doc/graphyx/tests/Net$object.html create mode 100644 doc/graphyx/tests/RagdollTest$object.html create mode 100644 doc/graphyx/tests/Restitution$object.html create mode 100644 doc/graphyx/tests/Stacking$object.html create mode 100644 doc/graphyx/tests/Test.html create mode 100644 doc/index.html create mode 100644 doc/modules.html create mode 100644 doc/nav-classes.html create mode 100644 doc/root-content.html create mode 100644 doc/script.js create mode 100644 doc/sims/collision$content.html create mode 100644 doc/sims/collision$package.html create mode 100644 doc/sims/collision/AABB$object.html create mode 100644 doc/sims/collision/AABB.html create mode 100644 doc/sims/collision/CircleCollision$object.html create mode 100644 doc/sims/collision/CircleCollision.html create mode 100644 doc/sims/collision/Collision$object.html create mode 100644 doc/sims/collision/Collision.html create mode 100644 doc/sims/collision/Detector.html create mode 100644 doc/sims/collision/GridDetector.html create mode 100644 doc/sims/collision/Overlap$object.html create mode 100644 doc/sims/collision/Overlap.html create mode 100644 doc/sims/collision/Pair$object.html create mode 100644 doc/sims/collision/Pair.html create mode 100644 doc/sims/collision/PolyCircleCollision$object.html create mode 100644 doc/sims/collision/PolyCircleCollision.html create mode 100644 doc/sims/collision/PolyCollision$object.html create mode 100644 doc/sims/collision/PolyCollision.html create mode 100644 doc/sims/dynamics$content.html create mode 100644 doc/sims/dynamics$package.html create mode 100644 doc/sims/dynamics/Body$object.html create mode 100644 doc/sims/dynamics/Body.html create mode 100644 doc/sims/dynamics/Circle$object.html create mode 100644 doc/sims/dynamics/Circle.html create mode 100644 doc/sims/dynamics/Constraint.html create mode 100644 doc/sims/dynamics/Rectangle$object.html create mode 100644 doc/sims/dynamics/Rectangle.html create mode 100644 doc/sims/dynamics/RegularPolygon$object.html create mode 100644 doc/sims/dynamics/RegularPolygon.html create mode 100644 doc/sims/dynamics/Shape$object.html create mode 100644 doc/sims/dynamics/Shape.html create mode 100644 doc/sims/dynamics/World.html create mode 100644 doc/sims/dynamics/joints$content.html create mode 100644 doc/sims/dynamics/joints$package.html create mode 100644 doc/sims/dynamics/joints/DistanceJoint$object.html create mode 100644 doc/sims/dynamics/joints/DistanceJoint.html create mode 100644 doc/sims/dynamics/joints/ForceJoint.html create mode 100644 doc/sims/dynamics/joints/Joint.html create mode 100644 doc/sims/dynamics/joints/RevoluteJoint$object.html create mode 100644 doc/sims/dynamics/joints/RevoluteJoint.html create mode 100644 doc/sims/dynamics/joints/SpringJoint$object.html create mode 100644 doc/sims/dynamics/joints/SpringJoint.html create mode 100644 doc/sims/geometry$content.html create mode 100644 doc/sims/geometry$package.html create mode 100644 doc/sims/geometry/ConvexPolygon.html create mode 100644 doc/sims/geometry/Projection$object.html create mode 100644 doc/sims/geometry/Projection.html create mode 100644 doc/sims/geometry/Ray$object.html create mode 100644 doc/sims/geometry/Ray.html create mode 100644 doc/sims/geometry/Segment$object.html create mode 100644 doc/sims/geometry/Segment.html create mode 100644 doc/sims/geometry/Vector2D$object.html create mode 100644 doc/sims/geometry/Vector2D.html create mode 100644 doc/sims/math$content.html create mode 100644 doc/sims/math$package.html create mode 100644 doc/sims/math/Matrix22$object.html create mode 100644 doc/sims/math/Matrix22.html create mode 100644 doc/sims/prefabs$content.html create mode 100644 doc/sims/prefabs$package.html create mode 100644 doc/sims/prefabs/Net.html create mode 100644 doc/sims/prefabs/Prefab.html create mode 100644 doc/sims/prefabs/Pylon.html create mode 100644 doc/sims/prefabs/Ragdoll.html create mode 100644 doc/sims/util$content.html create mode 100644 doc/sims/util$package.html create mode 100644 doc/sims/util/Polar$object.html create mode 100644 doc/sims/util/Polar.html create mode 100644 doc/sims/util/Positioning$object.html create mode 100644 doc/sims/util/RelativeVector.html create mode 100644 doc/style.css create mode 100644 src/graphyx/Graphyx.scala create mode 100644 src/graphyx/actors/GUIActor.scala create mode 100644 src/graphyx/actors/PhysicsActor.scala create mode 100644 src/graphyx/graphics/Drawable.scala create mode 100644 src/graphyx/graphics/GraphicalAABB.scala create mode 100644 src/graphyx/graphics/GraphicalBody.scala create mode 100644 src/graphyx/graphics/GraphicalCircle.scala create mode 100644 src/graphyx/graphics/GraphicalCollision.scala create mode 100644 src/graphyx/graphics/GraphicalDistanceJoint.scala create mode 100644 src/graphyx/graphics/GraphicalJoint.scala create mode 100644 src/graphyx/graphics/GraphicalObject.scala create mode 100644 src/graphyx/graphics/GraphicalPair.scala create mode 100644 src/graphyx/graphics/GraphicalRectangle.scala create mode 100644 src/graphyx/graphics/GraphicalRegularPolygon.scala create mode 100644 src/graphyx/graphics/GraphicalRevoluteJoint.scala create mode 100644 src/graphyx/graphics/GraphicalShape.scala create mode 100644 src/graphyx/graphics/GraphicalSpringJoint.scala create mode 100644 src/graphyx/graphics/GraphicalWorld.scala create mode 100644 src/graphyx/graphics/Parser.scala create mode 100644 src/graphyx/graphics/Scene.scala create mode 100644 src/graphyx/gui/AboutHelpFrame.scala create mode 100644 src/graphyx/gui/BodyPopup.scala create mode 100644 src/graphyx/gui/Container.scala create mode 100644 src/graphyx/gui/ControlPanel.scala create mode 100644 src/graphyx/gui/GravityPanel.scala create mode 100644 src/graphyx/gui/InfoPanel.scala create mode 100644 src/graphyx/gui/MainFrame.scala create mode 100644 src/graphyx/gui/MainPanel.scala create mode 100644 src/graphyx/gui/MenuHelp.scala create mode 100644 src/graphyx/gui/MenuPanel.scala create mode 100644 src/graphyx/gui/OptionsPanel.scala create mode 100644 src/graphyx/gui/PopupMenu.scala create mode 100644 src/graphyx/gui/ShapeInfoPanel.scala create mode 100644 src/graphyx/gui/WorldPanel.scala create mode 100644 src/graphyx/tests/BallStack.scala create mode 100644 src/graphyx/tests/Chain.scala create mode 100644 src/graphyx/tests/CompositeShape.scala create mode 100644 src/graphyx/tests/Cup.scala create mode 100644 src/graphyx/tests/EmptyTest.scala create mode 100644 src/graphyx/tests/Friction.scala create mode 100644 src/graphyx/tests/Friction2.scala create mode 100644 src/graphyx/tests/General1.scala create mode 100644 src/graphyx/tests/General2.scala create mode 100644 src/graphyx/tests/Joints1.scala create mode 100644 src/graphyx/tests/Joints2.scala create mode 100644 src/graphyx/tests/Net.scala create mode 100644 src/graphyx/tests/RagdollTest.scala create mode 100644 src/graphyx/tests/Restitution.scala create mode 100644 src/graphyx/tests/Stacking.scala create mode 100644 src/graphyx/tests/Test.scala create mode 100644 src/sims/collision/AABB.scala create mode 100644 src/sims/collision/CircleCollision.scala create mode 100644 src/sims/collision/Collision.scala create mode 100644 src/sims/collision/Detector.scala create mode 100644 src/sims/collision/GridDetector.scala create mode 100644 src/sims/collision/Overlap.scala create mode 100644 src/sims/collision/Pair.scala create mode 100644 src/sims/collision/PolyCircleCollision.scala create mode 100644 src/sims/collision/PolyCollision.scala create mode 100644 src/sims/dynamics/Body.scala create mode 100644 src/sims/dynamics/Circle.scala create mode 100644 src/sims/dynamics/Constraint.scala create mode 100644 src/sims/dynamics/Rectangle.scala create mode 100644 src/sims/dynamics/RegularPolygon.scala create mode 100644 src/sims/dynamics/Shape.scala create mode 100644 src/sims/dynamics/World.scala create mode 100644 src/sims/dynamics/joints/DistanceJoint.scala create mode 100644 src/sims/dynamics/joints/ForceJoint.scala create mode 100644 src/sims/dynamics/joints/Joint.scala create mode 100644 src/sims/dynamics/joints/RevoluteJoint.scala create mode 100644 src/sims/dynamics/joints/SpringJoint.scala create mode 100644 src/sims/dynamics/joints/test/UnitCircleJoint.scala create mode 100644 src/sims/geometry/ConvexPolygon.scala create mode 100644 src/sims/geometry/Projection.scala create mode 100644 src/sims/geometry/Ray.scala create mode 100644 src/sims/geometry/Segment.scala create mode 100644 src/sims/geometry/Vector2D.scala create mode 100644 src/sims/math/Matrix22.scala create mode 100644 src/sims/prefabs/Net.scala create mode 100644 src/sims/prefabs/Prefab.scala create mode 100644 src/sims/prefabs/Pylon.scala create mode 100644 src/sims/prefabs/Ragdoll.scala create mode 100644 src/sims/util/Polar.scala create mode 100644 src/sims/util/Positioning.scala create mode 100644 src/sims/util/RelativeVector.scala diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..e009d2f --- /dev/null +++ b/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..c4942fc --- /dev/null +++ b/.project @@ -0,0 +1,18 @@ + + + SiMS + + + + + + ch.epfl.lamp.sdt.core.scalabuilder + + + + + + ch.epfl.lamp.sdt.core.scalanature + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..4d1b14e --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +#Sat Sep 06 16:08:07 CEST 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.scala diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..4384ab2 --- /dev/null +++ b/README.txt @@ -0,0 +1,10 @@ +Project contents: SiMS, Graphyx +Written in Scala. + +Simple Mechanics Simulator (SiMS) is a library for 2D rigid body simulation. +Graphyx is a program for testing and visualizing SiMS. + +Both projects are maintained at: https://sourceforge.net/projects/simplemechanics/ + +SiMS and Graphyx are made available under the MIT License +copyright (c) 2009 Jakob Odersky \ No newline at end of file diff --git a/doc/all-classes.html b/doc/all-classes.html new file mode 100644 index 0000000..086233b --- /dev/null +++ b/doc/all-classes.html @@ -0,0 +1,131 @@ + + + List of all classes and objects + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/graphyx$content.html b/doc/graphyx$content.html new file mode 100644 index 0000000..b78a5ec --- /dev/null +++ b/doc/graphyx$content.html @@ -0,0 +1,21 @@ + + + All classes and objects in graphyx + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + +
Object Summary
+ object + + Graphyx + extends AnyRef + + +
+ \ No newline at end of file diff --git a/doc/graphyx$package.html b/doc/graphyx$package.html new file mode 100644 index 0000000..ce0ccc2 --- /dev/null +++ b/doc/graphyx$package.html @@ -0,0 +1,14 @@ + + + List of classes and objects in package graphyx + + + + +
+
Objects
+ \ No newline at end of file diff --git a/doc/graphyx/Graphyx$object.html b/doc/graphyx/Graphyx$object.html new file mode 100644 index 0000000..1e705a8 --- /dev/null +++ b/doc/graphyx/Graphyx$object.html @@ -0,0 +1,221 @@ + + + object Graphyx in graphyx + + + + + + + + + + + +
+ graphyx +

+ object Graphyx +

+
+ [source: graphyx/Graphyx.scala] +

+
+
+ + + object + Graphyx +
+
extends AnyRef
+
+ + + + + + + + + + + + + + + + +
Value Summary
+ val + + guiActor + : GUIActor + + +
+ val + + physicsActor + : PhysicsActor + + +
+ val + + tests + : scala.List[Test] + + +
+ + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + exit + : Unit + + +
+ def + + main + (args : scala.Array[java.lang.String]) : Unit + + +
+ def + + test + : Test + + +
+ def + + test_= + (t : Test) : Unit + + +
+ + +
+ 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 + tests : scala.List[Test] +
+
+

+
+
+ + + val + physicsActor : PhysicsActor +
+
+

+
+
+ + + val + guiActor : GUIActor +
+
+

+ + +
Method Details
+
+ + + def + test : Test +
+
+

+
+
+ + + def + test_=(t : Test) : Unit +
+
+

+
+
+ + + def + main(args : scala.Array[java.lang.String]) : Unit +
+
+

+
+
+ + + def + exit : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/actors$content.html b/doc/graphyx/actors$content.html new file mode 100644 index 0000000..03856e4 --- /dev/null +++ b/doc/graphyx/actors$content.html @@ -0,0 +1,100 @@ + + + All classes and objects in graphyx.actors + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + +
Class Summary
+ class + + GUIActor + extends scala.actors.Actor + + +
+ class + + PhysicsActor + extends scala.actors.Actor + + +
+ case class + + SetWorld + (val world : World) extends scala.Product + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Object Summary
+ case object + + Exit + extends scala.Product + + +
+ case object + + FireEvent + extends scala.Product + + +
+ object + + SetWorld + extends (World) => SetWorld + + +
+ case object + + Start + extends scala.Product + + +
+ case object + + Stop + extends scala.Product + + +
+ \ No newline at end of file diff --git a/doc/graphyx/actors$package.html b/doc/graphyx/actors$package.html new file mode 100644 index 0000000..c79a9d8 --- /dev/null +++ b/doc/graphyx/actors$package.html @@ -0,0 +1,22 @@ + + + List of classes and objects in package graphyx.actors + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/graphyx/actors/Exit$object.html b/doc/graphyx/actors/Exit$object.html new file mode 100644 index 0000000..ad24c13 --- /dev/null +++ b/doc/graphyx/actors/Exit$object.html @@ -0,0 +1,205 @@ + + + object Exit in graphyx.actors + + + + + + + + + + + +
+ graphyx.actors +

+ object Exit +

+
+ [source: graphyx/actors/Exit.scala] +

+
+
+ + case + object + Exit +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + productArity + : Int + + +
+ override def + + productElement + (arg0 : Int) : Any + + +
+ override def + + productPrefix + : java.lang.String + + +
+ protected def + + readResolve + : AnyRef + + +
+ override final def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override final + 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 + 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 +
+

+
+
+ + protected + def + readResolve : AnyRef +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/actors/FireEvent$object.html b/doc/graphyx/actors/FireEvent$object.html new file mode 100644 index 0000000..978fd70 --- /dev/null +++ b/doc/graphyx/actors/FireEvent$object.html @@ -0,0 +1,205 @@ + + + object FireEvent in graphyx.actors + + + + + + + + + + + +
+ graphyx.actors +

+ object FireEvent +

+
+ [source: graphyx/actors/FireEvent.scala] +

+
+
+ + case + object + FireEvent +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + productArity + : Int + + +
+ override def + + productElement + (arg0 : Int) : Any + + +
+ override def + + productPrefix + : java.lang.String + + +
+ protected def + + readResolve + : AnyRef + + +
+ override final def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override final + 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 + 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 +
+

+
+
+ + protected + def + readResolve : AnyRef +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/actors/GUIActor.html b/doc/graphyx/actors/GUIActor.html new file mode 100644 index 0000000..2dbb266 --- /dev/null +++ b/doc/graphyx/actors/GUIActor.html @@ -0,0 +1,162 @@ + + + class GUIActor in graphyx.actors + + + + + + + + + + + +
+ graphyx.actors +

+ class GUIActor +

+
+ [source: graphyx/actors/GUIActor.scala] +

+
+
+ + + class + GUIActor +
+
extends scala.actors.Actor
+
+ + + + + + + + + + + + +
Value Summary
+ val + + container + : Container + + +
+ var + + continue + : Boolean + + +
+ + +
+ Values and Variables inherited from scala.actors.Actor +
+ scala.actors.Actor.mailbox, scala.actors.Actor.trapExit +
+ + + + + + +
Method Summary
+ def + + act + : Unit + + +
+ + +
+ Methods inherited from scala.actors.Actor +
+ scala.actors.Actor.scheduler, scala.actors.Actor.mailboxSize, scala.actors.Actor.send, scala.actors.Actor.receive, scala.actors.Actor.receiveWithin, scala.actors.Actor.react, scala.actors.Actor.reactWithin, scala.actors.Actor.!, scala.actors.Actor.forward, scala.actors.Actor.!?, scala.actors.Actor.!?, scala.actors.Actor.!!, scala.actors.Actor.!!, scala.actors.Actor.reply, scala.actors.Actor.?, scala.actors.Actor.sender, scala.actors.Actor.receiver, scala.actors.Actor.scheduleActor, scala.actors.Actor.start, scala.actors.Actor.link, scala.actors.Actor.link, scala.actors.Actor.unlink, scala.actors.Actor.exit, scala.actors.Actor.exit +
+ + +
+ 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 + container : Container +
+
+

+
+
+ + + var + continue : Boolean +
+
+

+ + +
Method Details
+
+ + + def + act : Unit +
+
+
+
+ Overrides +
+
+ scala.actors.Actor.scala.actors.Actor.act +
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/actors/PhysicsActor.html b/doc/graphyx/actors/PhysicsActor.html new file mode 100644 index 0000000..53f230e --- /dev/null +++ b/doc/graphyx/actors/PhysicsActor.html @@ -0,0 +1,202 @@ + + + class PhysicsActor in graphyx.actors + + + + + + + + + + + +
+ graphyx.actors +

+ class PhysicsActor +

+
+ [source: graphyx/actors/PhysicsActor.scala] +

+
+
+ + + class + PhysicsActor +
+
extends scala.actors.Actor
+
+ + + + + + + + + + + + + + + + +
Value Summary
+ var + + continue + : Boolean + + +
+ var + + simulate + : Boolean + + +
+ var + + world + : World + + +
+ + +
+ Values and Variables inherited from scala.actors.Actor +
+ scala.actors.Actor.mailbox, scala.actors.Actor.trapExit +
+ + + + + + + + + + +
Method Summary
+ def + + act + : Unit + + +
+ def + + fps + : Int + + +
+ + +
+ Methods inherited from scala.actors.Actor +
+ scala.actors.Actor.scheduler, scala.actors.Actor.mailboxSize, scala.actors.Actor.send, scala.actors.Actor.receive, scala.actors.Actor.receiveWithin, scala.actors.Actor.react, scala.actors.Actor.reactWithin, scala.actors.Actor.!, scala.actors.Actor.forward, scala.actors.Actor.!?, scala.actors.Actor.!?, scala.actors.Actor.!!, scala.actors.Actor.!!, scala.actors.Actor.reply, scala.actors.Actor.?, scala.actors.Actor.sender, scala.actors.Actor.receiver, scala.actors.Actor.scheduleActor, scala.actors.Actor.start, scala.actors.Actor.link, scala.actors.Actor.link, scala.actors.Actor.unlink, scala.actors.Actor.exit, scala.actors.Actor.exit +
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + var + world : World +
+
+

+
+
+ + + var + continue : Boolean +
+
+

+
+
+ + + var + simulate : Boolean +
+
+

+ + +
Method Details
+
+ + + def + fps : Int +
+
+

+
+
+ + + def + act : Unit +
+
+
+
+ Overrides +
+
+ scala.actors.Actor.scala.actors.Actor.act +
+

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

+ object SetWorld +

+
+ [source: graphyx/actors/SetWorld.scala] +

+
+
+ + + object + SetWorld +
+
extends (World) => SetWorld
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/actors/SetWorld.html b/doc/graphyx/actors/SetWorld.html new file mode 100644 index 0000000..2eacdd1 --- /dev/null +++ b/doc/graphyx/actors/SetWorld.html @@ -0,0 +1,276 @@ + + + class SetWorld in graphyx.actors + + + + + + + + + + + +
+ graphyx.actors +

+ class SetWorld +

+
+ [source: graphyx/actors/SetWorld.scala] +

+
+
+ + case + class + SetWorld(val world : World) +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + 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/graphyx/actors/Start$object.html b/doc/graphyx/actors/Start$object.html new file mode 100644 index 0000000..3d38727 --- /dev/null +++ b/doc/graphyx/actors/Start$object.html @@ -0,0 +1,205 @@ + + + object Start in graphyx.actors + + + + + + + + + + + +
+ graphyx.actors +

+ object Start +

+
+ [source: graphyx/actors/Start.scala] +

+
+
+ + case + object + Start +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + productArity + : Int + + +
+ override def + + productElement + (arg0 : Int) : Any + + +
+ override def + + productPrefix + : java.lang.String + + +
+ protected def + + readResolve + : AnyRef + + +
+ override final def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override final + 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 + 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 +
+

+
+
+ + protected + def + readResolve : AnyRef +
+
+

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

+ object Stop +

+
+ [source: graphyx/actors/Stop.scala] +

+
+
+ + case + object + Stop +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + productArity + : Int + + +
+ override def + + productElement + (arg0 : Int) : Any + + +
+ override def + + productPrefix + : java.lang.String + + +
+ protected def + + readResolve + : AnyRef + + +
+ override final def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override final + 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 + 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 +
+

+
+
+ + protected + def + readResolve : AnyRef +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/graphics$content.html b/doc/graphyx/graphics$content.html new file mode 100644 index 0000000..b9d8189 --- /dev/null +++ b/doc/graphyx/graphics$content.html @@ -0,0 +1,332 @@ + + + All classes and objects in graphyx.graphics + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ trait + + Drawable + extends AnyRef + +
Enthaelt Methoden und Felder fuer graphische Darstellungen. + Alle Klassen die dieses Trait implementieren koennen graphisch dargestellt werden.
+
+ case class + + GraphicalAABB + (val real : AABB) extends AABB with GraphicalObject + + +
+ case class + + GraphicalBody + (val real : Body) extends GraphicalObject with scala.Product + + +
+ case class + + GraphicalCircle + (val real : Circle) extends Circle with GraphicalShape + + +
+ case class + + GraphicalCollision + (val real : Collision) extends GraphicalObject with scala.Product + + +
+ case class + + GraphicalDistanceJoint + (val real : DistanceJoint) extends GraphicalJoint with scala.Product + + +
+ trait + + GraphicalJoint + extends GraphicalObject + + +
+ trait + + GraphicalObject + extends Drawable + +
Only copies functional info! (e.g. Graphical world does not include shapes, bodies).
+
+ case class + + GraphicalPair + (val real : Pair) extends GraphicalObject with scala.Product + + +
+ case class + + GraphicalRectangle + (val real : Rectangle) extends Rectangle with GraphicalShape + + +
+ case class + + GraphicalRegularPolygon + (val real : RegularPolygon) extends RegularPolygon with GraphicalShape + + +
+ case class + + GraphicalRevoluteJoint + (val real : RevoluteJoint) extends GraphicalJoint with scala.Product + + +
+ trait + + GraphicalShape + extends Shape with GraphicalObject + + +
+ case class + + GraphicalSpringJoint + (val real : SpringJoint) extends GraphicalJoint with scala.Product + + +
+ case class + + GraphicalWorld + (val real : World) extends scala.Product + + +
+ case class + + Scene + (val real : World) extends scala.Product + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Object Summary
+ object + + GraphicalAABB + extends (AABB) => GraphicalAABB + + +
+ object + + GraphicalBody + extends (Body) => GraphicalBody + + +
+ object + + GraphicalCircle + extends (Circle) => GraphicalCircle + + +
+ object + + GraphicalCollision + extends (Collision) => GraphicalCollision + + +
+ object + + GraphicalDistanceJoint + extends (DistanceJoint) => GraphicalDistanceJoint + + +
+ object + + GraphicalPair + extends (Pair) => GraphicalPair + + +
+ object + + GraphicalRectangle + extends (Rectangle) => GraphicalRectangle + + +
+ object + + GraphicalRegularPolygon + extends (RegularPolygon) => GraphicalRegularPolygon + + +
+ object + + GraphicalRevoluteJoint + extends (RevoluteJoint) => GraphicalRevoluteJoint + + +
+ object + + GraphicalSpringJoint + extends (SpringJoint) => GraphicalSpringJoint + + +
+ object + + GraphicalWorld + extends (World) => GraphicalWorld + + +
+ object + + Parser + extends AnyRef + + +
+ object + + Scene + extends (World) => Scene + + +
+ \ No newline at end of file diff --git a/doc/graphyx/graphics$package.html b/doc/graphyx/graphics$package.html new file mode 100644 index 0000000..94f5f77 --- /dev/null +++ b/doc/graphyx/graphics$package.html @@ -0,0 +1,43 @@ + + + List of classes and objects in package graphyx.graphics + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/graphyx/graphics/Drawable.html b/doc/graphyx/graphics/Drawable.html new file mode 100644 index 0000000..f5e00fc --- /dev/null +++ b/doc/graphyx/graphics/Drawable.html @@ -0,0 +1,397 @@ + + + trait Drawable in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ trait Drawable +

+
+ [source: graphyx/graphics/Drawable.scala] +

+
+
+ + + trait + Drawable +
+
extends AnyRef
+
+
Enthaelt Methoden und Felder fuer graphische Darstellungen. + Alle Klassen die dieses Trait implementieren koennen graphisch dargestellt werden.
+
+
+
Direct Known Subclasses:
+
GraphicalObject
+

+ + + + + + + + + + + + + + + + + + + + +
Value Summary
+ var + + g + : java.awt.Graphics + +
Java Graphics Objekt zur graphischen Darstellung
+
+ var + + ppm + : Double + +
Anzahl von Pixeln pro Meter.
+
+ var + + scale + : Double + +
Skala in der die graphischen Objekte gezeichnet werden.
+
+ var + + windowHeight + : Int + +
Hoehe des Fensters in Pixeln.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + correctY + (y : Double) : Double + +
Korrigiert einen Y-Wert in Bildschirmkoordinaten zu seinem kartesischen Aequivalent.
+
+ abstract def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ def + + drawCircle + (center : Vector2D, radius : Double) : Unit + +
Malt einen Kreis auf g.
+
+ def + + drawLine + (startPoint : Vector2D, endPoint : Vector2D) : Unit + +
Malt eine Linie auf g.
+
+ def + + drawPoint + (point : Vector2D) : Unit + +
Malt einen Punkt auf g.
+
+ def + + drawPolygon + (points : scala.Seq[Vector2D]) : Unit + +
Malt ein Polygon auf g.
+
+ def + + drawVector + (v : Vector2D, p : Vector2D) : Unit + +
Malt einen Vektor auf g.
+
+ def + + fillCircle + (center : Vector2D, radius : Double) : Unit + +
Malt einen massiven Kreis auf g.
+
+ def + + fillPolygon + (points : scala.Seq[Vector2D]) : Unit + +
Malt ein massives Polygon auf g.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + var + g : java.awt.Graphics +
+
+
+
Java Graphics Objekt zur graphischen Darstellung
+
+
+
+
+ + + var + ppm : Double +
+
+
+
Anzahl von Pixeln pro Meter.
+
+
+
+
+ + + var + scale : Double +
+
+
+
Skala in der die graphischen Objekte gezeichnet werden.
+
+
+
+
+ + + var + windowHeight : Int +
+
+
+
Hoehe des Fensters in Pixeln.
+
+
+ + +
Method Details
+
+ + + def + correctY(y : Double) : Double +
+
+
+
Korrigiert einen Y-Wert in Bildschirmkoordinaten zu seinem kartesischen Aequivalent.
+
+ Parameters
y - zu korrigierender Wert
+
+
+
+ + + def + drawLine(startPoint : Vector2D, endPoint : Vector2D) : Unit +
+
+
+
Malt eine Linie auf g.
+
+ Parameters
startPoint - Startpunkt in Weltkoordinaten
endPoint - Endpunkt in Weltkoordinaten
+
+
+
+ + + def + fillPolygon(points : scala.Seq[Vector2D]) : Unit +
+
+
+
Malt ein massives Polygon auf g.
+
+ Parameters
points - Eckpunkte des Polygons in Weltkoordinaten
+
+
+
+ + + def + drawPolygon(points : scala.Seq[Vector2D]) : Unit +
+
+
+
Malt ein Polygon auf g.
+
+ Parameters
points - Eckpunkte des Polygons in Weltkoordinaten
+
+
+
+ + + def + fillCircle(center : Vector2D, radius : Double) : Unit +
+
+
+
Malt einen massiven Kreis auf g.
+
+ Parameters
center - Mitte des Kreises in Weltkoordinaten
radius - Radius des Kreises
+
+
+
+ + + def + drawCircle(center : Vector2D, radius : Double) : Unit +
+
+
+
Malt einen Kreis auf g.
+
+ Parameters
center - Mitte des Kreises in Weltkoordinaten
radius - Radius des Kreises
+
+
+
+ + + def + drawPoint(point : Vector2D) : Unit +
+
+
+
Malt einen Punkt auf g. +

+ Der Punkt wird von einem Kreis umgeben.

+
+ Parameters
point - Punkt in Weltkoordinaten
+
+
+
+ + + def + drawVector(v : Vector2D, p : Vector2D) : Unit +
+
+
+
Malt einen Vektor auf g.
+
+ Parameters
v - Vektor in Weltkoordinaten
p - Ursprungspunkt in Weltkoordinaten
+
+
+
+ + abstract + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/graphics/GraphicalAABB$object.html b/doc/graphyx/graphics/GraphicalAABB$object.html new file mode 100644 index 0000000..02225f7 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalAABB$object.html @@ -0,0 +1,82 @@ + + + object GraphicalAABB in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalAABB +

+
+ [source: graphyx/graphics/GraphicalAABB.scala] +

+
+
+ + + object + GraphicalAABB +
+
extends (AABB) => GraphicalAABB
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalAABB.html b/doc/graphyx/graphics/GraphicalAABB.html new file mode 100644 index 0000000..6855bd7 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalAABB.html @@ -0,0 +1,355 @@ + + + class GraphicalAABB in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalAABB +

+
+ [source: graphyx/graphics/GraphicalAABB.scala] +

+
+
+ + case + class + GraphicalAABB(val real : AABB) +
+
extends AABB with GraphicalObject
+
+ + + + + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + +
+ Values and Variables inherited from AABB +
+ minVertex, maxVertex +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AABB +
+ overlaps +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+ Overrides +
+
+ GraphicalObject.draw +
+

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

+
+
+ Overrides +
+
+ AABB.hashCode +
+

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

+
+
+ Overrides +
+
+ AABB.toString +
+

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

+
+
+ Overrides +
+
+ AABB.equals +
+

+
+
+ + override + def + productPrefix : java.lang.String +
+
+
+
+ Overrides +
+
+ AABB.productPrefix +
+

+
+
+ + override + def + productArity : Int +
+
+
+
+ Overrides +
+
+ AABB.productArity +
+

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

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

+ object GraphicalBody +

+
+ [source: graphyx/graphics/GraphicalBody.scala] +

+
+
+ + + object + GraphicalBody +
+
extends (Body) => GraphicalBody
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalBody.html b/doc/graphyx/graphics/GraphicalBody.html new file mode 100644 index 0000000..8b3c88d --- /dev/null +++ b/doc/graphyx/graphics/GraphicalBody.html @@ -0,0 +1,383 @@ + + + class GraphicalBody in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalBody +

+
+ [source: graphyx/graphics/GraphicalBody.scala] +

+
+
+ + case + class + GraphicalBody(val real : Body) +
+
extends GraphicalObject with scala.Product
+
+ + + + + + + + + + + + + + + + +
Value Summary
+ val + + fixed + : Boolean + + +
+ val + + monitor + : Boolean + + +
+ val + + pos + : Vector2D + + +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + pos : Vector2D +
+
+

+
+
+ + + val + fixed : Boolean +
+
+

+
+
+ + + val + monitor : Boolean +
+
+

+ + +
Method Details
+
+ + + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+ Overrides +
+
+ GraphicalObject.draw +
+

+
+
+ + 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/graphyx/graphics/GraphicalCircle$object.html b/doc/graphyx/graphics/GraphicalCircle$object.html new file mode 100644 index 0000000..bdf676e --- /dev/null +++ b/doc/graphyx/graphics/GraphicalCircle$object.html @@ -0,0 +1,82 @@ + + + object GraphicalCircle in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalCircle +

+
+ [source: graphyx/graphics/GraphicalCircle.scala] +

+
+
+ + + object + GraphicalCircle +
+
extends (Circle) => GraphicalCircle
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalCircle.html b/doc/graphyx/graphics/GraphicalCircle.html new file mode 100644 index 0000000..1cf6174 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalCircle.html @@ -0,0 +1,369 @@ + + + class GraphicalCircle in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalCircle +

+
+ [source: graphyx/graphics/GraphicalCircle.scala] +

+
+
+ + case + class + GraphicalCircle(val real : Circle) +
+
extends Circle with GraphicalShape
+
+ + + + + +
+ Values and Variables inherited from GraphicalShape +
+ uid +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + +
+ Values and Variables inherited from Circle +
+ radius, density, volume, I +
+ + +
+ Values and Variables inherited from Shape +
+ collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from Circle +
+ AABB, project, contains +
+ + +
+ Methods inherited from Shape +
+ mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+
+ + 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.

+
+
+ Overrides +
+
+ Circle.hashCode +
+

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

+
+
+ Overrides +
+
+ Circle.toString +
+

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

+
+
+ Overrides +
+
+ Circle.equals +
+

+
+
+ + override + def + productPrefix : java.lang.String +
+
+
+
+ Overrides +
+
+ Circle.productPrefix +
+

+
+
+ + override + def + productArity : Int +
+
+
+
+ Overrides +
+
+ Circle.productArity +
+

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

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/graphics/GraphicalCollision$object.html b/doc/graphyx/graphics/GraphicalCollision$object.html new file mode 100644 index 0000000..6c382a1 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalCollision$object.html @@ -0,0 +1,82 @@ + + + object GraphicalCollision in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalCollision +

+
+ [source: graphyx/graphics/GraphicalCollision.scala] +

+
+
+ + + object + GraphicalCollision +
+
extends (Collision) => GraphicalCollision
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalCollision.html b/doc/graphyx/graphics/GraphicalCollision.html new file mode 100644 index 0000000..4d8c1e9 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalCollision.html @@ -0,0 +1,363 @@ + + + class GraphicalCollision in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalCollision +

+
+ [source: graphyx/graphics/GraphicalCollision.scala] +

+
+
+ + case + class + GraphicalCollision(val real : Collision) +
+
extends GraphicalObject with scala.Product
+
+ + + + + + + + + + + + +
Value Summary
+ val + + normal + : Vector2D + + +
+ val + + points + : scala.Iterable[Vector2D] + + +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + points : scala.Iterable[Vector2D] +
+
+

+
+
+ + + val + normal : Vector2D +
+
+

+ + +
Method Details
+
+ + + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+ Overrides +
+
+ GraphicalObject.draw +
+

+
+
+ + 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/graphyx/graphics/GraphicalDistanceJoint$object.html b/doc/graphyx/graphics/GraphicalDistanceJoint$object.html new file mode 100644 index 0000000..709089b --- /dev/null +++ b/doc/graphyx/graphics/GraphicalDistanceJoint$object.html @@ -0,0 +1,82 @@ + + + object GraphicalDistanceJoint in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalDistanceJoint +

+
+ [source: graphyx/graphics/GraphicalDistanceJoint.scala] +

+
+
+ + + object + GraphicalDistanceJoint +
+
extends (DistanceJoint) => GraphicalDistanceJoint
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalDistanceJoint.html b/doc/graphyx/graphics/GraphicalDistanceJoint.html new file mode 100644 index 0000000..bb001e3 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalDistanceJoint.html @@ -0,0 +1,356 @@ + + + class GraphicalDistanceJoint in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalDistanceJoint +

+
+ [source: graphyx/graphics/GraphicalDistanceJoint.scala] +

+
+
+ + case + class + GraphicalDistanceJoint(val real : DistanceJoint) +
+
extends GraphicalJoint with scala.Product
+
+ + + + + + + + + + + + +
Value Summary
+ val + + connection1 + : Vector2D + + +
+ val + + connection2 + : Vector2D + + +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + connection1 : Vector2D +
+
+

+
+
+ + + val + connection2 : Vector2D +
+
+

+ + +
Method Details
+
+ + + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+
+ + 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/graphyx/graphics/GraphicalJoint.html b/doc/graphyx/graphics/GraphicalJoint.html new file mode 100644 index 0000000..69c1c32 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalJoint.html @@ -0,0 +1,132 @@ + + + trait GraphicalJoint in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ trait GraphicalJoint +

+
+ [source: graphyx/graphics/GraphicalJoint.scala] +

+
+
+ + + trait + GraphicalJoint +
+
extends GraphicalObject
+
+
Direct Known Subclasses:
+
GraphicalDistanceJoint, GraphicalRevoluteJoint, GraphicalSpringJoint
+

+ + + + + + + + +
Value Summary
+ abstract val + + real + : Joint + +
Pointer to real object.
+
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + +
+ Methods inherited from GraphicalObject +
+ draw (abstract) +
+ + + + + + +
Value Details
+
+ + abstract + val + real : Joint +
+
+
+
Pointer to real object.
+
+
+
+ Overrides +
+
+ GraphicalObject.real +
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/graphics/GraphicalObject.html b/doc/graphyx/graphics/GraphicalObject.html new file mode 100644 index 0000000..4add644 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalObject.html @@ -0,0 +1,154 @@ + + + trait GraphicalObject in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ trait GraphicalObject +

+
+ [source: graphyx/graphics/GraphicalObject.scala] +

+
+
+ + + trait + GraphicalObject +
+
extends Drawable
+
+
Only copies functional info! (e.g. Graphical world does not include shapes, bodies).
+
+
+
Direct Known Subclasses:
+
GraphicalAABB, GraphicalBody, GraphicalCollision, GraphicalJoint, GraphicalPair, GraphicalShape
+

+ + + + + + + + +
Value Summary
+ abstract val + + real + : AnyRef + +
Pointer to real object.
+
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + +
Method Summary
+ abstract def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ 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
+
+ + abstract + val + real : AnyRef +
+
+
+
Pointer to real object.
+
+
+ + +
Method Details
+
+ + abstract + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+ Overrides +
+
+ Drawable.draw +
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/graphics/GraphicalPair$object.html b/doc/graphyx/graphics/GraphicalPair$object.html new file mode 100644 index 0000000..7b37b60 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalPair$object.html @@ -0,0 +1,82 @@ + + + object GraphicalPair in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalPair +

+
+ [source: graphyx/graphics/GraphicalPair.scala] +

+
+
+ + + object + GraphicalPair +
+
extends (Pair) => GraphicalPair
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalPair.html b/doc/graphyx/graphics/GraphicalPair.html new file mode 100644 index 0000000..27ad098 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalPair.html @@ -0,0 +1,363 @@ + + + class GraphicalPair in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalPair +

+
+ [source: graphyx/graphics/GraphicalPair.scala] +

+
+
+ + case + class + GraphicalPair(val real : Pair) +
+
extends GraphicalObject with scala.Product
+
+ + + + + + + + + + + + +
Value Summary
+ val + + pos1 + : Vector2D + + +
+ val + + pos2 + : Vector2D + + +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + pos1 : Vector2D +
+
+

+
+
+ + + val + pos2 : Vector2D +
+
+

+ + +
Method Details
+
+ + + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+ Overrides +
+
+ GraphicalObject.draw +
+

+
+
+ + 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/graphyx/graphics/GraphicalRectangle$object.html b/doc/graphyx/graphics/GraphicalRectangle$object.html new file mode 100644 index 0000000..cb18cac --- /dev/null +++ b/doc/graphyx/graphics/GraphicalRectangle$object.html @@ -0,0 +1,82 @@ + + + object GraphicalRectangle in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalRectangle +

+
+ [source: graphyx/graphics/GraphicalRectangle.scala] +

+
+
+ + + object + GraphicalRectangle +
+
extends (Rectangle) => GraphicalRectangle
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalRectangle.html b/doc/graphyx/graphics/GraphicalRectangle.html new file mode 100644 index 0000000..264601b --- /dev/null +++ b/doc/graphyx/graphics/GraphicalRectangle.html @@ -0,0 +1,376 @@ + + + class GraphicalRectangle in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalRectangle +

+
+ [source: graphyx/graphics/GraphicalRectangle.scala] +

+
+
+ + case + class + GraphicalRectangle(val real : Rectangle) +
+
extends Rectangle with GraphicalShape
+
+ + + + + +
+ Values and Variables inherited from GraphicalShape +
+ uid +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + +
+ Values and Variables inherited from Rectangle +
+ halfWidth, halfHeight, density, volume, I +
+ + +
+ Values and Variables inherited from Shape +
+ collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from Rectangle +
+ halfDiags, vertices +
+ + +
+ Methods inherited from ConvexPolygon +
+ sides, project, AABB, contains +
+ + +
+ Methods inherited from Shape +
+ mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+
+ + 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.

+
+
+ Overrides +
+
+ Rectangle.hashCode +
+

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

+
+
+ Overrides +
+
+ Rectangle.toString +
+

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

+
+
+ Overrides +
+
+ Rectangle.equals +
+

+
+
+ + override + def + productPrefix : java.lang.String +
+
+
+
+ Overrides +
+
+ Rectangle.productPrefix +
+

+
+
+ + override + def + productArity : Int +
+
+
+
+ Overrides +
+
+ Rectangle.productArity +
+

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

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/graphics/GraphicalRegularPolygon$object.html b/doc/graphyx/graphics/GraphicalRegularPolygon$object.html new file mode 100644 index 0000000..65d69bc --- /dev/null +++ b/doc/graphyx/graphics/GraphicalRegularPolygon$object.html @@ -0,0 +1,82 @@ + + + object GraphicalRegularPolygon in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalRegularPolygon +

+
+ [source: graphyx/graphics/GraphicalRegularPolygon.scala] +

+
+
+ + + object + GraphicalRegularPolygon +
+
extends (RegularPolygon) => GraphicalRegularPolygon
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalRegularPolygon.html b/doc/graphyx/graphics/GraphicalRegularPolygon.html new file mode 100644 index 0000000..a86cedf --- /dev/null +++ b/doc/graphyx/graphics/GraphicalRegularPolygon.html @@ -0,0 +1,376 @@ + + + class GraphicalRegularPolygon in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalRegularPolygon +

+
+ [source: graphyx/graphics/GraphicalRegularPolygon.scala] +

+
+
+ + case + class + GraphicalRegularPolygon(val real : RegularPolygon) +
+
extends RegularPolygon with GraphicalShape
+
+ + + + + +
+ Values and Variables inherited from GraphicalShape +
+ uid +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + +
+ Values and Variables inherited from RegularPolygon +
+ n, radius, density, volume, I +
+ + +
+ Values and Variables inherited from Shape +
+ collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from RegularPolygon +
+ halfDiags, vertices +
+ + +
+ Methods inherited from ConvexPolygon +
+ sides, project, AABB, contains +
+ + +
+ Methods inherited from Shape +
+ mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + override + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+
+ + 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.

+
+
+ Overrides +
+
+ RegularPolygon.hashCode +
+

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

+
+
+ Overrides +
+
+ RegularPolygon.toString +
+

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

+
+
+ Overrides +
+
+ RegularPolygon.equals +
+

+
+
+ + override + def + productPrefix : java.lang.String +
+
+
+
+ Overrides +
+
+ RegularPolygon.productPrefix +
+

+
+
+ + override + def + productArity : Int +
+
+
+
+ Overrides +
+
+ RegularPolygon.productArity +
+

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

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

+ object GraphicalRevoluteJoint +

+
+ [source: graphyx/graphics/GraphicalRevoluteJoint.scala] +

+
+
+ + + object + GraphicalRevoluteJoint +
+
extends (RevoluteJoint) => GraphicalRevoluteJoint
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalRevoluteJoint.html b/doc/graphyx/graphics/GraphicalRevoluteJoint.html new file mode 100644 index 0000000..3d0ab61 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalRevoluteJoint.html @@ -0,0 +1,336 @@ + + + class GraphicalRevoluteJoint in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalRevoluteJoint +

+
+ [source: graphyx/graphics/GraphicalRevoluteJoint.scala] +

+
+
+ + case + class + GraphicalRevoluteJoint(val real : RevoluteJoint) +
+
extends GraphicalJoint with scala.Product
+
+ + + + + + + + +
Value Summary
+ val + + connection1 + : Vector2D + + +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + connection1 : Vector2D +
+
+

+ + +
Method Details
+
+ + + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+
+ + 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/graphyx/graphics/GraphicalShape.html b/doc/graphyx/graphics/GraphicalShape.html new file mode 100644 index 0000000..5f45529 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalShape.html @@ -0,0 +1,176 @@ + + + trait GraphicalShape in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ trait GraphicalShape +

+
+ [source: graphyx/graphics/GraphicalShape.scala] +

+
+
+ + + trait + GraphicalShape +
+
extends Shape with GraphicalObject
+
+
Direct Known Subclasses:
+
GraphicalCircle, GraphicalRectangle, GraphicalRegularPolygon
+

+ + + + + + + + + + + + +
Value Summary
+ abstract val + + real + : Shape + +
Pointer to real object.
+
+ override val + + uid + : Int + +
Einzigartige Identifikationsnummer.
+
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + +
+ Values and Variables inherited from Shape +
+ density (abstract), volume (abstract), I (abstract), collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from Shape +
+ AABB (abstract), project (abstract), contains (abstract), mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + +
+ Methods inherited from GraphicalObject +
+ draw (abstract) +
+ + + + + + +
Value Details
+
+ + abstract + val + real : Shape +
+
+
+
Pointer to real object.
+
+
+
+ Overrides +
+
+ GraphicalObject.real +
+

+
+
+ + override + val + uid : Int +
+
+
+
Einzigartige Identifikationsnummer.
+
+
+
+ Overrides +
+
+ Shape.uid +
+

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

+ object GraphicalSpringJoint +

+
+ [source: graphyx/graphics/GraphicalSpringJoint.scala] +

+
+
+ + + object + GraphicalSpringJoint +
+
extends (SpringJoint) => GraphicalSpringJoint
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalSpringJoint.html b/doc/graphyx/graphics/GraphicalSpringJoint.html new file mode 100644 index 0000000..5cf80cf --- /dev/null +++ b/doc/graphyx/graphics/GraphicalSpringJoint.html @@ -0,0 +1,356 @@ + + + class GraphicalSpringJoint in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalSpringJoint +

+
+ [source: graphyx/graphics/GraphicalSpringJoint.scala] +

+
+
+ + case + class + GraphicalSpringJoint(val real : SpringJoint) +
+
extends GraphicalJoint with scala.Product
+
+ + + + + + + + + + + + +
Value Summary
+ val + + connection1 + : Vector2D + + +
+ val + + connection2 + : Vector2D + + +
+ + +
+ Values and Variables inherited from Drawable +
+ g, ppm, scale, windowHeight +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + draw + : Unit + +
Stellt das graphische Objekt dar.
+
+ 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.
+
+ + +
+ Methods inherited from Drawable +
+ correctY, drawLine, fillPolygon, drawPolygon, fillCircle, drawCircle, drawPoint, drawVector +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + connection1 : Vector2D +
+
+

+
+
+ + + val + connection2 : Vector2D +
+
+

+ + +
Method Details
+
+ + + def + draw : Unit +
+
+
+
Stellt das graphische Objekt dar.
+
+
+
+
+ + 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/graphyx/graphics/GraphicalWorld$object.html b/doc/graphyx/graphics/GraphicalWorld$object.html new file mode 100644 index 0000000..2b29226 --- /dev/null +++ b/doc/graphyx/graphics/GraphicalWorld$object.html @@ -0,0 +1,82 @@ + + + object GraphicalWorld in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object GraphicalWorld +

+
+ [source: graphyx/graphics/GraphicalWorld.scala] +

+
+
+ + + object + GraphicalWorld +
+
extends (World) => GraphicalWorld
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/GraphicalWorld.html b/doc/graphyx/graphics/GraphicalWorld.html new file mode 100644 index 0000000..d04da4e --- /dev/null +++ b/doc/graphyx/graphics/GraphicalWorld.html @@ -0,0 +1,439 @@ + + + class GraphicalWorld in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class GraphicalWorld +

+
+ [source: graphyx/graphics/GraphicalWorld.scala] +

+
+
+ + case + class + GraphicalWorld(val real : World) +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + enableCollisionDetection + : Boolean + + +
+ val + + enablePositionCorrection + : Boolean + + +
+ val + + gravity + : Vector2D + + +
+ val + + iterations + : Int + + +
+ val + + monitorResults + : scala.Seq[java.lang.String] + + +
+ val + + overCWarning + : Boolean + + +
+ val + + time + : Double + + +
+ val + + timeStep + : Double + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + time : Double +
+
+

+
+
+ + + val + timeStep : Double +
+
+

+
+
+ + + val + iterations : Int +
+
+

+
+
+ + + val + overCWarning : Boolean +
+
+

+
+
+ + + val + gravity : Vector2D +
+
+

+
+
+ + + val + monitorResults : scala.Seq[java.lang.String] +
+
+

+
+
+ + + val + enableCollisionDetection : Boolean +
+
+

+
+
+ + + val + enablePositionCorrection : Boolean +
+
+

+ + +
Method Details
+
+ + 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/graphyx/graphics/Parser$object.html b/doc/graphyx/graphics/Parser$object.html new file mode 100644 index 0000000..ae47866 --- /dev/null +++ b/doc/graphyx/graphics/Parser$object.html @@ -0,0 +1,221 @@ + + + object Parser in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ object Parser +

+
+ [source: graphyx/graphics/Parser.scala] +

+
+
+ + + object + Parser +
+
extends AnyRef
+
+ + + + + + + + +
Value Summary
+ val + + throwOnUnknown + : Boolean + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + toGraphical + (real : AABB) : GraphicalAABB + + +
+ def + + toGraphical + (real : Pair) : GraphicalPair + + +
+ def + + toGraphical + (real : Shape) : GraphicalShape with scala.Product + + +
+ def + + toGraphical + (real : Joint) : GraphicalJoint with scala.Product + + +
+ def + + toGraphical + (real : Collision) : GraphicalCollision + + +
+ def + + toGraphical + (real : Body) : GraphicalBody + + +
+ + +
+ 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 + throwOnUnknown : Boolean +
+
+

+ + +
Method Details
+
+ + + def + toGraphical(real : Shape) : GraphicalShape with scala.Product +
+
+

+
+
+ + + def + toGraphical(real : Joint) : GraphicalJoint with scala.Product +
+
+

+
+
+ + + def + toGraphical(real : Collision) : GraphicalCollision +
+
+

+
+
+ + + def + toGraphical(real : Pair) : GraphicalPair +
+
+

+
+
+ + + def + toGraphical(real : AABB) : GraphicalAABB +
+
+

+
+
+ + + def + toGraphical(real : Body) : GraphicalBody +
+
+

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

+ object Scene +

+
+ [source: graphyx/graphics/Scene.scala] +

+
+
+ + + object + Scene +
+
extends (World) => Scene
+
+ + + + + + +
+ Methods inherited from scala.Function1 +
+ scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen +
+ + +
+ 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/graphyx/graphics/Scene.html b/doc/graphyx/graphics/Scene.html new file mode 100644 index 0000000..06bbfe1 --- /dev/null +++ b/doc/graphyx/graphics/Scene.html @@ -0,0 +1,439 @@ + + + class Scene in graphyx.graphics + + + + + + + + + + + +
+ graphyx.graphics +

+ class Scene +

+
+ [source: graphyx/graphics/Scene.scala] +

+
+
+ + case + class + Scene(val real : World) +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + aabbs + : scala.Seq[GraphicalAABB] + + +
+ val + + bodies + : scala.Seq[GraphicalBody] + + +
+ val + + collisions + : scala.Seq[GraphicalCollision] + + +
+ val + + fps + : Int + + +
+ val + + joints + : scala.Seq[GraphicalJoint with scala.Product] + + +
+ val + + pairs + : scala.Seq[GraphicalPair] + + +
+ val + + shapes + : scala.Seq[GraphicalShape with scala.Product] + + +
+ val + + world + : GraphicalWorld + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + world : GraphicalWorld +
+
+

+
+
+ + + val + shapes : scala.Seq[GraphicalShape with scala.Product] +
+
+

+
+
+ + + val + joints : scala.Seq[GraphicalJoint with scala.Product] +
+
+

+
+
+ + + val + bodies : scala.Seq[GraphicalBody] +
+
+

+
+
+ + + val + collisions : scala.Seq[GraphicalCollision] +
+
+

+
+
+ + + val + pairs : scala.Seq[GraphicalPair] +
+
+

+
+
+ + + val + aabbs : scala.Seq[GraphicalAABB] +
+
+

+
+
+ + + val + fps : Int +
+
+

+ + +
Method Details
+
+ + 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/graphyx/gui$content.html b/doc/graphyx/gui$content.html new file mode 100644 index 0000000..b402d3b --- /dev/null +++ b/doc/graphyx/gui$content.html @@ -0,0 +1,142 @@ + + + All classes and objects in graphyx.gui + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ class + + BodyPopup + extends PopupMenu + + +
+ class + + Container + extends AnyRef + + +
+ class + + ControlPanel + (container : Container) extends scala.swing.BoxPanel + + +
+ class + + GrabbedBody + (b : Body, point : Vector2D) extends AnyRef + + +
+ class + + GravityPanel + (container : Container) extends scala.swing.GridBagPanel + + +
+ class + + InfoPanel + (container : Container) extends scala.swing.BoxPanel + + +
+ class + + MainFrame + (container : Container) extends scala.swing.Frame + + +
+ class + + MainPanel + (container : Container) extends scala.swing.GridBagPanel + + +
+ class + + OptionsPanel + (container : Container) extends scala.swing.GridPanel + + +
+ class + + PopupMenu + extends scala.swing.Component + + +
+ class + + ShapeInfoPanel + (container : Container) extends scala.swing.GridPanel + + +
+ class + + WorldPanel + (container : Container) extends scala.swing.BoxPanel + + +
+ + \ No newline at end of file diff --git a/doc/graphyx/gui$package.html b/doc/graphyx/gui$package.html new file mode 100644 index 0000000..d822a38 --- /dev/null +++ b/doc/graphyx/gui$package.html @@ -0,0 +1,25 @@ + + + List of classes and objects in package graphyx.gui + + + + +
Classes
+
+ \ No newline at end of file diff --git a/doc/graphyx/gui/BodyPopup.html b/doc/graphyx/gui/BodyPopup.html new file mode 100644 index 0000000..d8fb284 --- /dev/null +++ b/doc/graphyx/gui/BodyPopup.html @@ -0,0 +1,251 @@ + + + class BodyPopup in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class BodyPopup +

+
+ [source: graphyx/gui/BodyPopup.scala] +

+
+
+ + + class + BodyPopup +
+
extends PopupMenu
+
+ + + + + + + + + + + + + + + + +
Value Summary
+ val + + btnClose + : scala.swing.MenuItem + + +
+ val + + chckFixed + : scala.swing.CheckMenuItem + + +
+ val + + chckMonitor + : scala.swing.CheckMenuItem + + +
+ + +
+ Values and Variables inherited from PopupMenu +
+ peer +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + + + + + + + + +
Method Summary
+ def + + body + : Body + + +
+ def + + body_= + (newBody : Body) : Unit + + +
+ + +
+ Methods inherited from PopupMenu +
+ add, setVisible +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + chckMonitor : scala.swing.CheckMenuItem +
+
+

+
+
+ + + val + chckFixed : scala.swing.CheckMenuItem +
+
+

+
+
+ + + val + btnClose : scala.swing.MenuItem +
+
+

+ + +
Method Details
+
+ + + def + body : Body +
+
+

+
+
+ + + def + body_=(newBody : Body) : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/Container.html b/doc/graphyx/gui/Container.html new file mode 100644 index 0000000..aeb0e25 --- /dev/null +++ b/doc/graphyx/gui/Container.html @@ -0,0 +1,181 @@ + + + class Container in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class Container +

+
+ [source: graphyx/gui/Container.scala] +

+
+
+ + + class + Container +
+
extends AnyRef
+
+ + + + + + + + + + + + +
Value Summary
+ val + + mainFrame + : MainFrame + + +
+ var + + scene + : Scene + + +
+ + + + + + + + + + + + + + +
Method Summary
+ def + + exitGUI + : Unit + + +
+ def + + show + : Unit + + +
+ def + + update + (s : Scene) : Unit + + +
+ + +
+ 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 + mainFrame : MainFrame +
+
+

+
+
+ + + var + scene : Scene +
+
+

+ + +
Method Details
+
+ + + def + show : Unit +
+
+

+
+
+ + + def + update(s : Scene) : Unit +
+
+

+
+
+ + + def + exitGUI : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/ControlPanel.html b/doc/graphyx/gui/ControlPanel.html new file mode 100644 index 0000000..5352ba1 --- /dev/null +++ b/doc/graphyx/gui/ControlPanel.html @@ -0,0 +1,295 @@ + + + class ControlPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class ControlPanel +

+
+ [source: graphyx/gui/ControlPanel.scala] +

+
+
+ + + class + ControlPanel(container : Container) +
+
extends scala.swing.BoxPanel
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + btnExit + : scala.swing.Button + + +
+ val + + btnFire + : scala.swing.Button + + +
+ val + + btnReset + : scala.swing.Button + + +
+ val + + btnStart + : scala.swing.Button + + +
+ val + + btnStep + : scala.swing.Button + + +
+ val + + btnStop + : scala.swing.Button + + +
+ val + + cboTest + : scala.swing.ComboBox[Test] + + +
+ + +
+ Values and Variables inherited from scala.swing.BoxPanel +
+ scala.swing.BoxPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.SequentialContainer.Wrapper +
+ scala.swing.SequentialContainer.Wrapper.contents +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + btnStart : scala.swing.Button +
+
+

+
+
+ + + val + btnStep : scala.swing.Button +
+
+

+
+
+ + + val + btnStop : scala.swing.Button +
+
+

+
+
+ + + val + btnExit : scala.swing.Button +
+
+

+
+
+ + + val + btnFire : scala.swing.Button +
+
+

+
+
+ + + val + btnReset : scala.swing.Button +
+
+

+
+
+ + + val + cboTest : scala.swing.ComboBox[Test] +
+
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/GrabbedBody.html b/doc/graphyx/gui/GrabbedBody.html new file mode 100644 index 0000000..4d9f028 --- /dev/null +++ b/doc/graphyx/gui/GrabbedBody.html @@ -0,0 +1,141 @@ + + + class GrabbedBody in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class GrabbedBody +

+
+ [source: graphyx/gui/GrabbedBody.scala] +

+
+
+ + + class + GrabbedBody(b : Body, point : Vector2D) +
+
extends AnyRef
+
+ + + + + + + + + + + + +
Value Summary
+ val + + r + : Vector2D + + +
+ val + + wasFixed + : Boolean + + +
+ + + + + + +
Method Summary
+ def + + body + : Body + + +
+ + +
+ 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 + r : Vector2D +
+
+

+
+
+ + + val + wasFixed : Boolean +
+
+

+ + +
Method Details
+
+ + + def + body : Body +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/GravityPanel.html b/doc/graphyx/gui/GravityPanel.html new file mode 100644 index 0000000..ca9b299 --- /dev/null +++ b/doc/graphyx/gui/GravityPanel.html @@ -0,0 +1,292 @@ + + + class GravityPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class GravityPanel +

+
+ [source: graphyx/gui/GravityPanel.scala] +

+
+
+ + + class + GravityPanel(container : Container) +
+
extends scala.swing.GridBagPanel
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + c + : scala.swing.GridBagPanel.Constraints + + +
+ val + + lblX + : scala.swing.Label + + +
+ val + + lblY + : scala.swing.Label + + +
+ val + + sldX + : scala.swing.Slider + + +
+ val + + sldY + : scala.swing.Slider + + +
+ + +
+ Values and Variables inherited from scala.swing.GridBagPanel +
+ scala.swing.GridBagPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + + + + +
Method Summary
+ def + + update + : Unit + + +
+ + +
+ Methods inherited from scala.swing.GridBagPanel +
+ scala.swing.GridBagPanel.pair2Constraints, scala.swing.GridBagPanel.constraintsFor, scala.swing.GridBagPanel.areValid, scala.swing.GridBagPanel.add +
+ + +
+ Methods inherited from scala.swing.LayoutContainer +
+ scala.swing.LayoutContainer.layout +
+ + +
+ Methods inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper.contents +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + c : scala.swing.GridBagPanel.Constraints +
+
+

+
+
+ + + val + sldX : scala.swing.Slider +
+
+

+
+
+ + + val + lblX : scala.swing.Label +
+
+

+
+
+ + + val + sldY : scala.swing.Slider +
+
+

+
+
+ + + val + lblY : scala.swing.Label +
+
+

+ + +
Method Details
+
+ + + def + update : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/InfoPanel.html b/doc/graphyx/gui/InfoPanel.html new file mode 100644 index 0000000..94dd11f --- /dev/null +++ b/doc/graphyx/gui/InfoPanel.html @@ -0,0 +1,198 @@ + + + class InfoPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class InfoPanel +

+
+ [source: graphyx/gui/InfoPanel.scala] +

+
+
+ + + class + InfoPanel(container : Container) +
+
extends scala.swing.BoxPanel
+
+ + + + + + + + +
Value Summary
+ val + + out + : scala.swing.TextArea + + +
+ + +
+ Values and Variables inherited from scala.swing.BoxPanel +
+ scala.swing.BoxPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.SequentialContainer.Wrapper +
+ scala.swing.SequentialContainer.Wrapper.contents +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + + + + +
Method Summary
+ def + + update + : Unit + + +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + out : scala.swing.TextArea +
+
+

+ + +
Method Details
+
+ + + def + update : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/MainFrame.html b/doc/graphyx/gui/MainFrame.html new file mode 100644 index 0000000..fbc978a --- /dev/null +++ b/doc/graphyx/gui/MainFrame.html @@ -0,0 +1,161 @@ + + + class MainFrame in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class MainFrame +

+
+ [source: graphyx/gui/MainFrame.scala] +

+
+
+ + + class + MainFrame(container : Container) +
+
extends scala.swing.Frame
+
+ + + + + + + + +
Value Summary
+ val + + mainPanel + : MainPanel + + +
+ + +
+ Values and Variables inherited from scala.swing.Frame +
+ scala.swing.Frame.peer +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + +
+ Methods inherited from scala.swing.Frame +
+ scala.swing.Frame.title, scala.swing.Frame.title_=, scala.swing.Frame.contents_=, scala.swing.Frame.defaultButton, scala.swing.Frame.defaultButton_=, scala.swing.Frame.defaultButton_=, scala.swing.Frame.dispose, scala.swing.Frame.pack, scala.swing.Frame.menuBar, scala.swing.Frame.menuBar_=, scala.swing.Frame.setLocationRelativeTo, scala.swing.Frame.location_=, scala.swing.Frame.iconImage, scala.swing.Frame.iconImage_= +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.RootPanel +
+ scala.swing.RootPanel.contents +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals, scala.Proxy.toString +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + mainPanel : MainPanel +
+
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/MainPanel.html b/doc/graphyx/gui/MainPanel.html new file mode 100644 index 0000000..a02c4c1 --- /dev/null +++ b/doc/graphyx/gui/MainPanel.html @@ -0,0 +1,329 @@ + + + class MainPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class MainPanel +

+
+ [source: graphyx/gui/MainPanel.scala] +

+
+
+ + + class + MainPanel(container : Container) +
+
extends scala.swing.GridBagPanel
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + c + : scala.swing.GridBagPanel.Constraints + + +
+ val + + controlPanel + : ControlPanel + + +
+ val + + gravityPanel + : GravityPanel + + +
+ val + + infoPanel + : InfoPanel + + +
+ val + + optionsPanel + : OptionsPanel + + +
+ val + + shapeInfoPanel + : ShapeInfoPanel + + +
+ val + + splitter + : scala.swing.SplitPane + + +
+ val + + worldPanel + : WorldPanel + + +
+ + +
+ Values and Variables inherited from scala.swing.GridBagPanel +
+ scala.swing.GridBagPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + +
+ Methods inherited from scala.swing.GridBagPanel +
+ scala.swing.GridBagPanel.pair2Constraints, scala.swing.GridBagPanel.constraintsFor, scala.swing.GridBagPanel.areValid, scala.swing.GridBagPanel.add +
+ + +
+ Methods inherited from scala.swing.LayoutContainer +
+ scala.swing.LayoutContainer.layout +
+ + +
+ Methods inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper.contents +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + c : scala.swing.GridBagPanel.Constraints +
+
+

+
+
+ + + val + worldPanel : WorldPanel +
+
+

+
+
+ + + val + controlPanel : ControlPanel +
+
+

+
+
+ + + val + infoPanel : InfoPanel +
+
+

+
+
+ + + val + optionsPanel : OptionsPanel +
+
+

+
+
+ + + val + shapeInfoPanel : ShapeInfoPanel +
+
+

+
+
+ + + val + gravityPanel : GravityPanel +
+
+

+
+
+ + + val + splitter : scala.swing.SplitPane +
+
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/OptionsPanel.html b/doc/graphyx/gui/OptionsPanel.html new file mode 100644 index 0000000..b4f3ec6 --- /dev/null +++ b/doc/graphyx/gui/OptionsPanel.html @@ -0,0 +1,625 @@ + + + class OptionsPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class OptionsPanel +

+
+ [source: graphyx/gui/OptionsPanel.scala] +

+
+
+ + + class + OptionsPanel(container : Container) +
+
extends scala.swing.GridPanel
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + chckCD + : scala.swing.CheckBox + + +
+ val + + chckDrawAABBs + : scala.swing.CheckBox + + +
+ val + + chckDrawBodies + : scala.swing.CheckBox + + +
+ val + + chckDrawCollisions + : scala.swing.CheckBox + + +
+ val + + chckDrawJoints + : scala.swing.CheckBox + + +
+ val + + chckDrawPairs + : scala.swing.CheckBox + + +
+ val + + chckDrawShapes + : scala.swing.CheckBox + + +
+ val + + chckPC + : scala.swing.CheckBox + + +
+ val + + components + : scala.List[scala.swing.Component] + + +
+ val + + lblCD + : scala.swing.Label + + +
+ val + + lblDraw + : scala.swing.Label + + +
+ val + + lblDrawAABBs + : scala.swing.Label + + +
+ val + + lblDrawBodies + : scala.swing.Label + + +
+ val + + lblDrawCollisions + : scala.swing.Label + + +
+ val + + lblDrawJoints + : scala.swing.Label + + +
+ val + + lblDrawPairs + : scala.swing.Label + + +
+ val + + lblDrawShapes + : scala.swing.Label + + +
+ val + + lblIterations + : scala.swing.Label + + +
+ val + + lblPC + : scala.swing.Label + + +
+ val + + lblTimeStep + : scala.swing.Label + + +
+ val + + txtIterations + : scala.swing.TextField + + +
+ val + + txtTimeStep + : scala.swing.TextField + + +
+ + +
+ Values and Variables inherited from scala.swing.GridPanel +
+ scala.swing.GridPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.SequentialContainer.Wrapper +
+ scala.swing.SequentialContainer.Wrapper.contents +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + + + + +
Method Summary
+ def + + update + : Unit + + +
+ + +
+ Methods inherited from scala.swing.GridPanel +
+ scala.swing.GridPanel.rows, scala.swing.GridPanel.rows_=, scala.swing.GridPanel.columns, scala.swing.GridPanel.columns_=, scala.swing.GridPanel.vGap, scala.swing.GridPanel.vGap_=, scala.swing.GridPanel.hGap, scala.swing.GridPanel.hGap_= +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + lblTimeStep : scala.swing.Label +
+
+

+
+
+ + + val + txtTimeStep : scala.swing.TextField +
+
+

+
+
+ + + val + lblIterations : scala.swing.Label +
+
+

+
+
+ + + val + txtIterations : scala.swing.TextField +
+
+

+
+
+ + + val + lblCD : scala.swing.Label +
+
+

+
+
+ + + val + chckCD : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblPC : scala.swing.Label +
+
+

+
+
+ + + val + chckPC : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblDraw : scala.swing.Label +
+
+

+
+
+ + + val + lblDrawBodies : scala.swing.Label +
+
+

+
+
+ + + val + chckDrawBodies : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblDrawShapes : scala.swing.Label +
+
+

+
+
+ + + val + chckDrawShapes : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblDrawJoints : scala.swing.Label +
+
+

+
+
+ + + val + chckDrawJoints : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblDrawAABBs : scala.swing.Label +
+
+

+
+
+ + + val + chckDrawAABBs : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblDrawPairs : scala.swing.Label +
+
+

+
+
+ + + val + chckDrawPairs : scala.swing.CheckBox +
+
+

+
+
+ + + val + lblDrawCollisions : scala.swing.Label +
+
+

+
+
+ + + val + chckDrawCollisions : scala.swing.CheckBox +
+
+

+
+
+ + + val + components : scala.List[scala.swing.Component] +
+
+

+ + +
Method Details
+
+ + + def + update : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/PopupMenu.html b/doc/graphyx/gui/PopupMenu.html new file mode 100644 index 0000000..96c8a2e --- /dev/null +++ b/doc/graphyx/gui/PopupMenu.html @@ -0,0 +1,207 @@ + + + class PopupMenu in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class PopupMenu +

+
+ [source: graphyx/gui/PopupMenu.scala] +

+
+
+ + + class + PopupMenu +
+
extends scala.swing.Component
+
+
Direct Known Subclasses:
+
BodyPopup
+

+ + + + + + + + +
Value Summary
+ override lazy val + + peer + : javax.swing.JPopupMenu + + +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + + + + + + + + +
Method Summary
+ def + + add + (item : scala.swing.MenuItem) : Unit + + +
+ def + + setVisible + (visible : Boolean) : Unit + + +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + override + lazy val + peer : javax.swing.JPopupMenu +
+
+
+
+ Overrides +
+
+ scala.swing.Component.scala.swing.Component.peer +
+

+ + +
Method Details
+
+ + + def + add(item : scala.swing.MenuItem) : Unit +
+
+

+
+
+ + + def + setVisible(visible : Boolean) : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/ShapeInfoPanel.html b/doc/graphyx/gui/ShapeInfoPanel.html new file mode 100644 index 0000000..452968a --- /dev/null +++ b/doc/graphyx/gui/ShapeInfoPanel.html @@ -0,0 +1,262 @@ + + + class ShapeInfoPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class ShapeInfoPanel +

+
+ [source: graphyx/gui/ShapeInfoPanel.scala] +

+
+
+ + + class + ShapeInfoPanel(container : Container) +
+
extends scala.swing.GridPanel
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + components + : scala.List[scala.swing.Label] + + +
+ val + + lblBody + : scala.swing.Label + + +
+ val + + lblShape + : scala.swing.Label + + +
+ val + + lblValBody + : scala.swing.Label + + +
+ val + + lblValShape + : scala.swing.Label + + +
+ + +
+ Values and Variables inherited from scala.swing.GridPanel +
+ scala.swing.GridPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.SequentialContainer.Wrapper +
+ scala.swing.SequentialContainer.Wrapper.contents +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + +
+ Methods inherited from scala.swing.GridPanel +
+ scala.swing.GridPanel.rows, scala.swing.GridPanel.rows_=, scala.swing.GridPanel.columns, scala.swing.GridPanel.columns_=, scala.swing.GridPanel.vGap, scala.swing.GridPanel.vGap_=, scala.swing.GridPanel.hGap, scala.swing.GridPanel.hGap_= +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paintComponent, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + lblBody : scala.swing.Label +
+
+

+
+
+ + + val + lblValBody : scala.swing.Label +
+
+

+
+
+ + + val + lblShape : scala.swing.Label +
+
+

+
+
+ + + val + lblValShape : scala.swing.Label +
+
+

+
+
+ + + val + components : scala.List[scala.swing.Label] +
+
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/gui/WorldPanel.html b/doc/graphyx/gui/WorldPanel.html new file mode 100644 index 0000000..959812e --- /dev/null +++ b/doc/graphyx/gui/WorldPanel.html @@ -0,0 +1,638 @@ + + + class WorldPanel in graphyx.gui + + + + + + + + + + + +
+ graphyx.gui +

+ class WorldPanel +

+
+ [source: graphyx/gui/WorldPanel.scala] +

+
+
+ + + class + WorldPanel(container : Container) +
+
extends scala.swing.BoxPanel
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ var + + drawAABBs + : Boolean + + +
+ var + + drawBodies + : Boolean + + +
+ var + + drawCollisions + : Boolean + + +
+ var + + drawJoints + : Boolean + + +
+ var + + drawPairs + : Boolean + + +
+ var + + drawShapes + : Boolean + + +
+ var + + endPoint + : java.awt.Point + + +
+ var + + grabbedBody + : scala.Option[GrabbedBody] + + +
+ val + + lblBody + : scala.swing.Label + + +
+ var + + mousePressed + : Boolean + + +
+ var + + offset + : Vector2D + + +
+ val + + popup + : BodyPopup + + +
+ val + + ppm + : Double + + +
+ var + + scale + : Double + + +
+ var + + startPoint + : java.awt.Point + + +
+ + +
+ Values and Variables inherited from scala.swing.BoxPanel +
+ scala.swing.BoxPanel.peer +
+ + +
+ Values and Variables inherited from scala.swing.SequentialContainer.Wrapper +
+ scala.swing.SequentialContainer.Wrapper.contents +
+ + +
+ Values and Variables inherited from scala.swing.Container.Wrapper +
+ scala.swing.Container.Wrapper._contents +
+ + +
+ Values and Variables inherited from scala.swing.Component +
+ scala.swing.Component.initP +
+ + +
+ Values and Variables inherited from scala.swing.Publisher +
+ scala.swing.Publisher.listeners +
+ + +
+ Values and Variables inherited from scala.swing.Reactor +
+ scala.swing.Reactor.reactions +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + drawAxes + (g : java.awt.Graphics) : Unit + + +
+ def + + drawParts + (parts : scala.Iterable[Drawable], g : java.awt.Graphics) : Unit + + +
+ def + + getBody + (p : Vector2D) : scala.Option[Body] + + +
+ def + + grab + (b : Body, p : Vector2D) : Unit + + +
+ override def + + paintComponent + (g : java.awt.Graphics) : Unit + + +
+ implicit def + + point2Vector + (p : java.awt.Point) : Vector2D + + +
+ def + + release + : Unit + + +
+ def + + scene + : Scene + + +
+ def + + update + : Unit + + +
+ + +
+ Methods inherited from scala.swing.Component +
+ scala.swing.Component.xLayoutAlignment, scala.swing.Component.xLayoutAlignment_=, scala.swing.Component.yLayoutAlignment, scala.swing.Component.yLayoutAlignment_=, scala.swing.Component.border, scala.swing.Component.border_=, scala.swing.Component.opaque, scala.swing.Component.opaque_=, scala.swing.Component.enabled, scala.swing.Component.enabled_=, scala.swing.Component.tooltip, scala.swing.Component.tooltip_=, scala.swing.Component.inputVerifier, scala.swing.Component.inputVerifier_=, scala.swing.Component.revalidate, scala.swing.Component.requestFocus, scala.swing.Component.paint, scala.swing.Component.toString +
+ + +
+ Methods inherited from scala.swing.Publisher +
+ scala.swing.Publisher.subscribe, scala.swing.Publisher.unsubscribe, scala.swing.Publisher.publish +
+ + +
+ Methods inherited from scala.swing.Reactor +
+ scala.swing.Reactor.listenTo, scala.swing.Reactor.deafTo +
+ + +
+ Methods inherited from scala.swing.UIElement +
+ scala.swing.UIElement.self, scala.swing.UIElement.foreground, scala.swing.UIElement.foreground_=, scala.swing.UIElement.background, scala.swing.UIElement.background_=, scala.swing.UIElement.minimumSize, scala.swing.UIElement.minimumSize_=, scala.swing.UIElement.maximumSize, scala.swing.UIElement.maximumSize_=, scala.swing.UIElement.preferredSize, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.preferredSize_=, scala.swing.UIElement.font, scala.swing.UIElement.font_=, scala.swing.UIElement.locationOnScreen, scala.swing.UIElement.location, scala.swing.UIElement.bounds, scala.swing.UIElement.size, scala.swing.UIElement.size_=, scala.swing.UIElement.size_=, scala.swing.UIElement.locale, scala.swing.UIElement.toolkit, scala.swing.UIElement.cursor, scala.swing.UIElement.cursor_=, scala.swing.UIElement.visible, scala.swing.UIElement.visible_=, scala.swing.UIElement.showing, scala.swing.UIElement.repaint +
+ + +
+ Methods inherited from scala.Proxy +
+ scala.Proxy.hashCode, scala.Proxy.equals +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + lblBody : scala.swing.Label +
+
+

+
+
+ + + val + popup : BodyPopup +
+
+

+
+
+ + + val + ppm : Double +
+
+

+
+
+ + + var + scale : Double +
+
+

+
+
+ + + var + offset : Vector2D +
+
+

+
+
+ + + var + drawBodies : Boolean +
+
+

+
+
+ + + var + drawShapes : Boolean +
+
+

+
+
+ + + var + drawJoints : Boolean +
+
+

+
+
+ + + var + drawAABBs : Boolean +
+
+

+
+
+ + + var + drawPairs : Boolean +
+
+

+
+
+ + + var + drawCollisions : Boolean +
+
+

+
+
+ + + var + mousePressed : Boolean +
+
+

+
+
+ + + var + startPoint : java.awt.Point +
+
+

+
+
+ + + var + endPoint : java.awt.Point +
+
+

+
+
+ + + var + grabbedBody : scala.Option[GrabbedBody] +
+
+

+ + +
Method Details
+
+ + implicit + def + point2Vector(p : java.awt.Point) : Vector2D +
+
+

+
+
+ + + def + scene : Scene +
+
+

+
+
+ + + def + update : Unit +
+
+

+
+
+ + override + def + paintComponent(g : java.awt.Graphics) : Unit +
+
+

+
+
+ + + def + drawAxes(g : java.awt.Graphics) : Unit +
+
+

+
+
+ + + def + drawParts(parts : scala.Iterable[Drawable], g : java.awt.Graphics) : Unit +
+
+

+
+
+ + + def + getBody(p : Vector2D) : scala.Option[Body] +
+
+

+
+
+ + + def + grab(b : Body, p : Vector2D) : Unit +
+
+

+
+
+ + + def + release : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/graphyx/tests$content.html b/doc/graphyx/tests$content.html new file mode 100644 index 0000000..c136e55 --- /dev/null +++ b/doc/graphyx/tests$content.html @@ -0,0 +1,188 @@ + + + All classes and objects in graphyx.tests + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + +
Class Summary
+ trait + + Test + extends AnyRef + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Object Summary
+ object + + BallStack + extends Test + + +
+ object + + Chain + extends Test + + +
+ object + + CompositeShape + extends Test + + +
+ object + + Cup + extends Test + + +
+ object + + EmptyTest + extends Test + + +
+ object + + Friction + extends Test + + +
+ object + + Friction2 + extends Test + + +
+ object + + General1 + extends Test + + +
+ object + + General2 + extends Test + + +
+ object + + Joints1 + extends Test + + +
+ object + + Joints2 + extends Test + + +
+ object + + Net + extends Test + + +
+ object + + RagdollTest + extends Test + + +
+ object + + Restitution + extends Test + + +
+ object + + Stacking + extends Test + + +
+ \ No newline at end of file diff --git a/doc/graphyx/tests$package.html b/doc/graphyx/tests$package.html new file mode 100644 index 0000000..b3a9adc --- /dev/null +++ b/doc/graphyx/tests$package.html @@ -0,0 +1,30 @@ + + + List of classes and objects in package graphyx.tests + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/graphyx/tests/BallStack$object.html b/doc/graphyx/tests/BallStack$object.html new file mode 100644 index 0000000..092ce96 --- /dev/null +++ b/doc/graphyx/tests/BallStack$object.html @@ -0,0 +1,169 @@ + + + object BallStack in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object BallStack +

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

+
+
+ + + object + BallStack +
+
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 + world : World +
+
+
+
+ Overrides +
+
+ Test.world +
+

+
+
+ + + val + title : java.lang.String +
+
+
+
+ Overrides +
+
+ Test.title +
+

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

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

+ object Chain +

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

+
+
+ + + object + Chain +
+
extends Test
+
+ + + + + + + + + + + + +
Value Summary
+ override 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
+
+ + override + 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/CompositeShape$object.html b/doc/graphyx/tests/CompositeShape$object.html new file mode 100644 index 0000000..2eb9a85 --- /dev/null +++ b/doc/graphyx/tests/CompositeShape$object.html @@ -0,0 +1,169 @@ + + + object CompositeShape in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object CompositeShape +

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

+
+
+ + + object + CompositeShape +
+
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/Cup$object.html b/doc/graphyx/tests/Cup$object.html new file mode 100644 index 0000000..b3c46a8 --- /dev/null +++ b/doc/graphyx/tests/Cup$object.html @@ -0,0 +1,169 @@ + + + object Cup in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Cup +

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

+
+
+ + + object + Cup +
+
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/EmptyTest$object.html b/doc/graphyx/tests/EmptyTest$object.html new file mode 100644 index 0000000..ff540a7 --- /dev/null +++ b/doc/graphyx/tests/EmptyTest$object.html @@ -0,0 +1,169 @@ + + + object EmptyTest in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object EmptyTest +

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

+
+
+ + + object + EmptyTest +
+
extends Test
+
+ + + + + + + + + + + + +
Value Summary
+ override 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
+
+ + override + 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/Friction$object.html b/doc/graphyx/tests/Friction$object.html new file mode 100644 index 0000000..7b3b691 --- /dev/null +++ b/doc/graphyx/tests/Friction$object.html @@ -0,0 +1,256 @@ + + + object Friction in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Friction +

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

+
+
+ + + object + Friction +
+
extends Test
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ var + + r1 + : RevoluteJoint + + +
+ var + + r2 + : RevoluteJoint + + +
+ var + + r3 + : RevoluteJoint + + +
+ 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 + r1 : RevoluteJoint +
+
+

+
+
+ + + var + r2 : RevoluteJoint +
+
+

+
+
+ + + var + r3 : RevoluteJoint +
+
+

+ + +
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/Friction2$object.html b/doc/graphyx/tests/Friction2$object.html new file mode 100644 index 0000000..427e527 --- /dev/null +++ b/doc/graphyx/tests/Friction2$object.html @@ -0,0 +1,169 @@ + + + object Friction2 in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Friction2 +

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

+
+
+ + + object + Friction2 +
+
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/General1$object.html b/doc/graphyx/tests/General1$object.html new file mode 100644 index 0000000..2484144 --- /dev/null +++ b/doc/graphyx/tests/General1$object.html @@ -0,0 +1,216 @@ + + + object General1 in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object General1 +

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

+
+
+ + + object + General1 +
+
extends Test
+
+ + + + + + + + + + + + +
Value Summary
+ override val + + title + : java.lang.String + + +
+ val + + world + : World + + +
+ + + + + + + + + + + + + + +
Method Summary
+ def + + blastBomb + : Unit + + +
+ 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
+
+ + override + val + title : java.lang.String +
+
+
+
+ Overrides +
+
+ Test.title +
+

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

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

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

+
+
+ + + def + blastBomb : Unit +
+
+

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

+ object General2 +

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

+
+
+ + + object + General2 +
+
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/Joints1$object.html b/doc/graphyx/tests/Joints1$object.html new file mode 100644 index 0000000..808acb0 --- /dev/null +++ b/doc/graphyx/tests/Joints1$object.html @@ -0,0 +1,169 @@ + + + object Joints1 in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Joints1 +

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

+
+
+ + + object + Joints1 +
+
extends Test
+
+ + + + + + + + + + + + +
Value Summary
+ override 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
+
+ + override + 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/Joints2$object.html b/doc/graphyx/tests/Joints2$object.html new file mode 100644 index 0000000..b141a42 --- /dev/null +++ b/doc/graphyx/tests/Joints2$object.html @@ -0,0 +1,169 @@ + + + object Joints2 in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Joints2 +

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

+
+
+ + + object + Joints2 +
+
extends Test
+
+ + + + + + + + + + + + +
Value Summary
+ override 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
+
+ + override + 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/Net$object.html b/doc/graphyx/tests/Net$object.html new file mode 100644 index 0000000..3bf8f69 --- /dev/null +++ b/doc/graphyx/tests/Net$object.html @@ -0,0 +1,169 @@ + + + object Net in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Net +

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

+
+
+ + + object + Net +
+
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/RagdollTest$object.html b/doc/graphyx/tests/RagdollTest$object.html new file mode 100644 index 0000000..6457166 --- /dev/null +++ b/doc/graphyx/tests/RagdollTest$object.html @@ -0,0 +1,169 @@ + + + object RagdollTest in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object RagdollTest +

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

+
+
+ + + object + RagdollTest +
+
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/Restitution$object.html b/doc/graphyx/tests/Restitution$object.html new file mode 100644 index 0000000..29c62a6 --- /dev/null +++ b/doc/graphyx/tests/Restitution$object.html @@ -0,0 +1,169 @@ + + + object Restitution in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Restitution +

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

+
+
+ + + object + Restitution +
+
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/Stacking$object.html b/doc/graphyx/tests/Stacking$object.html new file mode 100644 index 0000000..c84e2c0 --- /dev/null +++ b/doc/graphyx/tests/Stacking$object.html @@ -0,0 +1,169 @@ + + + object Stacking in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ object Stacking +

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

+
+
+ + + object + Stacking +
+
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 + world : World +
+
+
+
+ Overrides +
+
+ Test.world +
+

+
+
+ + + val + title : java.lang.String +
+
+
+
+ Overrides +
+
+ Test.title +
+

+ + +
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 new file mode 100644 index 0000000..78cec07 --- /dev/null +++ b/doc/graphyx/tests/Test.html @@ -0,0 +1,190 @@ + + + trait Test in graphyx.tests + + + + + + + + + + + +
+ graphyx.tests +

+ trait Test +

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

+
+
+ + + trait + Test +
+
extends AnyRef
+
+
Direct Known Subclasses:
+
BallStack, Chain, CompositeShape, Cup, EmptyTest, Friction, Friction2, General1, General2, Joints1, Joints2, Net, RagdollTest, Restitution, Stacking
+

+ + + + + + + + + + + + +
Value Summary
+ abstract val + + title + : java.lang.String + + +
+ abstract val + + world + : World + + +
+ + + + + + + + + + + + + + +
Method Summary
+ def + + fireEvent + : Unit + + +
+ abstract def + + init + : Unit + + +
+ override def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ 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
+
+ + abstract + val + world : World +
+
+

+
+
+ + abstract + val + title : java.lang.String +
+
+

+ + +
Method Details
+
+ + abstract + def + init : Unit +
+
+

+
+
+ + + def + fireEvent : Unit +
+
+

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

+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..33257d7 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,14 @@ + + + SiMS + + + + + + + + + + + \ No newline at end of file diff --git a/doc/modules.html b/doc/modules.html new file mode 100644 index 0000000..8edb9c7 --- /dev/null +++ b/doc/modules.html @@ -0,0 +1,34 @@ + + + List of all packages + + +
+
SiMS
+ All objects and classes +
Packages
+ \ No newline at end of file diff --git a/doc/nav-classes.html b/doc/nav-classes.html new file mode 100644 index 0000000..505f7c6 --- /dev/null +++ b/doc/nav-classes.html @@ -0,0 +1,27 @@ + + + navigation + + +
+ + A +B +C +D +E +G +I +L +M +P +R +T +V +X + +
+ \ No newline at end of file diff --git a/doc/root-content.html b/doc/root-content.html new file mode 100644 index 0000000..e5c8a85 --- /dev/null +++ b/doc/root-content.html @@ -0,0 +1,69 @@ + + + All Packages + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS


+ + + + + + + + + + + + + +
Package Summary
+ package + graphyx + +
+ package + graphyx.actors + +
+ package + graphyx.graphics + +
+ package + graphyx.gui + +
+ package + graphyx.tests + +
+ package + sims.collision + +
+ package + sims.dynamics + +
+ package + sims.dynamics.joints + +
+ package + sims.geometry + +
+ package + sims.math + +
+ package + sims.prefabs + +
+ package + sims.util + +
+ \ No newline at end of file diff --git a/doc/script.js b/doc/script.js new file mode 100644 index 0000000..9728804 --- /dev/null +++ b/doc/script.js @@ -0,0 +1,112 @@ + + diff --git a/doc/sims/collision$content.html b/doc/sims/collision$content.html new file mode 100644 index 0000000..d34c535 --- /dev/null +++ b/doc/sims/collision$content.html @@ -0,0 +1,191 @@ + + + All classes and objects in sims.collision + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ case class + + 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.
+
+ case class + + CircleCollision + (val c1 : Circle, val c2 : Circle) extends Collision with scala.Product + +
Kollision zwischen zwei Kreisen.
+
+ abstract class + + Collision + extends Constraint with AnyRef + +
Kollisionen zwischen zwei Formen enthalten Methoden zur Berrechnen der Kollisionsreaktion.
+
+ abstract class + + Detector + extends AnyRef + +
Eine Welt ermittelt ihre Kollisionen durch konkrete Implementierungen dieser Klasse.
+
+ class + + GridDetector + (val override world : World) extends Detector + +
Eine konkrete Implementierung von Detector. GridDetector ermittelt + alle Kollisionen mit einem Gittersystem.
+
+ case class + + Overlap + (val poly : ConvexPolygon, val sideNum : Int, val overlap : Double) extends scala.Product + + +
+ case class + + Pair + (val s1 : Shape, val s2 : Shape) extends (Shape, Shape) + +
Formenpaar.
+
+ case class + + PolyCircleCollision + (val p : ConvexPolygon, val c : Circle) extends Collision with scala.Product + +
Kollision zwischen einem konvexen Polygon und einem Kreis.
+
+ case class + + PolyCollision + (val p1 : ConvexPolygon, val p2 : ConvexPolygon) extends Collision with scala.Product + +
Kollision zwischen zwei konvexen Polygonen.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Object Summary
+ object + + AABB + extends (Vector2D, Vector2D) => AABB + + +
+ object + + CircleCollision + extends (Circle, Circle) => CircleCollision + + +
+ object + + Collision + extends AnyRef + + +
+ object + + Overlap + extends (ConvexPolygon, Int, Double) => Overlap + + +
+ object + + Pair + extends (Shape, Shape) => Pair + + +
+ object + + PolyCircleCollision + extends (ConvexPolygon, Circle) => PolyCircleCollision + + +
+ object + + PolyCollision + extends (ConvexPolygon, ConvexPolygon) => PolyCollision + + +
+ \ No newline at end of file diff --git a/doc/sims/collision$package.html b/doc/sims/collision$package.html new file mode 100644 index 0000000..0871d60 --- /dev/null +++ b/doc/sims/collision$package.html @@ -0,0 +1,30 @@ + + + List of classes and objects in package sims.collision + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/sims/collision/AABB$object.html b/doc/sims/collision/AABB$object.html new file mode 100644 index 0000000..6d5d29d --- /dev/null +++ b/doc/sims/collision/AABB$object.html @@ -0,0 +1,82 @@ + + + object AABB in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object AABB +

+
+ [source: sims/collision/AABB.scala] +

+
+
+ + + object + AABB +
+
extends (Vector2D, Vector2D) => AABB
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/collision/AABB.html b/doc/sims/collision/AABB.html new file mode 100644 index 0000000..d4759f1 --- /dev/null +++ b/doc/sims/collision/AABB.html @@ -0,0 +1,309 @@ + + + class AABB in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class AABB +

+
+ [source: sims/collision/AABB.scala] +

+
+
+ + case + class + 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.
+
+ Parameters
minVertex - Ortsvektor der minimalen Ecke des AABBs
maxVertex - Ortsvektor der maximalen Ecke des AABBs
+
+
Direct Known Subclasses:
+
GraphicalAABB
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ def + + overlaps + (box : AABB) : Boolean + +
Ueberprueft ob dieses AABB sich mit dem AABB box ueberschneidet.
+
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + + def + overlaps(box : AABB) : Boolean +
+
+
+
Ueberprueft ob dieses AABB sich mit dem AABB box ueberschneidet.
+
+ Parameters
box - das mit diesem auf Ueberschneidung zu ueberpruefende AABB
+
+
+
+ + 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/collision/CircleCollision$object.html b/doc/sims/collision/CircleCollision$object.html new file mode 100644 index 0000000..c175c15 --- /dev/null +++ b/doc/sims/collision/CircleCollision$object.html @@ -0,0 +1,82 @@ + + + object CircleCollision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object CircleCollision +

+
+ [source: sims/collision/CircleCollision.scala] +

+
+
+ + + object + CircleCollision +
+
extends (Circle, Circle) => CircleCollision
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/collision/CircleCollision.html b/doc/sims/collision/CircleCollision.html new file mode 100644 index 0000000..d305be6 --- /dev/null +++ b/doc/sims/collision/CircleCollision.html @@ -0,0 +1,409 @@ + + + class CircleCollision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class CircleCollision +

+
+ [source: sims/collision/CircleCollision.scala] +

+
+
+ + case + class + CircleCollision(val c1 : Circle, val c2 : Circle) +
+
extends Collision with scala.Product
+
+
Kollision zwischen zwei Kreisen.
+
+ + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + normal + : Vector2D + +
Normalenvektor zu der Kollisionsebene.
+
+ val + + points + : scala.List[Vector2D] + +
Kollisionspunkte.
+
+ val + + shape1 + : Circle + +
Erste Kollisionsform (Referenz).
+
+ val + + shape2 + : Circle + +
Zweite Kollisionsform (eindringend).
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ + +
+ Methods inherited from Collision +
+ correctVelocity, correctFriction, correctPosition +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + shape1 : Circle +
+
+
+
Erste Kollisionsform (Referenz).
+
+
+
+ Overrides +
+
+ Collision.shape1 +
+

+
+
+ + + val + shape2 : Circle +
+
+
+
Zweite Kollisionsform (eindringend).
+
+
+
+ Overrides +
+
+ Collision.shape2 +
+

+
+
+ + + val + normal : Vector2D +
+
+
+
Normalenvektor zu der Kollisionsebene.
+
+
+
+ Overrides +
+
+ Collision.normal +
+

+
+
+ + + val + points : scala.List[Vector2D] +
+
+
+
Kollisionspunkte.
+
+
+
+ Overrides +
+
+ Collision.points +
+

+ + +
Method Details
+
+ + 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/collision/Collision$object.html b/doc/sims/collision/Collision$object.html new file mode 100644 index 0000000..de0b9de --- /dev/null +++ b/doc/sims/collision/Collision$object.html @@ -0,0 +1,101 @@ + + + object Collision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object Collision +

+
+ [source: sims/collision/Collision.scala] +

+
+
+ + + object + Collision +
+
extends AnyRef
+
+ + + + + + + + +
Value Summary
+ val + + ToleratedOverlap + : Double + +
Erlaubte Ueberlappung.
+
+ + + +
+ 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 + ToleratedOverlap : Double +
+
+
+
Erlaubte Ueberlappung.
+
+
+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/collision/Collision.html b/doc/sims/collision/Collision.html new file mode 100644 index 0000000..8b97de9 --- /dev/null +++ b/doc/sims/collision/Collision.html @@ -0,0 +1,259 @@ + + + class Collision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class Collision +

+
+ [source: sims/collision/Collision.scala] +

+
+
+ + abstract + class + Collision +
+
extends Constraint with AnyRef
+
+
Kollisionen zwischen zwei Formen enthalten Methoden zur Berrechnen der Kollisionsreaktion.
+
+
+
Direct Known Subclasses:
+
CircleCollision, PolyCircleCollision, PolyCollision
+

+ + + + + + + + + + + + + + + + + + + + +
Value Summary
+ abstract val + + normal + : Vector2D + +
Normalenvektor zu der Kollisionsebene.
+
+ abstract val + + points + : scala.Iterable[Vector2D] + +
Kollisionspunkte.
+
+ abstract val + + shape1 + : Shape + +
Erste Kollisionsform (Referenz).
+
+ abstract val + + shape2 + : Shape + +
Zweite Kollisionsform (eindringend).
+
+ + + + + + + + + + + + + + +
Method Summary
+ def + + correctFriction + (point : Vector2D, normalForce : Double, h : Double) : Unit + + +
+ def + + correctPosition + (h : Double) : Unit + +
Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
+
+ def + + correctVelocity + (h : Double) : Unit + +
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
+
+ + +
+ 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
+
+ + abstract + val + shape1 : Shape +
+
+
+
Erste Kollisionsform (Referenz).
+
+
+
+
+ + abstract + val + shape2 : Shape +
+
+
+
Zweite Kollisionsform (eindringend).
+
+
+
+
+ + abstract + val + points : scala.Iterable[Vector2D] +
+
+
+
Kollisionspunkte.
+
+
+
+
+ + abstract + val + normal : Vector2D +
+
+
+
Normalenvektor zu der Kollisionsebene.
+
+
+ + +
Method Details
+
+ + + def + correctVelocity(h : Double) : Unit +
+
+
+
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
+
+
+
+ Overrides +
+
+ Constraint.correctVelocity +
+

+
+
+ + + def + correctFriction(point : Vector2D, normalForce : Double, h : Double) : Unit +
+
+

+
+
+ + + def + correctPosition(h : Double) : Unit +
+
+
+
Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
+
+
+
+ Overrides +
+
+ Constraint.correctPosition +
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/collision/Detector.html b/doc/sims/collision/Detector.html new file mode 100644 index 0000000..7aaa1e4 --- /dev/null +++ b/doc/sims/collision/Detector.html @@ -0,0 +1,133 @@ + + + class Detector in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class Detector +

+
+ [source: sims/collision/Detector.scala] +

+
+
+ + abstract + class + Detector +
+
extends AnyRef
+
+
Eine Welt ermittelt ihre Kollisionen durch konkrete Implementierungen dieser Klasse.
+
+
+
Direct Known Subclasses:
+
GridDetector
+

+ + + + + + + + +
Value Summary
+ abstract val + + world + : World + +
Die Welt dessen Formen auf Kollisionen ueberprueft werden sollen.
+
+ + + + + + +
Method Summary
+ abstract def + + collisions + : scala.Seq[Collision] + +
Ergibt alle Kollisionen zwischen Formen der Welt world.
+
+ + +
+ 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
+
+ + abstract + val + world : World +
+
+
+
Die Welt dessen Formen auf Kollisionen ueberprueft werden sollen.
+
+
+ + +
Method Details
+
+ + abstract + def + collisions : scala.Seq[Collision] +
+
+
+
Ergibt alle Kollisionen zwischen Formen der Welt world.
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/collision/GridDetector.html b/doc/sims/collision/GridDetector.html new file mode 100644 index 0000000..43dc1f6 --- /dev/null +++ b/doc/sims/collision/GridDetector.html @@ -0,0 +1,311 @@ + + + class GridDetector in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class GridDetector +

+
+ [source: sims/collision/GridDetector.scala] +

+
+
+ + + class + GridDetector(val override world : World) +
+
extends Detector
+
+
Eine konkrete Implementierung von Detector. GridDetector ermittelt + alle Kollisionen mit einem Gittersystem.
+
+ + + + + + + + + + + + + + + + + +
Value Summary
+ val + + collisionMethods + : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Collision]] + +
Array von Kollisionsmethoden fuer Formenpaare.
+
+ val + + detectionMethods + : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Boolean]] + +
Array von Kollisionserkennungsmethoden fuer Formenpaare.
+
+ var + + gridSide + : Double + +
Breite und Hoehe einer Gitterzelle.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + colliding + (p : Pair) : Boolean + +
Gibt an, ob das Formenpaar p kollidiert.
+
+ def + + collidingPairs + : scala.Seq[Pair] + +
Ergibt alle kollidierenden Paare.
+
+ def + + collision + (p : Pair) : Collision + +
Gibt die Kollision des Formenpaares p zurueck.
+
+ def + + collisions + : scala.Seq[Collision] + +
Ergibt alle Kollisionen.
+
+ def + + getPairs + : scala.Seq[Pair] + +
Ergibt potenzielle Kollisionspaare der Welt world.
+
+ def + + pairs + : scala.Seq[Pair] + +
Alle potentiellen Kollisionspaare der Welt.
+
+ + +
+ 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 + detectionMethods : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Boolean]] +
+
+
+
Array von Kollisionserkennungsmethoden fuer Formenpaare.
+
+
+
+
+ + + val + collisionMethods : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Collision]] +
+
+
+
Array von Kollisionsmethoden fuer Formenpaare.
+
+
+
+
+ + + var + gridSide : Double +
+
+
+
Breite und Hoehe einer Gitterzelle.
+
+
+ + +
Method Details
+
+ + + def + colliding(p : Pair) : Boolean +
+
+
+
Gibt an, ob das Formenpaar p kollidiert.
+
+ Parameters
p - Formenpaar.
+
+
+
+ + + def + collision(p : Pair) : Collision +
+
+
+
Gibt die Kollision des Formenpaares p zurueck.
+
+ Parameters
p - Formenpaar.
+
+
+
+ + + def + getPairs : scala.Seq[Pair] +
+
+
+
Ergibt potenzielle Kollisionspaare der Welt world. +

+ Ein Kollisionspaar ist ein Paar aus zwei verschiedenen Formen, das folgenden Bedingungen unterliegt: +

    +
  • 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.
  • +
+
+
+
+
+ + + def + pairs : scala.Seq[Pair] +
+
+
+
Alle potentiellen Kollisionspaare der Welt.
+
+ See Also
getPairs
+
+
+
+ + + def + collidingPairs : scala.Seq[Pair] +
+
+
+
Ergibt alle kollidierenden Paare.
+
+
+
+
+ + + def + collisions : scala.Seq[Collision] +
+
+
+
Ergibt alle Kollisionen.
+
+
+
+ Overrides +
+
+ Detector.collisions +
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/collision/Overlap$object.html b/doc/sims/collision/Overlap$object.html new file mode 100644 index 0000000..0989c48 --- /dev/null +++ b/doc/sims/collision/Overlap$object.html @@ -0,0 +1,82 @@ + + + object Overlap in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object Overlap +

+
+ [source: sims/collision/Overlap.scala] +

+
+
+ + + object + Overlap +
+
extends (ConvexPolygon, Int, Double) => Overlap
+
+ + + + + + +
+ Methods inherited from scala.Function3 +
+ scala.Function3.toString, scala.Function3.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/collision/Overlap.html b/doc/sims/collision/Overlap.html new file mode 100644 index 0000000..f76df7e --- /dev/null +++ b/doc/sims/collision/Overlap.html @@ -0,0 +1,276 @@ + + + class Overlap in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class Overlap +

+
+ [source: sims/collision/Overlap.scala] +

+
+
+ + case + class + Overlap(val poly : ConvexPolygon, val sideNum : Int, val overlap : Double) +
+
extends scala.Product
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + 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/collision/Pair$object.html b/doc/sims/collision/Pair$object.html new file mode 100644 index 0000000..fab5d78 --- /dev/null +++ b/doc/sims/collision/Pair$object.html @@ -0,0 +1,82 @@ + + + object Pair in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object Pair +

+
+ [source: sims/collision/Pair.scala] +

+
+
+ + + object + Pair +
+
extends (Shape, Shape) => Pair
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/collision/Pair.html b/doc/sims/collision/Pair.html new file mode 100644 index 0000000..15b53bf --- /dev/null +++ b/doc/sims/collision/Pair.html @@ -0,0 +1,257 @@ + + + class Pair in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class Pair +

+
+ [source: sims/collision/Pair.scala] +

+
+
+ + case + class + Pair(val s1 : Shape, val s2 : Shape) +
+
extends (Shape, Shape)
+
+
Formenpaar.
+
+ + + + + + + +
Additional Constructor Summary
+ def + + this + (t : (Shape, Shape)) : Pair + + +
+ + + + +
+ Values and Variables inherited from scala.Tuple2 +
+ scala.Tuple2._1, scala.Tuple2._2 +
+ + + + + + + + + + + + + + +
Method Summary
+ override def + + equals + (other : 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 + + productPrefix + : java.lang.String + + +
+ + +
+ Methods inherited from scala.Tuple2 +
+ scala.Tuple2.toString, scala.Tuple2.swap +
+ + +
+ Methods inherited from scala.Product2 +
+ scala.Product2.productArity, scala.Product2.productElement +
+ + +
+ 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(t : (Shape, Shape)) : Pair +
+
+

+ + + + +
Method Details
+
+ + override + def + equals(other : 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.

+
+
+ Overrides +
+
+ scala.Tuple2.scala.Tuple2.equals +
+

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

+
+
+ Overrides +
+
+ scala.Tuple2.scala.Tuple2.hashCode +
+

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

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/collision/PolyCircleCollision$object.html b/doc/sims/collision/PolyCircleCollision$object.html new file mode 100644 index 0000000..7ccdcf3 --- /dev/null +++ b/doc/sims/collision/PolyCircleCollision$object.html @@ -0,0 +1,82 @@ + + + object PolyCircleCollision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object PolyCircleCollision +

+
+ [source: sims/collision/PolyCircleCollision.scala] +

+
+
+ + + object + PolyCircleCollision +
+
extends (ConvexPolygon, Circle) => PolyCircleCollision
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/collision/PolyCircleCollision.html b/doc/sims/collision/PolyCircleCollision.html new file mode 100644 index 0000000..eb30399 --- /dev/null +++ b/doc/sims/collision/PolyCircleCollision.html @@ -0,0 +1,409 @@ + + + class PolyCircleCollision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class PolyCircleCollision +

+
+ [source: sims/collision/PolyCircleCollision.scala] +

+
+
+ + case + class + PolyCircleCollision(val p : ConvexPolygon, val c : Circle) +
+
extends Collision with scala.Product
+
+
Kollision zwischen einem konvexen Polygon und einem Kreis.
+
+ + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + normal + : Vector2D + +
Normalenvektor zu der Kollisionsebene.
+
+ val + + points + : scala.List[Vector2D] + +
Kollisionspunkte.
+
+ val + + shape1 + : Shape + +
Erste Kollisionsform (Referenz).
+
+ val + + shape2 + : Circle + +
Zweite Kollisionsform (eindringend).
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ + +
+ Methods inherited from Collision +
+ correctVelocity, correctFriction, correctPosition +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + shape1 : Shape +
+
+
+
Erste Kollisionsform (Referenz).
+
+
+
+ Overrides +
+
+ Collision.shape1 +
+

+
+
+ + + val + shape2 : Circle +
+
+
+
Zweite Kollisionsform (eindringend).
+
+
+
+ Overrides +
+
+ Collision.shape2 +
+

+
+
+ + + val + normal : Vector2D +
+
+
+
Normalenvektor zu der Kollisionsebene.
+
+
+
+ Overrides +
+
+ Collision.normal +
+

+
+
+ + + val + points : scala.List[Vector2D] +
+
+
+
Kollisionspunkte.
+
+
+
+ Overrides +
+
+ Collision.points +
+

+ + +
Method Details
+
+ + 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/collision/PolyCollision$object.html b/doc/sims/collision/PolyCollision$object.html new file mode 100644 index 0000000..a9642ae --- /dev/null +++ b/doc/sims/collision/PolyCollision$object.html @@ -0,0 +1,82 @@ + + + object PolyCollision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ object PolyCollision +

+
+ [source: sims/collision/PolyCollision.scala] +

+
+
+ + + object + PolyCollision +
+
extends (ConvexPolygon, ConvexPolygon) => PolyCollision
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/collision/PolyCollision.html b/doc/sims/collision/PolyCollision.html new file mode 100644 index 0000000..dbfe30b --- /dev/null +++ b/doc/sims/collision/PolyCollision.html @@ -0,0 +1,469 @@ + + + class PolyCollision in sims.collision + + + + + + + + + + + +
+ sims.collision +

+ class PolyCollision +

+
+ [source: sims/collision/PolyCollision.scala] +

+
+
+ + case + class + PolyCollision(val p1 : ConvexPolygon, val p2 : ConvexPolygon) +
+
extends Collision with scala.Product
+
+
Kollision zwischen zwei konvexen Polygonen.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ var + + minOverlap + : Overlap + + +
+ lazy val + + normal + : Vector2D + +
Normalenvektor zu der Kollisionsebene.
+
+ lazy val + + overlaps + : scala.RandomAccessSeq[Overlap] + + +
+ lazy val + + points + : scala.Seq[Vector2D] + +
Kollisionspunkte.
+
+ lazy val + + shape1 + : Shape + +
Erste Kollisionsform (Referenz).
+
+ lazy val + + shape2 + : Shape + +
Zweite Kollisionsform (eindringend).
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ def + + overlap + (axis : Vector2D) : Double + + +
+ 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.
+
+ + +
+ Methods inherited from Collision +
+ correctVelocity, correctFriction, correctPosition +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + lazy val + overlaps : scala.RandomAccessSeq[Overlap] +
+
+

+
+
+ + + var + minOverlap : Overlap +
+
+

+
+
+ + + lazy val + shape1 : Shape +
+
+
+
Erste Kollisionsform (Referenz).
+
+
+
+ Overrides +
+
+ Collision.shape1 +
+

+
+
+ + + lazy val + shape2 : Shape +
+
+
+
Zweite Kollisionsform (eindringend).
+
+
+
+ Overrides +
+
+ Collision.shape2 +
+

+
+
+ + + lazy val + normal : Vector2D +
+
+
+
Normalenvektor zu der Kollisionsebene.
+
+
+
+ Overrides +
+
+ Collision.normal +
+

+
+
+ + + lazy val + points : scala.Seq[Vector2D] +
+
+
+
Kollisionspunkte.
+
+
+
+ Overrides +
+
+ Collision.points +
+

+ + +
Method Details
+
+ + + def + overlap(axis : Vector2D) : Double +
+
+

+
+
+ + 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$content.html b/doc/sims/dynamics$content.html new file mode 100644 index 0000000..256ead8 --- /dev/null +++ b/doc/sims/dynamics$content.html @@ -0,0 +1,146 @@ + + + All classes and objects in sims.dynamics + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ class + + 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...).
+
+ case class + + Circle + (val radius : Double, val density : Double) extends Shape with scala.Product + +
Circle ist die Definition eines Kreises.
+
+ trait + + 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.
+
+ case class + + Rectangle + (val halfWidth : Double, val halfHeight : Double, val density : Double) extends Shape with ConvexPolygon with scala.Product + +
Rechteck ist eine Art Polygon.
+
+ case class + + 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.
+
+ abstract class + + Shape + extends AnyRef + +
Eine abstrakte Form.
+
+ class + + World + extends AnyRef + +
Eine Welt enthaelt und Simuliert ein System aus Koerpern und Verbindungen.
+
+ + + + + + + + + + + + + + + + + + + + + + +
Object Summary
+ object + + Body + extends AnyRef + + +
+ object + + Circle + extends (Double, Double) => Circle + + +
+ object + + Rectangle + extends (Double, Double, Double) => Rectangle + + +
+ object + + RegularPolygon + extends (Int, Double, Double) => RegularPolygon + + +
+ object + + Shape + extends AnyRef + + +
+ \ No newline at end of file diff --git a/doc/sims/dynamics$package.html b/doc/sims/dynamics$package.html new file mode 100644 index 0000000..b2430c2 --- /dev/null +++ b/doc/sims/dynamics$package.html @@ -0,0 +1,26 @@ + + + List of classes and objects in package sims.dynamics + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/sims/dynamics/Body$object.html b/doc/sims/dynamics/Body$object.html new file mode 100644 index 0000000..fe5fec2 --- /dev/null +++ b/doc/sims/dynamics/Body$object.html @@ -0,0 +1,75 @@ + + + object Body in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ object Body +

+
+ [source: sims/dynamics/Body.scala] +

+
+
+ + + object + Body +
+
extends AnyRef
+
+ + + + + + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, 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/Body.html b/doc/sims/dynamics/Body.html new file mode 100644 index 0000000..20abf83 --- /dev/null +++ b/doc/sims/dynamics/Body.html @@ -0,0 +1,659 @@ + + + class Body in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ class Body +

+
+ [source: sims/dynamics/Body.scala] +

+
+
+ + + class + 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...).
+
+ Parameters
shps - zu dem Koerper gehoerende Formen.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ var + + angularVelocity + : Double + +
Winkelgeschwindigkeit dieses Koerpers.
+
+ var + + force + : Vector2D + +
Resultierende Kraft auf den Schwerpunkt dieses Koerpers.
+
+ var + + linearVelocity + : Vector2D + +
Lineargeschwindigkeit dieses Koerpers.
+
+ var + + monitor + : Boolean + +
Gibt an ob die Eigenschaften dieses Koerpers ueberwacht werden sollen.
+
+ val + + shapes + : scala.List[Shape] + +
Formen aus denen dieser Koerper besteht.
+
+ var + + torque + : Double + +
Resultierender Drehmoment zu dem Schwerpunkt dieses Koerpers.
+
+ val + + uid + : Int + +
Einzigartige Identifikationsnummer dieses Koerpers.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + I + : Double + +
Ergibt den Traegheitsmoment zu dem Schwerpunkt dieses Koerpers. Der Traegheitsmoment wird mit Hilfe des Steinerschen Satzes errechnet.
+
+ def + + ^ + (s : Shape) : Body + +
Erstellt einen neuen Koerper der zusaetzlich die Form s enthaelt.
+
+ def + + ^ + (b : Body) : Body + +
Erstellt einen neuen Koerper der zusaetzlich die Formen von dem Koerper b enthaelt.
+
+ def + + applyForce + (force : Vector2D, point : Vector2D) : Unit + +
Wendet eine Kraft auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses + Koerpers ueberprueft.
+
+ def + + applyForce + (force : Vector2D) : Unit + +
Wendet eine Kraft auf den Schwerpunkt dieses Koerpers an.
+
+ def + + 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.
+
+ def + + contains + (point : Vector2D) : Boolean + +
Ueberprueft ob der gegebene Punkt point sich in diesem Koerper befindet.
+
+ def + + fixed + : Boolean + +
Gibt an ob dieser Koerper fixiert ist.
+
+ def + + fixed_= + (value : Boolean) : Unit + +
Fixiert oder unfixiert diesen Koerper.
+
+ def + + mass + : Double + +
Ergibt die Masse dieses Koerpers. Die Masse ist gleich die Summe aller Massen seiner Formen.
+
+ def + + pos + : Vector2D + +
Ermittelt die Position dieses Koerpers. Die Position entspricht dem Schwerpunkt.
+
+ def + + pos_= + (newPos : Vector2D) : Unit + +
Setzt die Position dieses Koerpers und verschiebt dadurch die Positionen seiner Formen.
+
+ def + + rotation + : Double + +
Ergibt die aktuelle Rotation dieses Koerpers.
+
+ def + + rotation_= + (newRotation : Double) : Unit + +
Setzt die Rotation dieses Koerpers. Dazu werden auch die Positionen und Rotationen seiner Formen entsprechend veraendert.
+
+ override def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ def + + velocityOfPoint + (point : Vector2D) : Vector2D + +
Lineargeschwindigkeit des gegebenen Punktes auf diesem Koerper. In Weltkoordinaten.
+
+ + +
+ 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 + uid : Int +
+
+
+
Einzigartige Identifikationsnummer dieses Koerpers.
+
+
+
+
+ + + val + shapes : scala.List[Shape] +
+
+
+
Formen aus denen dieser Koerper besteht.
+
+
+
+
+ + + var + monitor : Boolean +
+
+
+
Gibt an ob die Eigenschaften dieses Koerpers ueberwacht werden sollen.
+
+ See Also
World#monitors
+
+
+
+ + + var + linearVelocity : Vector2D +
+
+
+
Lineargeschwindigkeit dieses Koerpers.
+
+
+
+
+ + + var + angularVelocity : Double +
+
+
+
Winkelgeschwindigkeit dieses Koerpers.
+
+
+
+
+ + + var + force : Vector2D +
+
+
+
Resultierende Kraft auf den Schwerpunkt dieses Koerpers.
+
+
+
+
+ + + var + torque : Double +
+
+
+
Resultierender Drehmoment zu dem Schwerpunkt dieses Koerpers.
+
+
+ + +
Method Details
+
+ + + def + fixed : Boolean +
+
+
+
Gibt an ob dieser Koerper fixiert ist.
+
+
+
+
+ + + def + fixed_=(value : Boolean) : Unit +
+
+
+
Fixiert oder unfixiert diesen Koerper.
+
+
+
+
+ + + def + pos : Vector2D +
+
+
+
Ermittelt die Position dieses Koerpers. Die Position entspricht dem Schwerpunkt.
+
+ Returns
Position dieses Koerpers
+
+
+
+ + + def + pos_=(newPos : Vector2D) : Unit +
+
+
+
Setzt die Position dieses Koerpers und verschiebt dadurch die Positionen seiner Formen.
+
+ Parameters
newPos - neue Position
+
+
+
+ + + def + rotation : Double +
+
+
+
Ergibt die aktuelle Rotation dieses Koerpers.
+
+ Returns
aktuelle Rotation dieses Koerpers
+
+
+
+ + + def + rotation_=(newRotation : Double) : Unit +
+
+
+
Setzt die Rotation dieses Koerpers. Dazu werden auch die Positionen und Rotationen seiner Formen entsprechend veraendert.
+
+ Parameters
r - neue Rotation
+
+
+
+ + + def + velocityOfPoint(point : Vector2D) : Vector2D +
+
+
+
Lineargeschwindigkeit des gegebenen Punktes auf diesem Koerper. In Weltkoordinaten.
+
+
+
+
+ + + def + mass : Double +
+
+
+
Ergibt die Masse dieses Koerpers. Die Masse ist gleich die Summe aller Massen seiner Formen.
+
+ Returns
Masse des Koerpers
+
+
+
+ + + def + I : Double +
+
+
+
Ergibt den Traegheitsmoment zu dem Schwerpunkt dieses Koerpers. Der Traegheitsmoment wird mit Hilfe des Steinerschen Satzes errechnet.
+
+ Returns
Traegheitsmoment relativ zu dem Schwerpunkt dieses Koerpers
+
+
+
+ + + def + applyForce(force : Vector2D) : Unit +
+
+
+
Wendet eine Kraft auf den Schwerpunkt dieses Koerpers an.
+
+ Parameters
force - anzuwendender Kraftvektor
+
+
+
+ + + def + applyForce(force : Vector2D, point : Vector2D) : Unit +
+
+
+
Wendet eine Kraft auf einen Punkt dieses Koerpers an. Achtung: der gegebene Punkt wird nicht auf angehoerigkeit dieses + Koerpers ueberprueft.
+
+ Parameters
force - anzuwendender Kraftvektor
point - Ortsvektor des Punktes auf den die Kraft wirken soll (gegeben in Weltkoordinaten).
+
+
+
+ + + def + applyImpulse(impulse : Vector2D) : Unit +
+
+
+
Wendet einen Impuls auf den Schwerpunkt dieses Koerpers an.
+
+ Parameters
impulse - anzuwendender Impulsvektor
+
+
+
+ + + def + 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.
+
+ Parameters
impulse - anzuwendender Impulsvektor
point - Ortsvektor des Punktes auf den der Impuls wirken soll (gegeben in Weltkoordinaten).
+
+
+
+ + + def + contains(point : Vector2D) : Boolean +
+
+
+
Ueberprueft ob der gegebene Punkt point sich in diesem Koerper befindet.
+
+
+
+
+ + 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.

+
+
+
+ + + def + ^(s : Shape) : Body +
+
+
+
Erstellt einen neuen Koerper der zusaetzlich die Form s enthaelt.
+
+ Parameters
s - zusaetzliche Form
+ Returns
neuer Koerper
+
+
+
+ + + def + ^(b : Body) : Body +
+
+
+
Erstellt einen neuen Koerper der zusaetzlich die Formen von dem Koerper b enthaelt.
+
+ Parameters
b - Koerper mit zusaetzlichen Formen
+ Returns
neuer Koerper
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/Circle$object.html b/doc/sims/dynamics/Circle$object.html new file mode 100644 index 0000000..086b684 --- /dev/null +++ b/doc/sims/dynamics/Circle$object.html @@ -0,0 +1,82 @@ + + + object Circle in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ object Circle +

+
+ [source: sims/dynamics/Circle.scala] +

+
+
+ + + object + Circle +
+
extends (Double, Double) => Circle
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/Circle.html b/doc/sims/dynamics/Circle.html new file mode 100644 index 0000000..d6807a8 --- /dev/null +++ b/doc/sims/dynamics/Circle.html @@ -0,0 +1,456 @@ + + + class Circle in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ class Circle +

+
+ [source: sims/dynamics/Circle.scala] +

+
+
+ + case + class + Circle(val radius : Double, val density : Double) +
+
extends Shape with scala.Product
+
+
Circle ist die Definition eines Kreises.
+
+ Parameters
radius - Radius dieses Kreises
density - Dichte dieses Kreises
+
+
Direct Known Subclasses:
+
GraphicalCircle
+

+ + + + + + + + + + + + +
Value Summary
+ val + + I + : Double + +
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ val + + volume + : Double + +
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+ + +
+ Values and Variables inherited from Shape +
+ uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + AABB + : AABB + +
Gibt das umfassende AABB dieser Form zurueck.
+
+ def + + contains + (point : Vector2D) : Boolean + +
Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
+
+ 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 + + +
+ def + + project + (axis : Vector2D) : Projection + +
Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den + Richtungsvektor axis.
+
+ override def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ Methods inherited from Shape +
+ mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + volume : Double +
+
+
+
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+
+
+ Overrides +
+
+ Shape.volume +
+

+
+
+ + + val + I : Double +
+
+
+
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ Returns
Traegheitsmoment zum Schwerpunkt
+
+
+ Overrides +
+
+ Shape.I +
+

+ + +
Method Details
+
+ + + def + AABB : AABB +
+
+
+
Gibt das umfassende AABB dieser Form zurueck.
+
+ Returns
umfassendes AABB
+
+
+ Overrides +
+
+ Shape.AABB +
+

+
+
+ + + def + project(axis : Vector2D) : Projection +
+
+
+
Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den + Richtungsvektor axis.
+
+ Parameters
axis - Richtungsvektor der Geraden
+ Returns
Projektion dieser Form
+
+
+ Overrides +
+
+ Shape.project +
+

+
+
+ + + def + contains(point : Vector2D) : Boolean +
+
+
+
Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
+
+
+
+ Overrides +
+
+ Shape.contains +
+

+
+
+ + 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/Constraint.html b/doc/sims/dynamics/Constraint.html new file mode 100644 index 0000000..556e5c3 --- /dev/null +++ b/doc/sims/dynamics/Constraint.html @@ -0,0 +1,132 @@ + + + trait Constraint in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ trait Constraint +

+
+ [source: sims/dynamics/Constraint.scala] +

+
+
+ + + trait + 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.
+
+
+
Direct Known Subclasses:
+
Collision, Joint
+

+ + + + + + + + + + + + + +
Method Summary
+ abstract def + + correctPosition + (h : Double) : Unit + +
Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
+
+ abstract def + + correctVelocity + (h : Double) : Unit + +
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + abstract + def + correctVelocity(h : Double) : Unit +
+
+
+
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.
+
+
+
+
+ + abstract + def + correctPosition(h : Double) : Unit +
+
+
+
Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/Rectangle$object.html b/doc/sims/dynamics/Rectangle$object.html new file mode 100644 index 0000000..7c76345 --- /dev/null +++ b/doc/sims/dynamics/Rectangle$object.html @@ -0,0 +1,82 @@ + + + object Rectangle in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ object Rectangle +

+
+ [source: sims/dynamics/Rectangle.scala] +

+
+
+ + + object + Rectangle +
+
extends (Double, Double, Double) => Rectangle
+
+ + + + + + +
+ Methods inherited from scala.Function3 +
+ scala.Function3.toString, scala.Function3.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/Rectangle.html b/doc/sims/dynamics/Rectangle.html new file mode 100644 index 0000000..a002d40 --- /dev/null +++ b/doc/sims/dynamics/Rectangle.html @@ -0,0 +1,431 @@ + + + class Rectangle in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ class Rectangle +

+
+ [source: sims/dynamics/Rectangle.scala] +

+
+
+ + case + class + Rectangle(val halfWidth : Double, val halfHeight : Double, val density : Double) +
+
extends Shape with ConvexPolygon with scala.Product
+
+
Rechteck ist eine Art Polygon.
+
+ Parameters
halfWidth - halbe Breite dieses Rechtecks
halfHeight - halbe Hoehe dieses Rechtecks
density - dichte dieses Rechtecks
+
+
Direct Known Subclasses:
+
GraphicalRectangle
+

+ + + + + + + + + + + + +
Value Summary
+ val + + I + : Double + +
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ val + + volume + : Double + +
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+ + +
+ Values and Variables inherited from Shape +
+ uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + equals + (arg0 : Any) : Boolean + +
This method is used to compare the receiver object (this) + with the argument object (arg0) for equivalence.
+
+ def + + 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.
+
+ 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 + + 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.
+
+ + +
+ Methods inherited from ConvexPolygon +
+ sides, project, AABB, contains +
+ + +
+ Methods inherited from Shape +
+ mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + volume : Double +
+
+
+
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+
+
+ Overrides +
+
+ Shape.volume +
+

+
+
+ + + val + I : Double +
+
+
+
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ Returns
Traegheitsmoment zum Schwerpunkt
+
+
+ Overrides +
+
+ Shape.I +
+

+ + +
Method Details
+
+ + + def + 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
Vektoren vom Zentrum dieses Rectecks bis zu den Ecken
+
+
+
+ + + def + 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
Ortsvektoren der Ecken dieses Rechtecks
+
+
+ Overrides +
+
+ ConvexPolygon.vertices +
+

+
+
+ + 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/RegularPolygon$object.html b/doc/sims/dynamics/RegularPolygon$object.html new file mode 100644 index 0000000..b2d8a0e --- /dev/null +++ b/doc/sims/dynamics/RegularPolygon$object.html @@ -0,0 +1,82 @@ + + + object RegularPolygon in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ object RegularPolygon +

+
+ [source: sims/dynamics/RegularPolygon.scala] +

+
+
+ + + object + RegularPolygon +
+
extends (Int, Double, Double) => RegularPolygon
+
+ + + + + + +
+ Methods inherited from scala.Function3 +
+ scala.Function3.toString, scala.Function3.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/RegularPolygon.html b/doc/sims/dynamics/RegularPolygon.html new file mode 100644 index 0000000..764f13c --- /dev/null +++ b/doc/sims/dynamics/RegularPolygon.html @@ -0,0 +1,419 @@ + + + class RegularPolygon in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ class RegularPolygon +

+
+ [source: sims/dynamics/RegularPolygon.scala] +

+
+
+ + case + class + 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.
+
+ Parameters
n - Anzahl der Seiten.
radius - Radius des umschreibenden Kreises.
density - Dichte.
+
+
Direct Known Subclasses:
+
GraphicalRegularPolygon
+

+ + + + + + + + + + + + +
Value Summary
+ val + + I + : Double + +
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ val + + volume + : Double + +
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+ + +
+ Values and Variables inherited from Shape +
+ uid, collidable, restitution, friction, pos, rotation, rotation0, refLocalPos, body, transientShapes +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ override def + + equals + (arg0 : Any) : Boolean + +
This method is used to compare the receiver object (this) + with the argument object (arg0) for equivalence.
+
+ def + + halfDiags + : scala.Array[Vector2D] + + +
+ 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 + + vertices + : scala.Array[Vector2D] + +
Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
+
+ + +
+ Methods inherited from ConvexPolygon +
+ sides, project, AABB, contains +
+ + +
+ Methods inherited from Shape +
+ mass, asBody, ^, ^ +
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + volume : Double +
+
+
+
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+
+
+ Overrides +
+
+ Shape.volume +
+

+
+
+ + + val + I : Double +
+
+
+
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ Returns
Traegheitsmoment zum Schwerpunkt
+
+
+ Overrides +
+
+ Shape.I +
+

+ + +
Method Details
+
+ + + def + halfDiags : scala.Array[Vector2D] +
+
+

+
+
+ + + def + vertices : scala.Array[Vector2D] +
+
+
+
Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
+
+ Returns
Ortsvektoren der Ecken
+
+
+ Overrides +
+
+ ConvexPolygon.vertices +
+

+
+
+ + 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/Shape$object.html b/doc/sims/dynamics/Shape$object.html new file mode 100644 index 0000000..a90e5ee --- /dev/null +++ b/doc/sims/dynamics/Shape$object.html @@ -0,0 +1,75 @@ + + + object Shape in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ object Shape +

+
+ [source: sims/dynamics/Shape.scala] +

+
+
+ + + object + Shape +
+
extends AnyRef
+
+ + + + + + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, 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/Shape.html b/doc/sims/dynamics/Shape.html new file mode 100644 index 0000000..c62245d --- /dev/null +++ b/doc/sims/dynamics/Shape.html @@ -0,0 +1,559 @@ + + + class Shape in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ class Shape +

+
+ [source: sims/dynamics/Shape.scala] +

+
+
+ + abstract + class + Shape +
+
extends AnyRef
+
+
Eine abstrakte Form.
+
+
+
Direct Known Subclasses:
+
GraphicalShape, Circle, Rectangle, RegularPolygon
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ abstract val + + I + : Double + +
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ var + + body + : Body + +
Beinhaltender Koerper. Sollte nicht selbst bei Initialisierung definiert werden.
+
+ var + + collidable + : Boolean + +
Kollisionsfaehigkeit.
+
+ abstract val + + density + : Double + +
Dichte. (Masse pro Flaeche)
+
+ var + + 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.
+
+ var + + pos + : Vector2D + +
Position des Schwerpunktes in Welt.
+
+ var + + refLocalPos + : Vector2D + +
Referenzposition in Koerper. Wird zur Rotation von Formen in Koerpern verwendet.
+
+ var + + 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.
+
+ var + + rotation + : Double + +
Rotation. Entspricht Laenge des Rotationsvektors.
+
+ var + + rotation0 + : Double + +
Initiale Rotation. (Rotation ohne Koerper)
+
+ val + + transientShapes + : scala.collection.mutable.Set[Shape] + +
Formen mit denen diese Form nicht Kollidiert.
+
+ val + + uid + : Int + +
Einzigartige Identifikationsnummer.
+
+ abstract val + + volume + : Double + +
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ abstract def + + AABB + : AABB + +
Gibt das umfassende AABB dieser Form zurueck.
+
+ def + + ^ + (b : Body) : Body + +
Erstellt einen Koerper aus dieser Form und den Formen des Koerpers b.
+
+ def + + ^ + (s : Shape) : Body + +
Erstellt einen Koerper aus dieser Form und der Form s.
+
+ def + + asBody + : Body + +
Baut einen Koerper aus dieser Form.
+
+ abstract def + + contains + (point : Vector2D) : Boolean + +
Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
+
+ def + + mass + : Double + +
Errechnet die Masse dieser Form. Masse ist gleich Volumen mal Dichte.
+
+ abstract def + + project + (axis : Vector2D) : Projection + +
Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den + Richtungsvektor axis.
+
+ + +
+ 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 + uid : Int +
+
+
+
Einzigartige Identifikationsnummer.
+
+
+
+
+ + + var + collidable : Boolean +
+
+
+
Kollisionsfaehigkeit.
+
+
+
+
+ + + var + 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.
+
+
+
+
+ + + var + 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.
+
+
+
+
+ + + var + pos : Vector2D +
+
+
+
Position des Schwerpunktes in Welt.
+
+
+
+
+ + + var + rotation : Double +
+
+
+
Rotation. Entspricht Laenge des Rotationsvektors.
+
+
+
+
+ + + var + rotation0 : Double +
+
+
+
Initiale Rotation. (Rotation ohne Koerper)
+
+
+
+
+ + + var + refLocalPos : Vector2D +
+
+
+
Referenzposition in Koerper. Wird zur Rotation von Formen in Koerpern verwendet.
+
+
+
+
+ + abstract + val + density : Double +
+
+
+
Dichte. (Masse pro Flaeche)
+
+
+
+
+ + abstract + val + volume : Double +
+
+
+
Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.
+
+
+
+
+ + abstract + val + I : Double +
+
+
+
Errechnet Traegheitsmoment zum Schwerpunkt dieser Form.
+
+ Returns
Traegheitsmoment zum Schwerpunkt
+
+
+
+ + + var + body : Body +
+
+
+
Beinhaltender Koerper. Sollte nicht selbst bei Initialisierung definiert werden.
+
+
+
+
+ + + val + transientShapes : scala.collection.mutable.Set[Shape] +
+
+
+
Formen mit denen diese Form nicht Kollidiert.
+
+
+ + +
Method Details
+
+ + + def + mass : Double +
+
+
+
Errechnet die Masse dieser Form. Masse ist gleich Volumen mal Dichte.
+
+ Returns
Masse der Form
+
+
+
+ + abstract + def + AABB : AABB +
+
+
+
Gibt das umfassende AABB dieser Form zurueck.
+
+ Returns
umfassendes AABB
+
+
+
+ + abstract + def + project(axis : Vector2D) : Projection +
+
+
+
Ergibt die Projektion dieser Form auf eine Gerade gegeben durch den + Richtungsvektor axis.
+
+ Parameters
axis - Richtungsvektor der Geraden
+ Returns
Projektion dieser Form
+
+
+
+ + abstract + def + contains(point : Vector2D) : Boolean +
+
+
+
Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.
+
+
+
+
+ + + def + asBody : Body +
+
+
+
Baut einen Koerper aus dieser Form.
+
+ Returns
ein Koerper bestehend aus dieser Form.
+
+
+
+ + + def + ^(s : Shape) : Body +
+
+
+
Erstellt einen Koerper aus dieser Form und der Form s.
+
+
+
+
+ + + def + ^(b : Body) : Body +
+
+
+
Erstellt einen Koerper aus dieser Form und den Formen des Koerpers b.
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/World.html b/doc/sims/dynamics/World.html new file mode 100644 index 0000000..df1948a --- /dev/null +++ b/doc/sims/dynamics/World.html @@ -0,0 +1,692 @@ + + + class World in sims.dynamics + + + + + + + + + + + +
+ sims.dynamics +

+ class World +

+
+ [source: sims/dynamics/World.scala] +

+
+
+ + + class + World +
+
extends AnyRef
+
+
Eine Welt enthaelt und Simuliert ein System aus Koerpern und Verbindungen.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + bodies + : scala.collection.mutable.ArrayBuffer[Body] + +
Alle Koerper die diese Welt simuliert.
+
+ val + + detector + : Detector + +
Kollisionsdetektor dieser Welt.
+
+ var + + enableCollisionDetection + : Boolean + +
Kollisionerkennung.
+
+ var + + enablePositionCorrection + : Boolean + +
Positionskorrekturen.
+
+ var + + gravity + : Vector2D + +
Schwerkraft die in dieser Welt herrscht.
+
+ var + + iterations + : Int + +
Anzahl der Constraint-Korrekturen pro Zeitschritt.
+
+ val + + joints + : scala.collection.mutable.ArrayBuffer[Joint] + +
Alle Verbindungen die diese Welt simuliert.
+
+ var + + minAngularVelocity + : Double + +
Die minimale, nicht als null geltende Winkelgeschwindigkeit.
+
+ var + + minLinearVelocity + : Double + +
Die minimale, nicht als null geltende Geschwindigkeit.
+
+ val + + monitors + : scala.collection.mutable.ArrayBuffer[(java.lang.String, (Body) => java.lang.String)] + +
Ueberwachungsfunktionen fuer Koerper.
+
+ var + + overCWarning + : Boolean + +
Warnung wenn Koerper schneller als Lichtgeschwindigkeit.
+
+ var + + time + : Double + +
Aktuelle Zeit in Sekunden dieser Welt. Nach jedem Zeitschritt wird die Zeit erhoeht.
+
+ var + + timeStep + : Double + +
Zeitschritt in dem diese Welt die Simulation vorranschreiten laesst.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + ++= + (bs : scala.Seq[Body]) : Unit + + +
+ def + + += + (joint : Joint) : Unit + +
Fuegt dieser Welt eine Verbindung hinzu.
+
+ def + + += + (body : Body) : Unit + +
Fuegt dieser Welt einen Koerper hinzu.
+
+ def + + += + (p : Prefab) : Unit + +
Fuegt dieser Welt ein vorangefertigtes System vaus Koerpern und Verbindungen hinzu.
+
+ def + + --= + (bs : scala.Seq[Body]) : Unit + + +
+ def + + -= + (joint : Joint) : Unit + +
Entfernt die gegebene Verbindung aus dieser Welt.
+
+ def + + -= + (p : Prefab) : Unit + +
Entfernt das gegebene System aus Koerpern und Verbindungen aus dieser Welt.
+
+ def + + -= + (body : Body) : Unit + +
Entfernt den gegebenen Koerper aus dieser Welt.
+
+ def + + clear + : Unit + +
Entfernt alle Koerper, Verbindungen und Ueberwachungsfunktionen dieser Welt.
+
+ def + + info + : java.lang.String + +
Ergibt Informationen ueber diese Welt.
+
+ def + + postStep + : Unit + +
Wird nach jedem Zeitschritt ausgefuehrt.
+
+ def + + shapes + : scala.Seq[Shape] + +
Ergibt alle Formen aus allen Koerpern in dieser Welt.
+
+ def + + 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + var + timeStep : Double +
+
+
+
Zeitschritt in dem diese Welt die Simulation vorranschreiten laesst.
+
+
+
+
+ + + var + iterations : Int +
+
+
+
Anzahl der Constraint-Korrekturen pro Zeitschritt.
+
+
+
+
+ + + var + gravity : Vector2D +
+
+
+
Schwerkraft die in dieser Welt herrscht.
+
+
+
+
+ + + val + bodies : scala.collection.mutable.ArrayBuffer[Body] +
+
+
+
Alle Koerper die diese Welt simuliert.
+
+
+
+
+ + + val + joints : scala.collection.mutable.ArrayBuffer[Joint] +
+
+
+
Alle Verbindungen die diese Welt simuliert.
+
+
+
+
+ + + val + monitors : scala.collection.mutable.ArrayBuffer[(java.lang.String, (Body) => java.lang.String)] +
+
+
+
Ueberwachungsfunktionen fuer Koerper. +

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

+
+
+
+
+ + + val + detector : Detector +
+
+
+
Kollisionsdetektor dieser Welt.
+
+
+
+
+ + + var + overCWarning : Boolean +
+
+
+
Warnung wenn Koerper schneller als Lichtgeschwindigkeit.
+
+
+
+
+ + + var + enableCollisionDetection : Boolean +
+
+
+
Kollisionerkennung.
+
+
+
+
+ + + var + enablePositionCorrection : Boolean +
+
+
+
Positionskorrekturen.
+
+
+
+
+ + + var + minLinearVelocity : Double +
+
+
+
Die minimale, nicht als null geltende Geschwindigkeit.
+
+
+
+
+ + + var + minAngularVelocity : Double +
+
+
+
Die minimale, nicht als null geltende Winkelgeschwindigkeit.
+
+
+
+
+ + + var + time : Double +
+
+
+
Aktuelle Zeit in Sekunden dieser Welt. Nach jedem Zeitschritt wird die Zeit erhoeht.
+
+
+ + +
Method Details
+
+ + + def + shapes : scala.Seq[Shape] +
+
+
+
Ergibt alle Formen aus allen Koerpern in dieser Welt.
+
+
+
+
+ + + def + +=(body : Body) : Unit +
+
+
+
Fuegt dieser Welt einen Koerper hinzu.
+
+
+
+
+ + + def + +=(joint : Joint) : Unit +
+
+
+
Fuegt dieser Welt eine Verbindung hinzu.
+
+
+
+
+ + + def + +=(p : Prefab) : Unit +
+
+
+
Fuegt dieser Welt ein vorangefertigtes System vaus Koerpern und Verbindungen hinzu.
+
+
+
+
+ + + def + ++=(bs : scala.Seq[Body]) : Unit +
+
+

+
+
+ + + def + -=(body : Body) : Unit +
+
+
+
Entfernt den gegebenen Koerper aus dieser Welt.
+
+
+
+
+ + + def + -=(joint : Joint) : Unit +
+
+
+
Entfernt die gegebene Verbindung aus dieser Welt.
+
+
+
+
+ + + def + -=(p : Prefab) : Unit +
+
+
+
Entfernt das gegebene System aus Koerpern und Verbindungen aus dieser Welt.
+
+
+
+
+ + + def + --=(bs : scala.Seq[Body]) : Unit +
+
+

+
+
+ + + def + clear : Unit +
+
+
+
Entfernt alle Koerper, Verbindungen und Ueberwachungsfunktionen dieser Welt.
+
+
+
+
+ + + def + 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. +

+ Der Zeitschritt wird in folgenden Phasen ausgefuehrt: +

    +
  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. +
+
+
+
+
+ + + def + postStep : Unit +
+
+
+
Wird nach jedem Zeitschritt ausgefuehrt.
+
+
+
+
+ + + def + info : java.lang.String +
+
+
+
Ergibt Informationen ueber diese Welt.
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/joints$content.html b/doc/sims/dynamics/joints$content.html new file mode 100644 index 0000000..4652a21 --- /dev/null +++ b/doc/sims/dynamics/joints$content.html @@ -0,0 +1,101 @@ + + + All classes and objects in sims.dynamics.joints + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ case class + + 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.
+
+ trait + + ForceJoint + extends AnyRef + +
Eine Verbindung die Kraft auf ihre Bindungskoerper ausueben kann.
+
+ abstract class + + Joint + extends Constraint with AnyRef + +
Joints sind Verbindungen die die Bewegung zwischen zwei Koerpern einschraenken. + Ihre Implementierung wurde von Erin Catto's box2d inspiriert.
+
+ case class + + 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.
+
+ case class + + 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.
+
+ + + + + + + + + + + + + + +
Object Summary
+ object + + DistanceJoint + extends (Body, Vector2D, Body, Vector2D) => DistanceJoint + + +
+ object + + RevoluteJoint + extends (Body, Body, Vector2D) => RevoluteJoint + + +
+ object + + SpringJoint + extends (Body, Vector2D, Body, Vector2D, Double, Double) => SpringJoint + + +
+ \ No newline at end of file diff --git a/doc/sims/dynamics/joints$package.html b/doc/sims/dynamics/joints$package.html new file mode 100644 index 0000000..dde0590 --- /dev/null +++ b/doc/sims/dynamics/joints$package.html @@ -0,0 +1,22 @@ + + + List of classes and objects in package sims.dynamics.joints + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/sims/dynamics/joints/DistanceJoint$object.html b/doc/sims/dynamics/joints/DistanceJoint$object.html new file mode 100644 index 0000000..e4121b3 --- /dev/null +++ b/doc/sims/dynamics/joints/DistanceJoint$object.html @@ -0,0 +1,82 @@ + + + object DistanceJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ object DistanceJoint +

+
+ [source: sims/dynamics/joints/DistanceJoint.scala] +

+
+
+ + + object + DistanceJoint +
+
extends (Body, Vector2D, Body, Vector2D) => DistanceJoint
+
+ + + + + + +
+ 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/DistanceJoint.html b/doc/sims/dynamics/joints/DistanceJoint.html new file mode 100644 index 0000000..80a0f2d --- /dev/null +++ b/doc/sims/dynamics/joints/DistanceJoint.html @@ -0,0 +1,481 @@ + + + class DistanceJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ class DistanceJoint +

+
+ [source: sims/dynamics/joints/DistanceJoint.scala] +

+
+
+ + case + class + 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.
+
+ Parameters
node1 - erster Koerper der Verbindung
anchor1 - Bindungspunkt auf Koerper eins
node2 - zweiter Koerper der Verbindung
anchor2 - Bindungspunkt auf Koerper zwei
+ + + + + + + +
Additional Constructor Summary
+ def + + this + (node1 : Body, node2 : Body) : DistanceJoint + + +
+ + + + + + + +
Value Summary
+ val + + distance + : Double + +
Abstand der beiden Bindungspunkte bei initialisierung (der gewollte Abstand).
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + connection1 + : Vector2D + +
Ergibt den Bindungspunkt auf Koerper eins.
+
+ def + + connection2 + : Vector2D + +
Ergibt den Bindungspunkt auf Koerper zwei.
+
+ override def + + correctPosition + (h : Double) : Unit + +
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ override def + + correctVelocity + (h : Double) : Unit + +
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ 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 + +
Relative Geschwindigkeit der Bindungspunkte.
+
+ def + + x + : Vector2D + +
Relative Position der Bindungspunkte.
+
+ + +
+ 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) : DistanceJoint +
+
+

+ + + +
Value Details
+
+ + + val + distance : Double +
+
+
+
Abstand der beiden Bindungspunkte bei initialisierung (der gewollte Abstand).
+
+
+ + +
Method Details
+
+ + + def + connection1 : Vector2D +
+
+
+
Ergibt den Bindungspunkt auf Koerper eins.
+
+
+
+
+ + + def + connection2 : Vector2D +
+
+
+
Ergibt den Bindungspunkt auf Koerper zwei.
+
+
+
+
+ + + def + x : Vector2D +
+
+
+
Relative Position der Bindungspunkte.
+
+
+
+
+ + + def + v : Vector2D +
+
+
+
Relative Geschwindigkeit der Bindungspunkte.
+
+
+
+
+ + override + def + correctVelocity(h : Double) : Unit +
+
+
+
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ Overrides +
+
+ Joint.correctVelocity +
+

+
+
+ + override + def + correctPosition(h : Double) : Unit +
+
+
+
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ 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/ForceJoint.html b/doc/sims/dynamics/joints/ForceJoint.html new file mode 100644 index 0000000..bf8ac9f --- /dev/null +++ b/doc/sims/dynamics/joints/ForceJoint.html @@ -0,0 +1,107 @@ + + + trait ForceJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ trait ForceJoint +

+
+ [source: sims/dynamics/joints/ForceJoint.scala] +

+
+
+ + + trait + ForceJoint +
+
extends AnyRef
+
+
Eine Verbindung die Kraft auf ihre Bindungskoerper ausueben kann.
+
+
+
Direct Known Subclasses:
+
SpringJoint
+

+ + + + + + + + + +
Method Summary
+ abstract def + + applyForce + : Unit + +
Uebt eine Kraft auf die Bindungskoerper aus.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + abstract + def + applyForce : Unit +
+
+
+
Uebt eine Kraft auf die Bindungskoerper aus.
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/joints/Joint.html b/doc/sims/dynamics/joints/Joint.html new file mode 100644 index 0000000..a577cde --- /dev/null +++ b/doc/sims/dynamics/joints/Joint.html @@ -0,0 +1,194 @@ + + + class Joint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ class Joint +

+
+ [source: sims/dynamics/joints/Joint.scala] +

+
+
+ + abstract + class + Joint +
+
extends Constraint with AnyRef
+
+
Joints sind Verbindungen die die Bewegung zwischen zwei Koerpern einschraenken. + Ihre Implementierung wurde von Erin Catto's box2d inspiriert.
+
+
+
Direct Known Subclasses:
+
DistanceJoint, RevoluteJoint, SpringJoint
+

+ + + + + + + + + + + + +
Value Summary
+ abstract val + + node1 + : Body + +
Erster Koerper der Verbindung.
+
+ abstract val + + node2 + : Body + +
Zweiter Koerper der Verbindung.
+
+ + + + + + + + + + +
Method Summary
+ abstract def + + correctPosition + (h : Double) : Unit + +
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ abstract def + + correctVelocity + (h : Double) : Unit + +
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ + +
+ 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
+
+ + abstract + val + node1 : Body +
+
+
+
Erster Koerper der Verbindung.
+
+
+
+
+ + abstract + val + node2 : Body +
+
+
+
Zweiter Koerper der Verbindung.
+
+
+ + +
Method Details
+
+ + abstract + def + correctVelocity(h : Double) : Unit +
+
+
+
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ Overrides +
+
+ Constraint.correctVelocity +
+

+
+
+ + abstract + def + correctPosition(h : Double) : Unit +
+
+
+
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ Overrides +
+
+ Constraint.correctPosition +
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/dynamics/joints/RevoluteJoint$object.html b/doc/sims/dynamics/joints/RevoluteJoint$object.html new file mode 100644 index 0000000..c8a5d71 --- /dev/null +++ b/doc/sims/dynamics/joints/RevoluteJoint$object.html @@ -0,0 +1,82 @@ + + + object RevoluteJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ object RevoluteJoint +

+
+ [source: sims/dynamics/joints/RevoluteJoint.scala] +

+
+
+ + + object + RevoluteJoint +
+
extends (Body, Body, Vector2D) => RevoluteJoint
+
+ + + + + + +
+ Methods inherited from scala.Function3 +
+ scala.Function3.toString, scala.Function3.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/RevoluteJoint.html b/doc/sims/dynamics/joints/RevoluteJoint.html new file mode 100644 index 0000000..b3059de --- /dev/null +++ b/doc/sims/dynamics/joints/RevoluteJoint.html @@ -0,0 +1,419 @@ + + + class RevoluteJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ class RevoluteJoint +

+
+ [source: sims/dynamics/joints/RevoluteJoint.scala] +

+
+
+ + case + class + 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.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + connection1 + : Vector2D + + +
+ def + + connection2 + : Vector2D + + +
+ def + + correctPosition + (h : Double) : Unit + +
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ def + + correctVelocity + (h : Double) : Unit + +
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ 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 +
+ + + + + + + +
Method Details
+
+ + + def + connection1 : Vector2D +
+
+

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

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

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

+
+
+ + + def + correctVelocity(h : Double) : Unit +
+
+
+
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ Overrides +
+
+ Joint.correctVelocity +
+

+
+
+ + + def + correctPosition(h : Double) : Unit +
+
+
+
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ 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/SpringJoint$object.html b/doc/sims/dynamics/joints/SpringJoint$object.html new file mode 100644 index 0000000..7730d19 --- /dev/null +++ b/doc/sims/dynamics/joints/SpringJoint$object.html @@ -0,0 +1,82 @@ + + + object SpringJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ object SpringJoint +

+
+ [source: sims/dynamics/joints/SpringJoint.scala] +

+
+
+ + + object + SpringJoint +
+
extends (Body, Vector2D, Body, Vector2D, Double, Double) => SpringJoint
+
+ + + + + + +
+ Methods inherited from scala.Function6 +
+ scala.Function6.toString, scala.Function6.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/SpringJoint.html b/doc/sims/dynamics/joints/SpringJoint.html new file mode 100644 index 0000000..ba601bb --- /dev/null +++ b/doc/sims/dynamics/joints/SpringJoint.html @@ -0,0 +1,551 @@ + + + class SpringJoint in sims.dynamics.joints + + + + + + + + + + + +
+ sims.dynamics.joints +

+ class SpringJoint +

+
+ [source: sims/dynamics/joints/SpringJoint.scala] +

+
+
+ + case + class + 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.
+
+ 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
+ + + + + + + + + + + + + + + +
Additional Constructor Summary
+ def + + this + (node1 : Body, node2 : Body, springConstant : Double) : SpringJoint + + +
+ def + + this + (node1 : Body, node2 : Body, springConstant : Double, initialLength : Double) : SpringJoint + + +
+ def + + this + (node1 : Body, anchor1 : Vector2D, node2 : Body, anchor2 : Vector2D, springConstant : Double) : SpringJoint + + +
+ + + + + + + +
Value Summary
+ var + + damping + : Double + +
Daempfung.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + applyForce + : Unit + +
Uebt die Federkraft auf die Bindungspunkte aus.
+
+ def + + connection1 + : Vector2D + +
Ergibt den Bindungspunkt auf Koerper eins.
+
+ def + + connection2 + : Vector2D + +
Ergibt den Bindungspunkt auf Koerper zwei.
+
+ def + + correctPosition + (h : Double) : Unit + +
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ def + + correctVelocity + (h : Double) : Unit + +
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+ override def + + equals + (arg0 : Any) : Boolean + +
This method is used to compare the receiver object (this) + with the argument object (arg0) for equivalence.
+
+ def + + force + : Double + +
Ergibt die Federkraft nach dem Hookschen Gesetz.
+
+ 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 + + x + : Vector2D + +
Relative Position der Bindungspunkte.
+
+ + +
+ 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, anchor1 : Vector2D, node2 : Body, anchor2 : Vector2D, springConstant : Double) : SpringJoint +
+
+

+
+
+ + + def + this(node1 : Body, node2 : Body, springConstant : Double, initialLength : Double) : SpringJoint +
+
+

+
+
+ + + def + this(node1 : Body, node2 : Body, springConstant : Double) : SpringJoint +
+
+

+ + + +
Value Details
+
+ + + var + damping : Double +
+
+
+
Daempfung.
+
+
+ + +
Method Details
+
+ + + def + connection1 : Vector2D +
+
+
+
Ergibt den Bindungspunkt auf Koerper eins.
+
+
+
+
+ + + def + connection2 : Vector2D +
+
+
+
Ergibt den Bindungspunkt auf Koerper zwei.
+
+
+
+
+ + + def + x : Vector2D +
+
+
+
Relative Position der Bindungspunkte.
+
+
+
+
+ + + def + force : Double +
+
+
+
Ergibt die Federkraft nach dem Hookschen Gesetz.
+
+
+
+
+ + + def + applyForce : Unit +
+
+
+
Uebt die Federkraft auf die Bindungspunkte aus.
+
+
+
+ Overrides +
+
+ ForceJoint.applyForce +
+

+
+
+ + + def + correctPosition(h : Double) : Unit +
+
+
+
Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ Overrides +
+
+ Joint.correctPosition +
+

+
+
+ + + def + correctVelocity(h : Double) : Unit +
+
+
+
Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.
+
+
+
+ Overrides +
+
+ Joint.correctVelocity +
+

+
+
+ + 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/geometry$content.html b/doc/sims/geometry$content.html new file mode 100644 index 0000000..e3cf2bb --- /dev/null +++ b/doc/sims/geometry$content.html @@ -0,0 +1,111 @@ + + + All classes and objects in sims.geometry + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + + + + + +
Class Summary
+ trait + + ConvexPolygon + extends AnyRef + +
Gemeinsame Eigenschaften aller konvexen Polygone.
+
+ case class + + Projection + (val axis : Vector2D, val lower : Double, val upper : Double) extends scala.Product + +
Projektion auf eine Achse.
+
+ case class + + Ray + (val point : Vector2D, val direction : Vector2D) extends scala.Product + +
Eine Halbgerade wird definiert durch:
+
+ case class + + Segment + (val vertex1 : Vector2D, val vertex2 : Vector2D) extends scala.Product + +
Ein Segment wird durch seine beiden Extrempunkte gegeben.
+
+ case class + + Vector2D + (val x : Double, val y : Double) extends scala.Product + +
Ein 2-dimensionaler Vektor.
+
+ + + + + + + + + + + + + + + + + + +
Object Summary
+ object + + Projection + extends (Vector2D, Double, Double) => Projection + + +
+ object + + Ray + extends (Vector2D, Vector2D) => Ray + + +
+ object + + Segment + extends (Vector2D, Vector2D) => Segment + + +
+ object + + Vector2D + extends AnyRef + +
Dieses Objekt enthaelt spezielle Vektoren.
+
+ \ No newline at end of file diff --git a/doc/sims/geometry$package.html b/doc/sims/geometry$package.html new file mode 100644 index 0000000..c3a4d63 --- /dev/null +++ b/doc/sims/geometry$package.html @@ -0,0 +1,23 @@ + + + List of classes and objects in package sims.geometry + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/sims/geometry/ConvexPolygon.html b/doc/sims/geometry/ConvexPolygon.html new file mode 100644 index 0000000..0545761 --- /dev/null +++ b/doc/sims/geometry/ConvexPolygon.html @@ -0,0 +1,215 @@ + + + trait ConvexPolygon in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ trait ConvexPolygon +

+
+ [source: sims/geometry/ConvexPolygon.scala] +

+
+
+ + + trait + ConvexPolygon +
+
extends AnyRef
+
+
Gemeinsame Eigenschaften aller konvexen Polygone.
+
+
+
Direct Known Subclasses:
+
Rectangle, RegularPolygon
+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + AABB + : AABB + +
Errechnet das AABB dieses Polygons
+
+ def + + contains + (point : Vector2D) : Boolean + +
Ueberprueft ob sich der gegebene Punkt point in diesem Polygon befindet.
+
+ def + + project + (axis : Vector2D) : Projection + +
Ergibt die Projektion dieses Polygons auf eine Gerade gegeben durch den + Richtungsvektor axis
+
+ def + + sides + : scala.Array[Segment] + +
Ergibt alle Seiten dieses Polygons.
+
+ abstract def + + vertices + : scala.Seq[Vector2D] + +
Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + abstract + def + vertices : scala.Seq[Vector2D] +
+
+
+
Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend.
+
+ Returns
Ortsvektoren der Ecken
+
+
+
+ + + def + sides : scala.Array[Segment] +
+
+
+
Ergibt alle Seiten dieses Polygons.
+
+ Returns
Seiten dieses Polygons
+
+
+
+ + + def + project(axis : Vector2D) : Projection +
+
+
+
Ergibt die Projektion dieses Polygons auf eine Gerade gegeben durch den + Richtungsvektor axis
+
+ Parameters
axis - Richtungsvektor der Geraden
+ Returns
Projektion dieses Polygons
+
+
+
+ + + def + AABB : AABB +
+
+
+
Errechnet das AABB dieses Polygons
+
+ Returns
umfassendes AABB
+ See Also
collision.AABB
+
+
+
+ + + def + contains(point : Vector2D) : Boolean +
+
+
+
Ueberprueft ob sich der gegebene Punkt point in diesem Polygon befindet. +

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

+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/geometry/Projection$object.html b/doc/sims/geometry/Projection$object.html new file mode 100644 index 0000000..4b01917 --- /dev/null +++ b/doc/sims/geometry/Projection$object.html @@ -0,0 +1,82 @@ + + + object Projection in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ object Projection +

+
+ [source: sims/geometry/Projection.scala] +

+
+
+ + + object + Projection +
+
extends (Vector2D, Double, Double) => Projection
+
+ + + + + + +
+ Methods inherited from scala.Function3 +
+ scala.Function3.toString, scala.Function3.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/geometry/Projection.html b/doc/sims/geometry/Projection.html new file mode 100644 index 0000000..3599777 --- /dev/null +++ b/doc/sims/geometry/Projection.html @@ -0,0 +1,328 @@ + + + class Projection in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ class Projection +

+
+ [source: sims/geometry/Projection.scala] +

+
+
+ + case + class + Projection(val axis : Vector2D, val lower : Double, val upper : Double) +
+
extends scala.Product
+
+
Projektion auf eine Achse. +

+ Ueblicherweise werden Projektionen in SiMS fuer Kollisionserkennung benutzt.

+
+ Parameters
axis - Achse der Projektion
lower - unterer Wert der Projektion
upper - oberer Wert der Projektion
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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.
+
+ def + + overlap + (other : Projection) : Double + +
Ergibt die Ueberlappung dieser Projektion und der Projektion other.
+
+ def + + overlaps + (other : Projection) : Boolean + +
Ueberprueft ob sich diese Projektion mit der Projektion other ueberschneidet.
+
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + + def + overlaps(other : Projection) : Boolean +
+
+
+
Ueberprueft ob sich diese Projektion mit der Projektion other ueberschneidet.
+
+
+
+
+ + + def + overlap(other : Projection) : Double +
+
+
+
Ergibt die Ueberlappung dieser Projektion und der Projektion other.
+
+
+
+
+ + 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/geometry/Ray$object.html b/doc/sims/geometry/Ray$object.html new file mode 100644 index 0000000..199fc55 --- /dev/null +++ b/doc/sims/geometry/Ray$object.html @@ -0,0 +1,82 @@ + + + object Ray in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ object Ray +

+
+ [source: sims/geometry/Ray.scala] +

+
+
+ + + object + Ray +
+
extends (Vector2D, Vector2D) => Ray
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/geometry/Ray.html b/doc/sims/geometry/Ray.html new file mode 100644 index 0000000..558153d --- /dev/null +++ b/doc/sims/geometry/Ray.html @@ -0,0 +1,334 @@ + + + class Ray in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ class Ray +

+
+ [source: sims/geometry/Ray.scala] +

+
+
+ + case + class + Ray(val point : Vector2D, val direction : Vector2D) +
+
extends scala.Product
+
+
Eine Halbgerade wird definiert durch:
+
+ Parameters
point - ein Aufpunkt
direction - ein Richtungsvektor
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + 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.
+
+ 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.
+
+ def + + intersects + (s : Segment) : Boolean + +
Ueberprueft ob diese Halbgerade das gegebene Segment ueberschneidet.
+
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + + def + intersects(s : Segment) : Boolean +
+
+
+
Ueberprueft ob diese Halbgerade das gegebene Segment ueberschneidet.
+
+ Parameters
das - auf Ueberschneidung zu uerberpruefende Segment
+
+
+
+ + + def + 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.
+
+ Parameters
p - Ortsvektor des oben genannten Punkt
+
+
+
+ + 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/geometry/Segment$object.html b/doc/sims/geometry/Segment$object.html new file mode 100644 index 0000000..fae9e31 --- /dev/null +++ b/doc/sims/geometry/Segment$object.html @@ -0,0 +1,82 @@ + + + object Segment in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ object Segment +

+
+ [source: sims/geometry/Segment.scala] +

+
+
+ + + object + Segment +
+
extends (Vector2D, Vector2D) => Segment
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/geometry/Segment.html b/doc/sims/geometry/Segment.html new file mode 100644 index 0000000..2cc0453 --- /dev/null +++ b/doc/sims/geometry/Segment.html @@ -0,0 +1,441 @@ + + + class Segment in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ class Segment +

+
+ [source: sims/geometry/Segment.scala] +

+
+
+ + case + class + Segment(val vertex1 : Vector2D, val vertex2 : Vector2D) +
+
extends scala.Product
+
+
Ein Segment wird durch seine beiden Extrempunkte gegeben.
+
+ Parameters
vertex1 - Ortsvektor des 1. Extrempunkts
vertex2 - Ortsvektor des 2. Extrempunkts
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + d + : Vector2D + +
Vektor von EP1 zu EP2.
+
+ val + + d0 + : Vector2D + +
Einheitsrichtungsvektor.
+
+ val + + length + : Double + +
Laenge dieses Segments.
+
+ val + + n + : Vector2D + +
Normalenvektor. Richtung: 90 Grad rechts zu d.
+
+ val + + n0 + : Vector2D + +
Normaleneinheitsvektor. Richtung: 90 Grad rechts zu d.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + clipToSegment + (s : Segment) : scala.Option[Vector2D] + + +
+ def + + distance + (point : Vector2D) : Double + +
Kleinster Abstand zwischen diesem Segment und dem Punkt p.
+
+ 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.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + length : Double +
+
+
+
Laenge dieses Segments.
+
+
+
+
+ + + val + d : Vector2D +
+
+
+
Vektor von EP1 zu EP2.
+
+
+
+
+ + + val + d0 : Vector2D +
+
+
+
Einheitsrichtungsvektor.
+
+
+
+
+ + + val + n : Vector2D +
+
+
+
Normalenvektor. Richtung: 90 Grad rechts zu d.
+
+
+
+
+ + + val + n0 : Vector2D +
+
+
+
Normaleneinheitsvektor. Richtung: 90 Grad rechts zu d.
+
+
+ + +
Method Details
+
+ + + def + distance(point : Vector2D) : Double +
+
+
+
Kleinster Abstand zwischen diesem Segment und dem Punkt p.
+
+
+
+
+ + + def + clipToSegment(s : Segment) : scala.Option[Vector2D] +
+
+

+
+
+ + 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/geometry/Vector2D$object.html b/doc/sims/geometry/Vector2D$object.html new file mode 100644 index 0000000..188f206 --- /dev/null +++ b/doc/sims/geometry/Vector2D$object.html @@ -0,0 +1,150 @@ + + + object Vector2D in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ object Vector2D +

+
+ [source: sims/geometry/Vector2D.scala] +

+
+
+ + + object + Vector2D +
+
extends AnyRef
+
+
Dieses Objekt enthaelt spezielle Vektoren.
+
+ + + + + + + + + + + + + + + + + +
Value Summary
+ val + + Null + : Vector2D + +
Nullvektor.
+
+ val + + i + : Vector2D + +
Ein horizontaler Einheitsvektor mit den Komponenten (1;0).
+
+ val + + j + : Vector2D + +
Ein vertikaler Einheitsvektor mit den Komponenten (0;1).
+
+ + + +
+ 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 + Null : Vector2D +
+
+
+
Nullvektor.
+
+
+
+
+ + + val + i : Vector2D +
+
+
+
Ein horizontaler Einheitsvektor mit den Komponenten (1;0).
+
+
+
+
+ + + val + j : Vector2D +
+
+
+
Ein vertikaler Einheitsvektor mit den Komponenten (0;1).
+
+
+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/geometry/Vector2D.html b/doc/sims/geometry/Vector2D.html new file mode 100644 index 0000000..5e541fb --- /dev/null +++ b/doc/sims/geometry/Vector2D.html @@ -0,0 +1,644 @@ + + + class Vector2D in sims.geometry + + + + + + + + + + + +
+ sims.geometry +

+ class Vector2D +

+
+ [source: sims/geometry/Vector2D.scala] +

+
+
+ + case + class + Vector2D(val x : Double, val y : Double) +
+
extends scala.Product
+
+
Ein 2-dimensionaler Vektor.
+
+ Parameters
x - 1. Komponente
y - 2. Komponente
+ + + + + + + + + +
Value Summary
+ val + + length + : Double + +
Norm dieses Vektors.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + * + (n : Double) : Vector2D + +
Multiplikation mit einem Skalar.
+
+ def + + + + (v : Vector2D) : Vector2D + +
Vektoraddition.
+
+ def + + - + (v : Vector2D) : Vector2D + +
Vektorsubstraktion.
+
+ def + + / + (n : Double) : Vector2D + +
Division durch ein Skalar.
+
+ def + + components + : scala.List[Double] + +
Ergibt eine Liste der Komponenten dieses Vektors.
+
+ def + + cross + (v : Vector2D) : Double + +
Kreuzprodukt. (Norm des Kreuzproduktes)
+
+ def + + dot + (v : Vector2D) : Double + +
Skalarprodukt.
+
+ 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.
+
+ def + + isNull + : Boolean + +
Ueberprueft, ob die Komponenten dieses Vektors gleich Null sind.
+
+ def + + leftNormal + : Vector2D + +
Linker Normalenvektor. (-y, x)
+
+ override def + + productArity + : Int + + +
+ override def + + productElement + (arg0 : Int) : Any + + +
+ override def + + productPrefix + : java.lang.String + + +
+ def + + project + (v : Vector2D) : Vector2D + +
Errechnet die Projektion dieses- auf einen anderen Vektor.
+
+ def + + rightNormal + : Vector2D + +
Rechter Normalenvektor. (y, -x)
+
+ def + + rotate + (angle : Double) : Vector2D + +
Errechnet eine Rotation dieses Vektors.
+
+ override def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ def + + unary_- + : Vector2D + +
Minusvorzeichen.
+
+ def + + unit + : Vector2D + +
Einheitsvektor dieses Vektors.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + +
Value Details
+
+ + + val + length : Double +
+
+
+
Norm dieses Vektors.
+
+
+ + +
Method Details
+
+ + + def + +(v : Vector2D) : Vector2D +
+
+
+
Vektoraddition.
+
+ Parameters
v - zu addierender Vektor
+ Returns
dieser Vektor addiert mit v
+
+
+
+ + + def + -(v : Vector2D) : Vector2D +
+
+
+
Vektorsubstraktion.
+
+ Parameters
v - zu substrahierender Vektor
+ Returns
dieser Vektor substrahiert mit v
+
+
+
+ + + def + *(n : Double) : Vector2D +
+
+
+
Multiplikation mit einem Skalar.
+
+ Parameters
n - Faktor
+ Returns
dieser Vektor multipliziert mit n
+
+
+
+ + + def + /(n : Double) : Vector2D +
+
+
+
Division durch ein Skalar.
+
+ Parameters
n - Nenner
+ Returns
dieser Vektor dividiert durch n
+
+
+
+ + + def + unary_- : Vector2D +
+
+
+
Minusvorzeichen.
+
+
+
+
+ + + def + dot(v : Vector2D) : Double +
+
+
+
Skalarprodukt.
+
+ Parameters
v - ein anderer Vektor
+ Returns
Skalarprodukt von diesem Vektor mit v
+
+
+
+ + + def + cross(v : Vector2D) : Double +
+
+
+
Kreuzprodukt. (Norm des Kreuzproduktes)
+
+ Parameters
v - ein anderer Vektor
+ Returns
Norm des Kreuzproduktes dieses Vektors mit v. Die Richtung wuerde der x3-Achse entsprechen.
+
+
+
+ + + def + unit : Vector2D +
+
+
+
Einheitsvektor dieses Vektors.
+
+
+
+
+ + + def + project(v : Vector2D) : Vector2D +
+
+
+
Errechnet die Projektion dieses- auf einen anderen Vektor.
+
+ Parameters
v - oben gennanter Vektor
+ Returns
Projektion dieses Vektors auf v
+
+
+
+ + + def + rotate(angle : Double) : Vector2D +
+
+
+
Errechnet eine Rotation dieses Vektors.
+
+ Parameters
angle - Winkel in Radian
+ Returns
der um angle rad rotierte Vektor
+
+
+
+ + + def + leftNormal : Vector2D +
+
+
+
Linker Normalenvektor. (-y, x)
+
+
+
+
+ + + def + rightNormal : Vector2D +
+
+
+
Rechter Normalenvektor. (y, -x)
+
+
+
+
+ + + def + isNull : Boolean +
+
+
+
Ueberprueft, ob die Komponenten dieses Vektors gleich Null sind.
+
+
+
+
+ + + def + components : scala.List[Double] +
+
+
+
Ergibt eine Liste der Komponenten dieses Vektors.
+
+
+
+
+ + 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/math$content.html b/doc/sims/math$content.html new file mode 100644 index 0000000..871d764 --- /dev/null +++ b/doc/sims/math$content.html @@ -0,0 +1,34 @@ + + + All classes and objects in sims.math + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + +
Class Summary
+ case class + + Matrix22 + (val c11 : Double, val c12 : Double, val c21 : Double, val c22 : Double) extends scala.Product + +
Eine 2x2, quadratische Matrix.
+
+ + + + + + +
Object Summary
+ object + + Matrix22 + extends AnyRef + + +
+ \ No newline at end of file diff --git a/doc/sims/math$package.html b/doc/sims/math$package.html new file mode 100644 index 0000000..ac34016 --- /dev/null +++ b/doc/sims/math$package.html @@ -0,0 +1,16 @@ + + + List of classes and objects in package sims.math + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/sims/math/Matrix22$object.html b/doc/sims/math/Matrix22$object.html new file mode 100644 index 0000000..9411340 --- /dev/null +++ b/doc/sims/math/Matrix22$object.html @@ -0,0 +1,98 @@ + + + object Matrix22 in sims.math + + + + + + + + + + + +
+ sims.math +

+ object Matrix22 +

+
+ [source: sims/math/Matrix22.scala] +

+
+
+ + + object + Matrix22 +
+
extends AnyRef
+
+ + + + + + + + + +
Method Summary
+ def + + apply + (c1 : Vector2D, c2 : Vector2D) : Matrix22 + + +
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + + def + apply(c1 : Vector2D, c2 : Vector2D) : Matrix22 +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/math/Matrix22.html b/doc/sims/math/Matrix22.html new file mode 100644 index 0000000..82cf176 --- /dev/null +++ b/doc/sims/math/Matrix22.html @@ -0,0 +1,448 @@ + + + class Matrix22 in sims.math + + + + + + + + + + + +
+ sims.math +

+ class Matrix22 +

+
+ [source: sims/math/Matrix22.scala] +

+
+
+ + case + class + Matrix22(val c11 : Double, val c12 : Double, val c21 : Double, val c22 : Double) +
+
extends scala.Product
+
+
Eine 2x2, quadratische Matrix.
+
+ Parameters
c11 - Komponente 1,1
c12 - Komponente 1,2
c21 - Komponente 2,1
c22 - Komponente 2,2
+ + + + + + + +
Additional Constructor Summary
+ def + + 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.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + * + (v : Vector2D) : Vector2D + +
Multiplikation mit einer 2x1-Matrix (2-dimensionaler Vektor).
+
+ def + + * + (n : Double) : Matrix22 + +
Multiplikation mit einem Skalar.
+
+ def + + * + (m : Matrix22) : Matrix22 + +
Multiplikation mit einer anderen 2x2-Matrix.
+
+ def + + + + (m : Matrix22) : Matrix22 + +
Addition.
+
+ def + + det + : Double + +
Ergibt die Determinante dieser Matrix.
+
+ 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.
+
+ def + + invert + : Matrix22 + +
Inverse.
+
+ 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.
+
+ + +
+ 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(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.
+
+ Parameters
c1 - erste Spalte
c2 - zweite Spalte
+
+ + + + +
Method Details
+
+ + + def + det : Double +
+
+
+
Ergibt die Determinante dieser Matrix.
+
+ Returns
Determinante dieser Matrix
+
+
+
+ + + def + +(m : Matrix22) : Matrix22 +
+
+
+
Addition.
+
+
+
+
+ + + def + *(n : Double) : Matrix22 +
+
+
+
Multiplikation mit einem Skalar.
+
+
+
+
+ + + def + *(m : Matrix22) : Matrix22 +
+
+
+
Multiplikation mit einer anderen 2x2-Matrix.
+
+
+
+
+ + + def + *(v : Vector2D) : Vector2D +
+
+
+
Multiplikation mit einer 2x1-Matrix (2-dimensionaler Vektor).
+
+
+
+
+ + + def + invert : Matrix22 +
+
+
+
Inverse.
+
+
+
+
+ + 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/prefabs$content.html b/doc/sims/prefabs$content.html new file mode 100644 index 0000000..dad597c --- /dev/null +++ b/doc/sims/prefabs$content.html @@ -0,0 +1,54 @@ + + + All classes and objects in sims.prefabs + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + + + + + + + + + +
Class Summary
+ class + + Net + (width : Int, height : Int, initPos : Vector2D) extends Prefab + + +
+ trait + + Prefab + extends AnyRef + + +
+ class + + Pylon + extends Prefab + + +
+ class + + Ragdoll + (position : Vector2D) extends Prefab + + +
+ + \ No newline at end of file diff --git a/doc/sims/prefabs$package.html b/doc/sims/prefabs$package.html new file mode 100644 index 0000000..490a2cf --- /dev/null +++ b/doc/sims/prefabs$package.html @@ -0,0 +1,17 @@ + + + List of classes and objects in package sims.prefabs + + + + +
Classes
+
+ \ No newline at end of file diff --git a/doc/sims/prefabs/Net.html b/doc/sims/prefabs/Net.html new file mode 100644 index 0000000..0298260 --- /dev/null +++ b/doc/sims/prefabs/Net.html @@ -0,0 +1,232 @@ + + + class Net in sims.prefabs + + + + + + + + + + + +
+ sims.prefabs +

+ class Net +

+
+ [source: sims/prefabs/Net.scala] +

+
+
+ + + class + Net(width : Int, height : Int, initPos : Vector2D) +
+
extends Prefab
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ override val + + bodies + : scala.List[Body] + + +
+ override val + + joints + : scala.List[DistanceJoint] + + +
+ val + + nodeDensity + : Double + + +
+ val + + nodeDistance + : Double + + +
+ val + + nodeRadius + : Double + + +
+ val + + springConstant + : Double + + +
+ val + + springDamping + : Double + + +
+ + + +
+ 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 + nodeDistance : Double +
+
+

+
+
+ + + val + nodeRadius : Double +
+
+

+
+
+ + + val + nodeDensity : Double +
+
+

+
+
+ + + val + springConstant : Double +
+
+

+
+
+ + + val + springDamping : Double +
+
+

+
+
+ + override + val + bodies : scala.List[Body] +
+
+
+
+ Overrides +
+
+ Prefab.bodies +
+

+
+
+ + override + val + joints : scala.List[DistanceJoint] +
+
+
+
+ Overrides +
+
+ Prefab.joints +
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/prefabs/Prefab.html b/doc/sims/prefabs/Prefab.html new file mode 100644 index 0000000..83deb42 --- /dev/null +++ b/doc/sims/prefabs/Prefab.html @@ -0,0 +1,121 @@ + + + trait Prefab in sims.prefabs + + + + + + + + + + + +
+ sims.prefabs +

+ trait Prefab +

+
+ [source: sims/prefabs/Prefab.scala] +

+
+
+ + + trait + Prefab +
+
extends AnyRef
+
+
Direct Known Subclasses:
+
Net, Pylon, Ragdoll
+

+ + + + + + + + + + + + +
Value Summary
+ val + + bodies + : scala.Iterable[Body] + + +
+ val + + joints + : scala.Iterable[Joint] + + +
+ + + +
+ 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 + bodies : scala.Iterable[Body] +
+
+

+
+
+ + + val + joints : scala.Iterable[Joint] +
+
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/prefabs/Pylon.html b/doc/sims/prefabs/Pylon.html new file mode 100644 index 0000000..cec9b30 --- /dev/null +++ b/doc/sims/prefabs/Pylon.html @@ -0,0 +1,272 @@ + + + class Pylon in sims.prefabs + + + + + + + + + + + +
+ sims.prefabs +

+ class Pylon +

+
+ [source: sims/prefabs/Pylon.scala] +

+
+
+ + + class + Pylon +
+
extends Prefab
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ val + + beamHeight + : Double + + +
+ val + + beamNumber + : Int + + +
+ val + + beamWidth + : Double + + +
+ lazy val + + beams + : scala.List[DistanceJoint] + + +
+ override val + + bodies + : scala.List[Body] + + +
+ override val + + joints + : scala.List[DistanceJoint] + + +
+ val + + nodeDensity + : Double + + +
+ lazy val + + nodes + : scala.List[Body] + + +
+ val + + position + : 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 + position : Vector2D +
+
+

+
+
+ + + val + nodeDensity : Double +
+
+

+
+
+ + + val + beamHeight : Double +
+
+

+
+
+ + + val + beamWidth : Double +
+
+

+
+
+ + + val + beamNumber : Int +
+
+

+
+
+ + + lazy val + nodes : scala.List[Body] +
+
+

+
+
+ + + lazy val + beams : scala.List[DistanceJoint] +
+
+

+
+
+ + override + val + bodies : scala.List[Body] +
+
+
+
+ Overrides +
+
+ Prefab.bodies +
+

+
+
+ + override + val + joints : scala.List[DistanceJoint] +
+
+
+
+ Overrides +
+
+ Prefab.joints +
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/prefabs/Ragdoll.html b/doc/sims/prefabs/Ragdoll.html new file mode 100644 index 0000000..f7cc846 --- /dev/null +++ b/doc/sims/prefabs/Ragdoll.html @@ -0,0 +1,432 @@ + + + class Ragdoll in sims.prefabs + + + + + + + + + + + +
+ sims.prefabs +

+ class Ragdoll +

+
+ [source: sims/prefabs/Ragdoll.scala] +

+
+
+ + + class + Ragdoll(position : Vector2D) +
+
extends Prefab
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Value Summary
+ override val + + bodies + : scala.List[Body] + + +
+ val + + foot1 + : Body + + +
+ val + + foot2 + : Body + + +
+ val + + forearm1 + : Body + + +
+ val + + forearm2 + : Body + + +
+ val + + hand1 + : Body + + +
+ val + + hand2 + : Body + + +
+ val + + headTorso + : Body + + +
+ override val + + joints + : scala.List[RevoluteJoint] + + +
+ val + + shoulder1 + : RevoluteJoint + + +
+ val + + shoulder2 + : RevoluteJoint + + +
+ val + + thigh1 + : Body + + +
+ val + + thigh2 + : Body + + +
+ val + + tibia1 + : Body + + +
+ val + + tibia2 + : Body + + +
+ val + + upperArm1 + : Body + + +
+ val + + upperArm2 + : Body + + +
+ + + +
+ 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 + headTorso : Body +
+
+

+
+
+ + + val + thigh1 : Body +
+
+

+
+
+ + + val + thigh2 : Body +
+
+

+
+
+ + + val + tibia1 : Body +
+
+

+
+
+ + + val + tibia2 : Body +
+
+

+
+
+ + + val + foot1 : Body +
+
+

+
+
+ + + val + foot2 : Body +
+
+

+
+
+ + + val + upperArm1 : Body +
+
+

+
+
+ + + val + upperArm2 : Body +
+
+

+
+
+ + + val + forearm1 : Body +
+
+

+
+
+ + + val + forearm2 : Body +
+
+

+
+
+ + + val + hand1 : Body +
+
+

+
+
+ + + val + hand2 : Body +
+
+

+
+
+ + override + val + bodies : scala.List[Body] +
+
+
+
+ Overrides +
+
+ Prefab.bodies +
+

+
+
+ + + val + shoulder1 : RevoluteJoint +
+
+

+
+
+ + + val + shoulder2 : RevoluteJoint +
+
+

+
+
+ + override + val + joints : scala.List[RevoluteJoint] +
+
+
+
+ Overrides +
+
+ Prefab.joints +
+

+ + + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/util$content.html b/doc/sims/util$content.html new file mode 100644 index 0000000..48b8a1e --- /dev/null +++ b/doc/sims/util$content.html @@ -0,0 +1,56 @@ + + + All classes and objects in sims.util + + +
Simple Mechanics Simulator (SiMS) API

This document is the API specification for SiMS

+ + + + + + + + + +
Class Summary
+ case class + + Polar + (val distance : Double, val angle : Double) extends scala.Product + +
Polare Koordinaten.
+
+ class + + RelativeVector + (val x : Double, val y : Double) extends AnyRef + + +
+ + + + + + + + + + +
Object Summary
+ object + + Polar + extends (Double, Double) => Polar + + +
+ object + + Positioning + extends AnyRef + +
Objekt mit Hiflsfunktionen fuer komfortables Positionieren von Koerpern.
+
+ \ No newline at end of file diff --git a/doc/sims/util$package.html b/doc/sims/util$package.html new file mode 100644 index 0000000..61c5bdc --- /dev/null +++ b/doc/sims/util$package.html @@ -0,0 +1,18 @@ + + + List of classes and objects in package sims.util + + + + +
Classes
+
Objects
+ \ No newline at end of file diff --git a/doc/sims/util/Polar$object.html b/doc/sims/util/Polar$object.html new file mode 100644 index 0000000..c1ae2b3 --- /dev/null +++ b/doc/sims/util/Polar$object.html @@ -0,0 +1,82 @@ + + + object Polar in sims.util + + + + + + + + + + + +
+ sims.util +

+ object Polar +

+
+ [source: sims/util/Polar.scala] +

+
+
+ + + object + Polar +
+
extends (Double, Double) => Polar
+
+ + + + + + +
+ Methods inherited from scala.Function2 +
+ scala.Function2.toString, scala.Function2.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/util/Polar.html b/doc/sims/util/Polar.html new file mode 100644 index 0000000..7f3f444 --- /dev/null +++ b/doc/sims/util/Polar.html @@ -0,0 +1,302 @@ + + + class Polar in sims.util + + + + + + + + + + + +
+ sims.util +

+ class Polar +

+
+ [source: sims/util/Polar.scala] +

+
+
+ + case + class + Polar(val distance : Double, val angle : Double) +
+
extends scala.Product
+
+
Polare Koordinaten.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ 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 + + +
+ def + + toCarthesian + : Vector2D + +
Ergibt die Vektorrepraesantation dieser polaren Koordinaten.
+
+ override def + + toString + : java.lang.String + +
Returns a string representation of the object.
+
+ + +
+ Methods inherited from AnyRef +
+ getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + + def + toCarthesian : Vector2D +
+
+
+
Ergibt die Vektorrepraesantation dieser polaren Koordinaten.
+
+
+
+
+ + 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/util/Positioning$object.html b/doc/sims/util/Positioning$object.html new file mode 100644 index 0000000..eecdee9 --- /dev/null +++ b/doc/sims/util/Positioning$object.html @@ -0,0 +1,201 @@ + + + object Positioning in sims.util + + + + + + + + + + + +
+ sims.util +

+ object Positioning +

+
+ [source: sims/util/Positioning.scala] +

+
+
+ + + object + Positioning +
+
extends AnyRef
+
+
Objekt mit Hiflsfunktionen fuer komfortables Positionieren von Koerpern.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ implicit def + + double2RelativeVector + (x : Double) : RelativeVector + + +
+ implicit def + + int2RelativeVector + (x : Int) : RelativeVector + + +
+ implicit def + + polar2Carthesian + (p : Polar) : Vector2D + + +
+ implicit def + + polar2RelativeVector + (p : Polar) : RelativeVector + + +
+ def + + position + (s : Shape)(a : Vector2D) : Unit + + +
+ implicit def + + vector2RelativeVector + (v : Vector2D) : RelativeVector + + +
+ + +
+ Methods inherited from AnyRef +
+ getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized +
+ + +
+ Methods inherited from Any +
+ ==, !=, isInstanceOf, asInstanceOf +
+ + + + + + + +
Method Details
+
+ + implicit + def + int2RelativeVector(x : Int) : RelativeVector +
+
+

+
+
+ + implicit + def + double2RelativeVector(x : Double) : RelativeVector +
+
+

+
+
+ + implicit + def + vector2RelativeVector(v : Vector2D) : RelativeVector +
+
+

+
+
+ + implicit + def + polar2Carthesian(p : Polar) : Vector2D +
+
+

+
+
+ + implicit + def + polar2RelativeVector(p : Polar) : RelativeVector +
+
+

+
+
+ + + def + position(s : Shape)(a : Vector2D) : Unit +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/sims/util/RelativeVector.html b/doc/sims/util/RelativeVector.html new file mode 100644 index 0000000..defc526 --- /dev/null +++ b/doc/sims/util/RelativeVector.html @@ -0,0 +1,278 @@ + + + class RelativeVector in sims.util + + + + + + + + + + + +
+ sims.util +

+ class RelativeVector +

+
+ [source: sims/util/RelativeVector.scala] +

+
+
+ + + class + RelativeVector(val x : Double, val y : Double) +
+
extends AnyRef
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
+ def + + above + (s : Shape) : Vector2D + + +
+ def + + above + (point : Vector2D) : Vector2D + + +
+ def + + below + (point : Vector2D) : Vector2D + + +
+ def + + below + (s : Shape) : Vector2D + + +
+ def + + from + (s : Shape) : Vector2D + + +
+ def + + from + (point : Vector2D) : Vector2D + + +
+ def + + left + (point : Vector2D) : Vector2D + + +
+ def + + left + (s : Shape) : Vector2D + + +
+ def + + right + (point : Vector2D) : Vector2D + + +
+ def + + right + (s : Shape) : 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 +
+ + + + + + + +
Method Details
+
+ + + def + above(point : Vector2D) : Vector2D +
+
+

+
+
+ + + def + below(point : Vector2D) : Vector2D +
+
+

+
+
+ + + def + left(point : Vector2D) : Vector2D +
+
+

+
+
+ + + def + right(point : Vector2D) : Vector2D +
+
+

+
+
+ + + def + from(point : Vector2D) : Vector2D +
+
+

+
+
+ + + def + above(s : Shape) : Vector2D +
+
+

+
+
+ + + def + below(s : Shape) : Vector2D +
+
+

+
+
+ + + def + left(s : Shape) : Vector2D +
+
+

+
+
+ + + def + right(s : Shape) : Vector2D +
+
+

+
+
+ + + def + from(s : Shape) : Vector2D +
+
+

+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..e243249 --- /dev/null +++ b/doc/style.css @@ -0,0 +1,148 @@ +/* Scaladoc style sheet */ + +a:link { + color: #0000ee; +} + +a:visited { + color: #551a8b; +} + +a:active { + color: #0000ee; +} + +body { + background-color: #ffffff; +} + +div.entity { + margin: 18px 0px 18px 0px; + font-size: x-large; + font-weight: bold; +} + +div.doctitle { + font-weight: bold; + font-style: italic; +} + +div.doctitle-larger { + margin: 0px 0px 10px 0px; + font-size: larger; + font-weight: bold; +} + +div.kinds { + margin: 0.6em 0 0 0; /* top right bottom left */ + font-weight: bold; +} + +div.page-title { + margin: 15px 0px 15px 0px; + font-size: x-large; + font-weight: bold; + text-align: center; +} + +div.source { + font-size: smaller; + color: gray; +} + +span.entity { + color: #ff6666; +} + +table.member { + margin: 0 0 1.2em 0; /* top rigth bottom left */ + border-collapse: collapse; + border: 2px inset #888888; + width: 100%; +} + +table.member td.title { + border: 2px inset #888888; + background-color: #ccccff; + font-size: x-large; + font-weight: bold; +} + +table.inherited { + margin: 0 0 1.2em 0; /* top rigth bottom left */ + border-collapse: collapse; + border: 2px inset #888888; + width: 100%; +} + +table.inherited td.title { + background-color: #eeeeff; + font-weight: bold; +} + +table.member-detail { + margin: 10px 0px 0px 0px; + border-collapse: collapse; + border: 2px inset #888888; + background-color: #ffffff; + width: 100%; +} + +table.member-detail td.title { + border: 2px inset #888888; + background-color: #ccccff; + font-size: x-large; + font-weight: bold; +} + +table.navigation { + border-collapse: collapse; + width: 100%; + font-family: Arial,Helvetica,Sans-Serif; +} + +td.inherited-members { + border-top: 2px inset #888888; + border-right: 0px; +} + +td.inherited-owner { + background-color: #eeeeff; + font-weight: bold; +} + +td.modifiers { + border-top: 2px inset #888888; + border-right: 2px inset #888888; + width: 50px; + text-align: right; +} + +td.navigation-enabled { + font-weight: bold; + color: #000000; + background-color: #eeeeff; +} + +td.navigation-links { + width: 100%; + background-color: #eeeeff; +} + +td.navigation-selected { + font-weight: bold; + color: #ffffff; + background-color: #00008b; +} + +td.signature { + border-top: 2px inset #888888; + width: 90%; +} + +ul.list { + margin: 0; + padding: 0; + list-style: none; +} + diff --git a/src/graphyx/Graphyx.scala b/src/graphyx/Graphyx.scala new file mode 100644 index 0000000..cfd67c6 --- /dev/null +++ b/src/graphyx/Graphyx.scala @@ -0,0 +1,60 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx + +import graphyx.actors._ +import graphyx.graphics._ +import graphyx.tests._ +import sims.geometry._ +import sims.dynamics._ + +object Graphyx{ + + val tests: List[graphyx.tests.Test] = List( + CompositeShape, + Joints1, + Joints2, + Chain, + Stacking, + BallStack, + Cup, + Net, + Friction, + Friction2, + Restitution, + RagdollTest, + General1, + General2, + EmptyTest + ) + + private var _test: graphyx.tests.Test = tests(0) + def test = _test + def test_=(t: graphyx.tests.Test) = { + t.world.time = 0 + t.world.clear() + t.init() + physicsActor ! SetWorld(t.world) + _test = t + } + + val physicsActor = new PhysicsActor + val guiActor = new GUIActor + + def main(args: Array[String]): Unit = { + test.init() + physicsActor.world = test.world + guiActor.start() + physicsActor.start() + } + + def exit() = { + guiActor.container.exitGUI + guiActor ! Exit + physicsActor ! Exit + } +} diff --git a/src/graphyx/actors/GUIActor.scala b/src/graphyx/actors/GUIActor.scala new file mode 100644 index 0000000..a704f6a --- /dev/null +++ b/src/graphyx/actors/GUIActor.scala @@ -0,0 +1,32 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.actors + +import graphyx.graphics._ +import graphyx.gui._ +import scala.actors._ + +class GUIActor extends Actor{ + val container = new Container + + var continue = true + + def act() = { + container.show() + println("GUI actor started.") + while (continue) { + receive { + case Exit => { + continue = false + } + case s @ Scene(_) => container.update(s) + case other => println("Engine received unknown command: " + other) + } + } + println("GUI actor exited.") + } +} diff --git a/src/graphyx/actors/PhysicsActor.scala b/src/graphyx/actors/PhysicsActor.scala new file mode 100644 index 0000000..b93541f --- /dev/null +++ b/src/graphyx/actors/PhysicsActor.scala @@ -0,0 +1,72 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.actors + +import graphyx.graphics._ +import sims.dynamics._ +import scala.actors._ +class PhysicsActor extends Actor{ + var world = new World + + var continue = true + var simulate = false + + private var _fps = 0 + def fps = _fps + + def act{ + println("Physics actor started.") + while (continue) { + + var t0 = System.nanoTime + + if (simulate) { + world.step() + } + + Graphyx.guiActor ! new Scene(world) {override val fps = _fps} + + while (mailboxSize > 0) { + receive { + case Stop => { + simulate = false + println("Simulation stopped.") + } + case Start => { + simulate = true + println("Simulation started.") + } + case Exit => { + continue = false + } + case sw @ SetWorld(w: World) => world = w + + case FireEvent => Graphyx.test.fireEvent() + + case other => println("Engine received unknown command: '" + other + "'") + } + } + + val h = (System.nanoTime - t0) / 1000000 + val f = 60 + val T = (1.0/f) * 1000 + if (T-h > 0) + Thread.sleep((T-h).toLong) + _fps = (1.0/((System.nanoTime - t0) / 1000000000.0)).toInt + //println((1.0/((System.nanoTime - t0) / 1000000000.0)).toInt) + } + println("Physics actor exited.") + } +} + +case object Start +case object Stop +case object Exit +case class SetWorld(world: World) +case object FireEvent + + diff --git a/src/graphyx/graphics/Drawable.scala b/src/graphyx/graphics/Drawable.scala new file mode 100644 index 0000000..fefd97d --- /dev/null +++ b/src/graphyx/graphics/Drawable.scala @@ -0,0 +1,118 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.geometry._ + +/**Enthaelt Methoden und Felder fuer graphische Darstellungen. + * Alle Klassen die dieses Trait implementieren koennen graphisch dargestellt werden.*/ +trait Drawable { + + /**Java Graphics Objekt zur graphischen Darstellung*/ + var g: java.awt.Graphics = _ + + /**Anzahl von Pixeln pro Meter.*/ + var ppm: Double = 39.37007874015748 * 96 //ppm = i/m * p/i + + /**Skala in der die graphischen Objekte gezeichnet werden.*/ + var scale: Double = 1.0/100.0 + + /**Hoehe des Fensters in Pixeln.*/ + var windowHeight = 0 + + /**Korrigiert einen Y-Wert in Bildschirmkoordinaten zu seinem kartesischen Aequivalent. + * @param y zu korrigierender Wert*/ + def correctY(y: Double) = windowHeight - y + + /**Malt eine Linie auf g. + * @param startPoint Startpunkt in Weltkoordinaten + * @param endPoint Endpunkt in Weltkoordinaten*/ + def drawLine(startPoint: Vector2D, endPoint: Vector2D) = { + val x1 = startPoint.x * scale * ppm + val y1 = correctY(startPoint.y * scale * ppm) + val x2 = endPoint.x * scale * ppm + val y2 = correctY(endPoint.y * scale * ppm) + g.drawLine(x1.toInt, y1.toInt, x2.toInt, y2.toInt) + } + + /**Malt ein massives Polygon auf g. + * @param points Eckpunkte des Polygons in Weltkoordinaten*/ + def fillPolygon(points: Seq[Vector2D]) = { + val xs = points map ((v: Vector2D) => (v.x * scale * ppm).toInt) + val ys = points map ((v: Vector2D) => correctY((v.y) * scale * ppm).toInt) + g.fillPolygon(xs.toArray, ys.toArray, points.length) + } + + /**Malt ein Polygon auf g. + * @param points Eckpunkte des Polygons in Weltkoordinaten*/ + def drawPolygon(points: Seq[Vector2D]) = { + val xs = points map ((v: Vector2D) => (v.x * scale * ppm).toInt) + val ys = points map ((v: Vector2D) => correctY((v.y) * scale * ppm).toInt) + g.drawPolygon(xs.toArray, ys.toArray, points.length) + } + + /**Malt einen massiven Kreis auf g. + * @param center Mitte des Kreises in Weltkoordinaten + * @param radius Radius des Kreises*/ + def fillCircle(center: Vector2D, radius: Double) = { + g.fillOval(((center.x - radius) * scale * ppm).toInt, + correctY((center.y + radius) * scale * ppm).toInt, + (radius * scale * ppm * 2).toInt, + (radius * scale * ppm * 2).toInt) + } + + /**Malt einen Kreis auf g. + * @param center Mitte des Kreises in Weltkoordinaten + * @param radius Radius des Kreises*/ + def drawCircle(center: Vector2D, radius: Double) = { + g.drawOval(((center.x - radius) * scale * ppm).toInt, + correctY((center.y + radius) * scale * ppm).toInt, + (radius * scale * ppm * 2).toInt, + (radius * scale * ppm * 2).toInt) + } + + /**Malt einen Punkt auf g. + *

+ * Der Punkt wird von einem Kreis umgeben. + * @param point Punkt in Weltkoordinaten*/ + def drawPoint(point: Vector2D) = { + val radius = 4 //in pixel + g.drawLine((point.x * scale * ppm).toInt, + correctY(point.y * scale * ppm).toInt - radius, + (point.x * scale * ppm).toInt, + correctY(point.y * scale * ppm).toInt + radius) + g.drawLine((point.x * scale * ppm).toInt - radius, + correctY(point.y * scale * ppm).toInt, + (point.x * scale * ppm).toInt + radius, + correctY(point.y * scale * ppm).toInt) + g.drawOval((point.x * scale * ppm).toInt - radius, + correctY(point.y * scale * ppm).toInt - radius, + (radius * 2).toInt, + (radius * 2).toInt) + + } + + + /**Malt einen Vektor auf g. + * @param v Vektor in Weltkoordinaten + * @param p Ursprungspunkt in Weltkoordinaten + */ + def drawVector(v: Vector2D, p: Vector2D) = { + if (!v.isNull) { + val ep = p + v + val a1 = ep - ((v.unit rotate (Math.Pi / 6)) * 0.08) + val a2 = ep - ((v.unit rotate (-Math.Pi / 6)) * 0.08) + + g.drawLine((p.x * scale * ppm).toInt, correctY(p.y * scale * ppm).toInt, (ep.x * scale * ppm).toInt, correctY(ep.y * scale * ppm).toInt) + g.drawLine((a1.x * scale * ppm).toInt, correctY(a1.y * scale * ppm).toInt, (ep.x * scale * ppm).toInt, correctY(ep.y * scale * ppm).toInt) + g.drawLine((a2.x * scale * ppm).toInt, correctY(a2.y * scale * ppm).toInt, (ep.x * scale * ppm).toInt, correctY(ep.y * scale * ppm).toInt) + } + } + + /**Stellt das graphische Objekt dar.*/ + def draw(): Unit +} \ No newline at end of file diff --git a/src/graphyx/graphics/GraphicalAABB.scala b/src/graphyx/graphics/GraphicalAABB.scala new file mode 100644 index 0000000..3d8999c --- /dev/null +++ b/src/graphyx/graphics/GraphicalAABB.scala @@ -0,0 +1,18 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.collision._ +case class GraphicalAABB(real: AABB) extends AABB(real.minVertex, real.maxVertex) with GraphicalObject { + override def draw() = { + g.setColor(java.awt.Color.BLACK) + g.drawRect((minVertex.x * scale * ppm).toInt, + correctY(maxVertex.y * scale * ppm).toInt, + ((maxVertex - minVertex).x * scale * ppm).toInt, + ((maxVertex - minVertex).y * scale * ppm).toInt) + } +} diff --git a/src/graphyx/graphics/GraphicalBody.scala b/src/graphyx/graphics/GraphicalBody.scala new file mode 100644 index 0000000..c78ea51 --- /dev/null +++ b/src/graphyx/graphics/GraphicalBody.scala @@ -0,0 +1,42 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.dynamics._ + +case class GraphicalBody(real: Body) extends GraphicalObject { + val pos = real.pos + val fixed = real.fixed + val monitor = real.monitor + def draw() = { + val radius = 4 + val posX = (pos.x * scale * ppm).toInt + val posY = correctY(pos.y * scale * ppm).toInt + g.setColor(java.awt.Color.yellow) + g.fillArc(posX - radius, + posY - radius, + (radius * 2).toInt, + (radius * 2).toInt, + 0, 90) + g.fillArc(posX - radius, + posY - radius, + (radius * 2).toInt, + (radius * 2).toInt, + 180, 90) + g.setColor(java.awt.Color.black) + g.fillArc(posX - radius, + posY - radius, + (radius * 2).toInt, + (radius * 2).toInt, + 90, 90) + g.fillArc(posX - radius, + posY - radius, + (radius * 2).toInt, + (radius * 2).toInt, + 270, 90) + } +} diff --git a/src/graphyx/graphics/GraphicalCircle.scala b/src/graphyx/graphics/GraphicalCircle.scala new file mode 100644 index 0000000..31f057d --- /dev/null +++ b/src/graphyx/graphics/GraphicalCircle.scala @@ -0,0 +1,22 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims._ +import geometry._ +import dynamics._ +case class GraphicalCircle(real: Circle) extends Circle(real.radius, real.density) with GraphicalShape{ + override def draw() = { + //val b = Math.min(density / 100 * 255, 255) + //g.setColor(new java.awt.Color(0,0,255, b.toInt)) + g.setColor(java.awt.Color.blue) + fillCircle(pos, real.radius) + g.setColor(java.awt.Color.BLACK) + drawCircle(pos, real.radius) + this.drawLine(pos, pos + (Vector2D.i rotate rotation) * real.radius) + } +} diff --git a/src/graphyx/graphics/GraphicalCollision.scala b/src/graphyx/graphics/GraphicalCollision.scala new file mode 100644 index 0000000..5589f8c --- /dev/null +++ b/src/graphyx/graphics/GraphicalCollision.scala @@ -0,0 +1,18 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.collision._ + +case class GraphicalCollision(real: Collision) extends GraphicalObject{ + val points = real.points + val normal = real.normal + def draw() = { + g.setColor(java.awt.Color.GREEN) + for (p <- points) {drawPoint(p); drawVector(normal, p)} + } +} \ No newline at end of file diff --git a/src/graphyx/graphics/GraphicalDistanceJoint.scala b/src/graphyx/graphics/GraphicalDistanceJoint.scala new file mode 100644 index 0000000..4a6e49d --- /dev/null +++ b/src/graphyx/graphics/GraphicalDistanceJoint.scala @@ -0,0 +1,19 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.dynamics.joints._ + +case class GraphicalDistanceJoint(real: DistanceJoint) extends GraphicalJoint { + val connection1 = real.connection1 + val connection2 = real.connection2 + + def draw() = { + g.setColor(java.awt.Color.BLACK) + drawLine(connection1, connection2) + } +} diff --git a/src/graphyx/graphics/GraphicalJoint.scala b/src/graphyx/graphics/GraphicalJoint.scala new file mode 100644 index 0000000..27d4f83 --- /dev/null +++ b/src/graphyx/graphics/GraphicalJoint.scala @@ -0,0 +1,12 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.dynamics.joints._ +trait GraphicalJoint extends GraphicalObject{ + val real: Joint +} diff --git a/src/graphyx/graphics/GraphicalObject.scala b/src/graphyx/graphics/GraphicalObject.scala new file mode 100644 index 0000000..3c56de6 --- /dev/null +++ b/src/graphyx/graphics/GraphicalObject.scala @@ -0,0 +1,15 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +/**Only copies functional info! (e.g. Graphical world does not include shapes, bodies).*/ +trait GraphicalObject extends Drawable{ + + /**Pointer to real object.*/ + val real: AnyRef + def draw(): Unit +} diff --git a/src/graphyx/graphics/GraphicalPair.scala b/src/graphyx/graphics/GraphicalPair.scala new file mode 100644 index 0000000..72e72ae --- /dev/null +++ b/src/graphyx/graphics/GraphicalPair.scala @@ -0,0 +1,18 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.collision._ +case class GraphicalPair(real: Pair) extends GraphicalObject{ + val pos1 = real.s1.pos + val pos2 = real.s2.pos + + def draw() = { + g.setColor(java.awt.Color.ORANGE) + drawLine(pos1, pos2) + } +} diff --git a/src/graphyx/graphics/GraphicalRectangle.scala b/src/graphyx/graphics/GraphicalRectangle.scala new file mode 100644 index 0000000..d3774bb --- /dev/null +++ b/src/graphyx/graphics/GraphicalRectangle.scala @@ -0,0 +1,18 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims._ +import sims.dynamics._ +case class GraphicalRectangle(real: Rectangle) extends Rectangle(real.halfWidth, real.halfHeight, real.density) with GraphicalShape { + override def draw() = { + g.setColor(java.awt.Color.red) + fillPolygon(vertices) + g.setColor(java.awt.Color.BLACK) + drawPolygon(vertices) + } +} diff --git a/src/graphyx/graphics/GraphicalRegularPolygon.scala b/src/graphyx/graphics/GraphicalRegularPolygon.scala new file mode 100644 index 0000000..919b857 --- /dev/null +++ b/src/graphyx/graphics/GraphicalRegularPolygon.scala @@ -0,0 +1,20 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims._ +import geometry._ +import dynamics._ +case class GraphicalRegularPolygon(real: RegularPolygon) extends RegularPolygon(real.n, real.radius, real.density) with GraphicalShape{ + override def draw() = { + g.setColor(java.awt.Color.orange) + fillPolygon(vertices) + g.setColor(java.awt.Color.BLACK) + drawPolygon(vertices) + } + +} diff --git a/src/graphyx/graphics/GraphicalRevoluteJoint.scala b/src/graphyx/graphics/GraphicalRevoluteJoint.scala new file mode 100644 index 0000000..940a862 --- /dev/null +++ b/src/graphyx/graphics/GraphicalRevoluteJoint.scala @@ -0,0 +1,20 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.geometry._ +import sims.dynamics.joints._ + +case class GraphicalRevoluteJoint(real: RevoluteJoint) extends GraphicalJoint { + val connection1 = real.connection1 + + def draw(): Unit = { + g.setColor(java.awt.Color.darkGray) + drawPoint(connection1) + } + +} diff --git a/src/graphyx/graphics/GraphicalShape.scala b/src/graphyx/graphics/GraphicalShape.scala new file mode 100644 index 0000000..e6f61a7 --- /dev/null +++ b/src/graphyx/graphics/GraphicalShape.scala @@ -0,0 +1,15 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.dynamics._ +trait GraphicalShape extends Shape with GraphicalObject{ + val real: Shape + override val uid: Int = real.uid + pos = real.pos + rotation = real.rotation +} \ No newline at end of file diff --git a/src/graphyx/graphics/GraphicalSpringJoint.scala b/src/graphyx/graphics/GraphicalSpringJoint.scala new file mode 100644 index 0000000..dbd9d5f --- /dev/null +++ b/src/graphyx/graphics/GraphicalSpringJoint.scala @@ -0,0 +1,18 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.dynamics.joints._ + +case class GraphicalSpringJoint(real: SpringJoint) extends GraphicalJoint { + val connection1 = real.connection1 + val connection2 = real.connection2 + def draw(): Unit = { + g.setColor(java.awt.Color.GRAY) + drawLine(connection1, connection2) + } +} diff --git a/src/graphyx/graphics/GraphicalWorld.scala b/src/graphyx/graphics/GraphicalWorld.scala new file mode 100644 index 0000000..2837d69 --- /dev/null +++ b/src/graphyx/graphics/GraphicalWorld.scala @@ -0,0 +1,19 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.dynamics._ +case class GraphicalWorld(real: World){ + val time = real.time + val timeStep = real.timeStep + val iterations = real.iterations + val overCWarning = real.overCWarning + val gravity = real.gravity + val monitorResults = for (b <- real.bodies; m <- real.monitors; if (b.monitor)) yield "b" + b.uid.toString + " " + m._1 + ": " + m._2(b) + val enableCollisionDetection = real.enableCollisionDetection + val enablePositionCorrection = real.enablePositionCorrection +} diff --git a/src/graphyx/graphics/Parser.scala b/src/graphyx/graphics/Parser.scala new file mode 100644 index 0000000..7871ae8 --- /dev/null +++ b/src/graphyx/graphics/Parser.scala @@ -0,0 +1,34 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.collision._ +import sims.dynamics._ +import sims.dynamics.joints._ +object Parser { + + val throwOnUnknown = false + + def toGraphical(real: Shape) = real match { + case c: Circle => GraphicalCircle(c) + case r: Rectangle => GraphicalRectangle(r) + case p: RegularPolygon => GraphicalRegularPolygon(p) + case _ => throw new IllegalArgumentException("Cannot cast '" + real.getClass + "' to a graphical object.") + } + + def toGraphical(real: Joint) = real match { + case j: DistanceJoint => GraphicalDistanceJoint(j) + case j: SpringJoint => GraphicalSpringJoint(j) + case j: RevoluteJoint => GraphicalRevoluteJoint(j) + case _ => throw new IllegalArgumentException("Cannot cast '" + real.getClass + "' to a graphical object.") + } + + def toGraphical(real: Collision) = GraphicalCollision(real) + def toGraphical(real: Pair) = GraphicalPair(real) + def toGraphical(real: AABB) = GraphicalAABB(real) + def toGraphical(real: Body) = GraphicalBody(real) +} diff --git a/src/graphyx/graphics/Scene.scala b/src/graphyx/graphics/Scene.scala new file mode 100644 index 0000000..bb1fd9e --- /dev/null +++ b/src/graphyx/graphics/Scene.scala @@ -0,0 +1,24 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.geometry._ +import sims.collision._ +import sims.dynamics._ +import sims.dynamics.joints._ +import collection.mutable._ + +case class Scene(real: World) { + val world: GraphicalWorld = GraphicalWorld(real) + val shapes = for (s: Shape <- real.shapes) yield Parser.toGraphical(s) + val joints = for (j: Joint <- real.joints) yield Parser.toGraphical(j) + val bodies = for (b: Body <- real.bodies) yield Parser.toGraphical(b) + val collisions = for (c: Collision <- real.detector.collisions) yield Parser.toGraphical(c) + val pairs = for (p: Pair <- real.detector.asInstanceOf[GridDetector].pairs) yield Parser.toGraphical(p) + val aabbs = for (s: Shape <- real.shapes) yield Parser.toGraphical(s.AABB) + val fps = 0 +} diff --git a/src/graphyx/gui/AboutHelpFrame.scala b/src/graphyx/gui/AboutHelpFrame.scala new file mode 100644 index 0000000..5afa58e --- /dev/null +++ b/src/graphyx/gui/AboutHelpFrame.scala @@ -0,0 +1,22 @@ +package graphyx.gui + +import graphyx.actors._ +import graphyx.gui._ +import scala.swing._ +import scala.swing.event._ + +class AboutHelpFrame extends Frame { + title = "About" + contents = new TextArea( + """|Graphyx, testing and visualization tool for SiMS. + | + |copyright (c) 2009 Jakob Odersky + |SiMS and Graphyx are made available under the MIT License + | + |http://sourceforge.net/projects/simplemechanics/""".stripMargin + ) +} + +object AboutHelpFrame { + val frame = new AboutHelpFrame +} diff --git a/src/graphyx/gui/BodyPopup.scala b/src/graphyx/gui/BodyPopup.scala new file mode 100644 index 0000000..998a440 --- /dev/null +++ b/src/graphyx/gui/BodyPopup.scala @@ -0,0 +1,41 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import scala.swing._ +import scala.swing.event._ +import sims.dynamics._ +import graphyx.graphics._ + +class BodyPopup extends PopupMenu { + private var b: Body = _ + def body = b + def body_=(newBody: Body) = { + b = newBody + chckFixed.selected = b.fixed + chckMonitor.selected = b.monitor + } + + val chckMonitor = new CheckMenuItem("Monitor") + val chckFixed = new CheckMenuItem("Fixed") + val btnClose = new MenuItem("Close") + + add(chckMonitor) + add(chckFixed) + add(btnClose) + listenTo(chckMonitor, chckFixed, btnClose) + reactions += { + case ButtonClicked(b) => {setVisible(false) + b match { + case `chckMonitor` => body.monitor = chckMonitor.selected + case `chckFixed` => body.fixed = chckFixed.selected + case `btnClose` => () + case _ => () + } + } + } +} \ No newline at end of file diff --git a/src/graphyx/gui/Container.scala b/src/graphyx/gui/Container.scala new file mode 100644 index 0000000..5181df7 --- /dev/null +++ b/src/graphyx/gui/Container.scala @@ -0,0 +1,33 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import graphyx.graphics._ +import sims.dynamics._ + +class Container { + val mainFrame = new MainFrame(this) + + var scene: Scene = Scene(new World) + + def show() = { + mainFrame.visible = true + } + + def update(s: Scene) = { + scene = s + mainFrame.mainPanel.worldPanel.update() + mainFrame.mainPanel.infoPanel.update() + mainFrame.mainPanel.optionsPanel.update() + mainFrame.mainPanel.gravityPanel.update() + } + + def exitGUI() = { + mainFrame.dispose + AboutHelpFrame.frame.dispose + } +} diff --git a/src/graphyx/gui/ControlPanel.scala b/src/graphyx/gui/ControlPanel.scala new file mode 100644 index 0000000..2708d54 --- /dev/null +++ b/src/graphyx/gui/ControlPanel.scala @@ -0,0 +1,36 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import graphyx.actors._ +import graphyx.gui._ +import scala.swing._ +import scala.swing.event._ + +class ControlPanel(container: Container) extends BoxPanel(Orientation.Horizontal) { + val btnStart = new Button {text = "Start"} //; icon = new javax.swing.ImageIcon("""play.png"""); tooltip = "Start"} + val btnStep = new Button {text = "Step"} + val btnStop = new Button {text = "Stop"} + val btnExit = new Button {text = "Exit"} + val btnFire = new Button {text = "Fire!"} + val btnReset = new Button {text = "Reset"} + val cboTest = new ComboBox(Graphyx.tests) + + contents ++= List(btnStart, btnStep, btnStop, btnExit, new Separator, btnFire, btnReset, cboTest) + + listenTo(btnStart, btnStep, btnStop, btnExit, btnFire, btnReset, cboTest.selection) + reactions += { + case ButtonClicked(`btnStart`) => Graphyx.physicsActor ! Start + case ButtonClicked(`btnStop`) => Graphyx.physicsActor ! Stop + case ButtonClicked(`btnStep`) => Graphyx.physicsActor.world.step() + case ButtonClicked(`btnExit`) => Graphyx.exit + case ButtonClicked(`btnFire`) => Graphyx.physicsActor ! FireEvent + case ButtonClicked(`btnReset`) => Graphyx.test = Graphyx.tests(cboTest.selection.index) + case SelectionChanged(`cboTest`) => Graphyx.test = Graphyx.tests(cboTest.selection.index) + } + +} diff --git a/src/graphyx/gui/GravityPanel.scala b/src/graphyx/gui/GravityPanel.scala new file mode 100644 index 0000000..bdf5245 --- /dev/null +++ b/src/graphyx/gui/GravityPanel.scala @@ -0,0 +1,83 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import scala.swing._ +import scala.swing.event._ +import scala.swing.GridBagPanel._ +import sims.geometry._ + +class GravityPanel(container: Container) extends GridBagPanel{ + + val c = new Constraints + c.fill = Fill.Both + this.border = Swing.EmptyBorder(3,3,3,3) + + val sldX = new Slider {max = 500; min = -500; preferredSize = minimumSize} + val lblX = new Label("0.0") + val sldY = new Slider {max = 500; min = -500; preferredSize = minimumSize} + val lblY = new Label("-9.81") + + c.gridx = 0 + c.gridy = 0 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(new Label("Gravity"), c) + + c.gridx = 0 + c.gridy = 1 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(new Label("X: "), c) + + c.gridx = 1 + c.gridy = 1 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(sldX, c) + + c.gridx = 2 + c.gridy = 1 + c.weightx = 0.0 + c.weighty = 0.0 + super.add(lblX, c) + + c.gridx = 0 + c.gridy = 2 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(new Label("Y: "), c) + + c.gridx = 1 + c.gridy = 2 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(sldY, c) + + c.gridx = 2 + c.gridy = 2 + c.weightx = 0.0 + c.weighty = 0.0 + super.add(lblY, c) + + + listenTo(sldX, sldY) + + reactions += { + case ValueChanged(s) if (s == sldX || s == sldY) => + container.scene.real.gravity = Vector2D(sldX.value / 10.0, sldY.value / 10.0) + } + + def update() = { + val g = container.scene.world.gravity + sldX.value = (g.x * 10).toInt + lblX.text = ((g.x * 10).toInt / 10.0).toString + sldY.value = (g.y * 10).toInt + lblY.text = ((g.y * 10).toInt / 10.0).toString + } + +} diff --git a/src/graphyx/gui/InfoPanel.scala b/src/graphyx/gui/InfoPanel.scala new file mode 100644 index 0000000..484f3d7 --- /dev/null +++ b/src/graphyx/gui/InfoPanel.scala @@ -0,0 +1,28 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import scala.swing._ +class InfoPanel(container: Container) extends BoxPanel(Orientation.Vertical){ + preferredSize = (200, 50) + + val out = new TextArea + out.editable = false + contents += out + border = Swing.EmptyBorder(3,3,3,3) + + def update() = { + out.text = "fps=" + container.scene.fps + "\n" + + "t=" + container.scene.world.time.formatted("%f") + "\n" + if (container.scene.world.overCWarning) { + out.foreground = java.awt.Color.red + out.text += "Warning: some bodies passed the speed of light! Simulation may be highly incorrect.\n" + } + else out.foreground = java.awt.Color.black + for (r <- container.scene.world.monitorResults) out.text += r + "\n" + } +} diff --git a/src/graphyx/gui/MainFrame.scala b/src/graphyx/gui/MainFrame.scala new file mode 100644 index 0000000..89812a5 --- /dev/null +++ b/src/graphyx/gui/MainFrame.scala @@ -0,0 +1,23 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import sims._ +import scala.swing._ + +class MainFrame(container: Container) extends Frame{ + super.background = java.awt.Color.WHITE + title = "graphyx" + preferredSize = (1000,800) + reactions += { + case event.WindowClosing(w) => Graphyx.exit() + } + + val mainPanel = new MainPanel(container) + contents = mainPanel + +} diff --git a/src/graphyx/gui/MainPanel.scala b/src/graphyx/gui/MainPanel.scala new file mode 100644 index 0000000..e4989e8 --- /dev/null +++ b/src/graphyx/gui/MainPanel.scala @@ -0,0 +1,77 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import graphyx.graphics._ +import sims._ +import scala.swing._ +import swing.event._ +import GridBagPanel._ +import java.awt.Insets + +class MainPanel(container: Container) extends scala.swing.GridBagPanel { + val c = new Constraints + + val menuPanel = new MenuPanel(container) + val worldPanel = new WorldPanel(container) + val controlPanel = new ControlPanel(container) + val infoPanel = new InfoPanel(container) + val optionsPanel = new OptionsPanel(container) + val shapeInfoPanel = new ShapeInfoPanel(container) + val gravityPanel = new GravityPanel(container) + + val splitter = new SplitPane { + orientation = Orientation.Vertical + continuousLayout = true + resizeWeight = 1 + dividerSize = 2 + leftComponent = worldPanel + rightComponent = new SplitPane { + orientation = Orientation.Horizontal + continuousLayout = true + resizeWeight = 1 + dividerSize = 2 + topComponent = new SplitPane{ + orientation = Orientation.Horizontal + continuousLayout = true + resizeWeight = 1 + dividerSize = 2 + topComponent = infoPanel + bottomComponent = gravityPanel + } + bottomComponent = optionsPanel + } + } + c.fill = Fill.Both + + c.gridx = 0 + c.gridy = 0 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(menuPanel, c) + + c.gridx = 0 + c.gridy = 1 + c.weightx = 1.0 + c.weighty = 0.0 + super.add(controlPanel, c) + + + c.gridx = 0 + c.gridy = 2 + c.weightx = 1.0 + c.weighty = 1.0 + super.add(splitter, c) + + /* + c.gridx = 1 + c.gridy = 1 + c.weightx = 0.0 + c.weighty = 1.0 + super.add(infoPanel, c) + */ +} diff --git a/src/graphyx/gui/MenuHelp.scala b/src/graphyx/gui/MenuHelp.scala new file mode 100644 index 0000000..1c73d51 --- /dev/null +++ b/src/graphyx/gui/MenuHelp.scala @@ -0,0 +1,19 @@ +package graphyx.gui + +import graphyx.actors._ +import graphyx.gui._ +import scala.swing._ +import scala.swing.event._ + +class MenuHelp extends Menu("Help") { + val miAbout = new MenuItem("About...") + + val components = List(miAbout) + contents ++= components + + listenTo(components: _*) + reactions += { + case event.ButtonClicked(`miAbout`) => AboutHelpFrame.frame.visible = true + + } +} diff --git a/src/graphyx/gui/MenuPanel.scala b/src/graphyx/gui/MenuPanel.scala new file mode 100644 index 0000000..d3196fe --- /dev/null +++ b/src/graphyx/gui/MenuPanel.scala @@ -0,0 +1,12 @@ +package graphyx.gui + +import graphyx.actors._ +import graphyx.gui._ +import scala.swing._ +import scala.swing.event._ + +class MenuPanel(container: Container) extends BoxPanel(Orientation.Horizontal) { + val mnu = new MenuBar + mnu.contents += new MenuHelp + contents += mnu +} diff --git a/src/graphyx/gui/OptionsPanel.scala b/src/graphyx/gui/OptionsPanel.scala new file mode 100644 index 0000000..3ec3921 --- /dev/null +++ b/src/graphyx/gui/OptionsPanel.scala @@ -0,0 +1,122 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import graphyx.graphics._ +import sims.geometry._ +import sims.dynamics._ +import scala.swing._ +import scala.swing.event._ +import GridBagPanel._ + +class OptionsPanel(container: Container) extends GridPanel(11,2){ + /* + val c = new Constraints + c.anchor = Anchor.West + */ + + this.border = Swing.EmptyBorder(3,3,3,3) + this.hGap = 3 + this.vGap = 3 + + val lblTimeStep = new Label("h [Hz]") {tooltip = "Time Step"} + val txtTimeStep = new TextField + + val lblIterations = new Label("i [1]") {tooltip = "Iterations"} + val txtIterations = new TextField + + val lblCD = new Label("CD") {tooltip = "Collision Detection"} + val chckCD = new CheckBox("") + + val lblPC = new Label("PC") {tooltip = "Position Correction"} + val chckPC = new CheckBox("") + + val lblDraw = new Label("Draw") + + val lblDrawBodies = new Label("Bodies") + val chckDrawBodies = new CheckBox {selected = false} + + val lblDrawShapes = new Label("Shapes") + val chckDrawShapes = new CheckBox {selected = true} + + val lblDrawJoints = new Label("Joints") + val chckDrawJoints = new CheckBox {selected = true} + + val lblDrawAABBs = new Label("AABBs") + val chckDrawAABBs = new CheckBox {selected = false} + + val lblDrawPairs = new Label("Pairs") + val chckDrawPairs = new CheckBox {selected = false} + + val lblDrawCollisions = new Label("Collisions") + val chckDrawCollisions = new CheckBox {selected = false} + + val components = List( + lblTimeStep, txtTimeStep, + lblIterations, txtIterations, + lblCD, chckCD, + lblPC, chckPC, + lblDraw, new Label(""), + lblDrawBodies, chckDrawBodies, + lblDrawShapes, chckDrawShapes, + lblDrawJoints, chckDrawJoints, + lblDrawAABBs, chckDrawAABBs, + lblDrawPairs, chckDrawPairs, + lblDrawCollisions, chckDrawCollisions + ) + contents ++= components + listenTo(components: _*) + + reactions += { + case EditDone(`txtTimeStep`) => container.scene.world.real.timeStep = 1.0 / txtTimeStep.text.toInt + case EditDone(`txtIterations`) => container.scene.world.real.iterations = txtIterations.text.toInt + case ButtonClicked(`chckCD`) => container.scene.world.real.enableCollisionDetection = chckCD.selected + case ButtonClicked(`chckPC`) => container.scene.world.real.enablePositionCorrection = chckPC.selected + case ButtonClicked(`chckDrawBodies`) => container.mainFrame.mainPanel.worldPanel.drawBodies = chckDrawBodies.selected + case ButtonClicked(`chckDrawShapes`) => container.mainFrame.mainPanel.worldPanel.drawShapes = chckDrawShapes.selected + case ButtonClicked(`chckDrawJoints`) => container.mainFrame.mainPanel.worldPanel.drawJoints = chckDrawJoints.selected + case ButtonClicked(`chckDrawAABBs`) => container.mainFrame.mainPanel.worldPanel.drawAABBs = chckDrawAABBs.selected + case ButtonClicked(`chckDrawPairs`) => container.mainFrame.mainPanel.worldPanel.drawPairs = chckDrawPairs.selected + case ButtonClicked(`chckDrawCollisions`) => container.mainFrame.mainPanel.worldPanel.drawCollisions = chckDrawCollisions.selected + } + + def update() = { + if (!txtTimeStep.peer.hasFocus) + txtTimeStep.text = (1.0 / container.scene.world.timeStep).toString + if (!txtIterations.peer.hasFocus) + txtIterations.text = container.scene.world.iterations.toString + chckCD.selected = container.scene.world.enableCollisionDetection + chckPC.selected = container.scene.world.enablePositionCorrection + chckDrawBodies.selected = container.mainFrame.mainPanel.worldPanel.drawBodies + chckDrawShapes.selected = container.mainFrame.mainPanel.worldPanel.drawShapes + chckDrawJoints.selected = container.mainFrame.mainPanel.worldPanel.drawJoints + chckDrawAABBs.selected = container.mainFrame.mainPanel.worldPanel.drawAABBs + chckDrawPairs.selected = container.mainFrame.mainPanel.worldPanel.drawPairs + chckDrawCollisions.selected = container.mainFrame.mainPanel.worldPanel.drawCollisions + } + + + /* + def addCell(cm: Component)(x: Int, y: Int) = { + c.gridx = x + c.gridy = y + c.weightx = 0.5 + c.weighty = 0.0 + c. + if (cm.isInstanceOf[TextArea]) + c.fill = Fill.Horizontal + else + c.fill = Fill.None + super.add(cm, c) + } + + addCell(lblTimeStep)(0,0) + addCell(txtTimeStep)(1,0) + addCell(lblIterations)(0,1) + addCell(txtIterations)(1,1) + */ +} diff --git a/src/graphyx/gui/PopupMenu.scala b/src/graphyx/gui/PopupMenu.scala new file mode 100644 index 0000000..9679018 --- /dev/null +++ b/src/graphyx/gui/PopupMenu.scala @@ -0,0 +1,20 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import scala.swing._ +import scala.swing.event._ +import javax.swing._ + +class PopupMenu extends Component +{ + override lazy val peer : JPopupMenu = new JPopupMenu + + def add(item: MenuItem) : Unit = { peer.add(item.peer) } + def setVisible(visible:Boolean) : Unit = { peer.setVisible(visible) } + /* Create any other peer methods here */ +} \ No newline at end of file diff --git a/src/graphyx/gui/ShapeInfoPanel.scala b/src/graphyx/gui/ShapeInfoPanel.scala new file mode 100644 index 0000000..d94c0bd --- /dev/null +++ b/src/graphyx/gui/ShapeInfoPanel.scala @@ -0,0 +1,35 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import graphyx.graphics._ +import sims.geometry._ +import sims.dynamics._ +import scala.swing._ +import scala.swing.event._ +import GridBagPanel._ + +class ShapeInfoPanel(container: Container) extends GridPanel(2,2) { + + this.border = Swing.EmptyBorder(3,3,3,3) + this.hGap = 3 + this.vGap = 3 + + val lblBody = new Label("Body") + val lblValBody = new Label("0") + + val lblShape = new Label("Shape") + val lblValShape = new Label("0") + + val components = List( + lblBody, lblValBody, + lblShape, lblValShape + ) + + contents ++= components + +} diff --git a/src/graphyx/gui/WorldPanel.scala b/src/graphyx/gui/WorldPanel.scala new file mode 100644 index 0000000..13765e5 --- /dev/null +++ b/src/graphyx/gui/WorldPanel.scala @@ -0,0 +1,150 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.gui + +import graphyx.graphics._ +import sims.geometry._ +import sims.dynamics._ +import scala.swing._ +import scala.swing.event._ + +class WorldPanel(container: Container) extends BoxPanel(Orientation.Vertical){ + cursor = new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR) + val lblBody = new Label {text = "None @ (0, 0)"} + contents += lblBody + val popup = new BodyPopup + contents += popup + + implicit def point2Vector(p: java.awt.Point) = { + val x = p.x + val y = size.height - p.y + new Vector2D((x - offset.x) / scale / ppm, (y - offset.y) / scale / ppm) + } + + private val ppi = java.awt.Toolkit.getDefaultToolkit.getScreenResolution + val ppm = 39.37007874 * ppi + var scale = 0.02 + var offset = Vector2D(100, 100) //vector for point coordinates [px] + + def scene: Scene = container.scene + + def update() = { + repaint() + } + + var drawBodies = false + var drawShapes = true + var drawJoints = true + var drawAABBs = false + var drawPairs = false + var drawCollisions = false + + override def paintComponent(g: java.awt.Graphics) = { + var parts: Seq[graphyx.graphics.Drawable] = Seq() + if (drawShapes) parts ++= scene.shapes + if (drawJoints) parts ++= scene.joints + if (drawAABBs) parts ++= scene.aabbs + if (drawPairs) parts ++= scene.pairs + if (drawCollisions) parts ++= scene.collisions + if (drawBodies) parts ++= scene.bodies + g.clearRect(0,0,size.width,size.height) + drawAxes(g) + g.translate(offset.x.toInt, -offset.y.toInt) + drawParts(parts, g) + g.translate(-offset.x.toInt, offset.y.toInt) + } + + def drawAxes(g: java.awt.Graphics): Unit = { + g.setColor(java.awt.Color.GRAY) + g.drawLine(0, size.height - offset.y.toInt, size.width, size.height - offset.y.toInt) + g.drawLine(offset.x.toInt, 0, offset.x.toInt, size.height) + /* + val md = scale * ppm + val hb = size.width / md + for (i <- 1 to hb.toInt) g.drawLine(offset.x.toInt + i * md.toInt, size.height - offset.y.toInt, + offset.x.toInt + i * md.toInt, size.height - offset.y.toInt + 10) + */ + } + + def drawParts(parts: Iterable[graphics.Drawable], g: java.awt.Graphics) = { + for (p <- parts){ + p.g = g + p.windowHeight = super.size.height + p.ppm = ppm + p.scale = this.scale + p.draw() + } + } + + def getBody(p: Vector2D): Option[Body] = { + val shape = scene.shapes.find(_.contains(p)) + if (shape != None) Some(shape.get.real.body) + else None + } + + var mousePressed: Boolean = false + var startPoint = new java.awt.Point(0,0) + var endPoint = new java.awt.Point(0,0) + var grabbedBody: Option[GrabbedBody] = None + def grab(b: Body, p: Vector2D) = { + grabbedBody = Some(new GrabbedBody(b, p)) + b.fixed = true + } + + def release() = { + if (grabbedBody != None && grabbedBody.get.wasFixed == false) + grabbedBody.get.body.fixed = false + grabbedBody = None + } + + listenTo(Mouse.clicks, Mouse.moves, Mouse.wheel) + reactions += { + case MousePressed(c,p,x,y,b) => { + mousePressed = true; startPoint = p; endPoint = p + x match { + case 1024 if (getBody(p) != None) => grab(getBody(p).get, p) + case 4096 if (getBody(p) != None) => {grabbedBody = Some(new GrabbedBody(getBody(p).get, p)); popup.body = grabbedBody.get.body; popup.peer.setLocation(p); popup.visible = true} + } + } + + case MouseMoved(c,p,i) => { + lblBody.text = (if (getBody(p) != None) getBody(p).get.uid.toString else "None") + " @ (" + point2Vector(p).x.formatted("%f") + ", " + point2Vector(p).y.formatted("%f") + ")" + } + + case MouseDragged(c,p,1088) => {//drag with shift + offset += Vector2D((p.x - endPoint.x), -(p.y - endPoint.y)) + mousePressed = true + endPoint = p + cursor = new java.awt.Cursor(java.awt.Cursor.MOVE_CURSOR) + } + + case MouseDragged(c,p,x) => + if (grabbedBody != None) grabbedBody.get.body.pos = p - grabbedBody.get.r + + case MouseReleased(c,p,x,y,b) => { + mousePressed = false + endPoint = p + cursor = new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR) + release() + } + + case MouseWheelMoved(c,p,1024,y) => { //with left mouse button pressed + if (grabbedBody != None) grabbedBody.get.body.rotation += 0.05 * y + } + + case MouseWheelMoved(c,p,x,y) => { + scale -= scale * 0.02 * y + } + + } +} + +class GrabbedBody(b: Body, point: Vector2D){ + def body = b + val r: Vector2D = point - body.pos + val wasFixed = b.fixed +} diff --git a/src/graphyx/tests/BallStack.scala b/src/graphyx/tests/BallStack.scala new file mode 100644 index 0000000..8e45611 --- /dev/null +++ b/src/graphyx/tests/BallStack.scala @@ -0,0 +1,25 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.geometry._ + +object BallStack extends Test{ + val world = new World + val title = "BallStack" + def init(): Unit = { + val ground = new Rectangle(1,0.1,1) {pos = Vector2D(1,0)} + val wallLeft = new Rectangle(0.1,1,1) {pos = Vector2D(0,1)} + val wallRight = new Rectangle(0.1,1,1) {pos = Vector2D(2,1)} + val box = new Body(ground, wallLeft, wallRight) {fixed = true} + world += box + world += (new Circle(0.1,1) {pos = Vector2D(1.1, 2.8)}).asBody + world ++= (for (i <- 0 to 50) yield (new Circle(0.1,1) {pos = Vector2D(1, 3 + 0.2 * i)}).asBody) + + } +} diff --git a/src/graphyx/tests/Chain.scala b/src/graphyx/tests/Chain.scala new file mode 100644 index 0000000..27511ca --- /dev/null +++ b/src/graphyx/tests/Chain.scala @@ -0,0 +1,26 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.dynamics.joints._ +import sims.prefabs._ +import sims.geometry._ + +object Chain extends Test{ + override val title = "Chain" + val world = new World + def init = { + val nodes = for (i <- (0 until 20).toList) yield (new Circle(0.02, 1) {pos = Vector2D(i * 0.2, 1)}).asBody + nodes(0).fixed = true + nodes(19).fixed = true + val connectors = for (i <- (0 until nodes.length - 1).toList) yield new DistanceJoint(nodes(i), nodes(i + 1)) + for (n <- nodes) world += n + for (c <- connectors) world += c + world += (new Circle(1,0.001) {pos = Vector2D(2,2)}).asBody + } +} diff --git a/src/graphyx/tests/CompositeShape.scala b/src/graphyx/tests/CompositeShape.scala new file mode 100644 index 0000000..51ffd0b --- /dev/null +++ b/src/graphyx/tests/CompositeShape.scala @@ -0,0 +1,36 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.geometry._ +import sims.dynamics._ + +import sims.util._ +import sims.util.Positioning._ + +object CompositeShape extends Test{ + val title = "Composite Shape" + val world = new World + + def init = { + + val ground = new Body(Rectangle(1000,0.1,1)) {fixed = true} + world += ground + + val h2o = { + val h = new Circle(0.2,1) + val o1 = new Circle(0.05,1) + val o2 = new Circle(0.05,1) {rotation = 0.3} + position(o1) {0.25 above h} + o2.pos = (new Polar(0.25, Math.Pi / 3)) from h + new Body(h, o1, o2) {pos = Vector2D(0, 0.5)} + } + world += h2o + } + +} + \ No newline at end of file diff --git a/src/graphyx/tests/Cup.scala b/src/graphyx/tests/Cup.scala new file mode 100644 index 0000000..598a9be --- /dev/null +++ b/src/graphyx/tests/Cup.scala @@ -0,0 +1,31 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.geometry._ +object Cup extends Test { + val title = "Cup" + val world = new World + + def init = { + val ground = (new Rectangle(1000, 0.1, 1) {friction = 1}).asBody + ground.fixed = true + world += ground + + val cupShapes = for (i <- 0 to (10 * Math.Pi).toInt) yield new Circle(0.1,1) {pos = Vector2D(Math.cos(-i / 10.0), Math.sin(-i / 10.0)); restitution = 0.0; friction = 1.0} + val cup = new Body(cupShapes: _*) {fixed = true; pos = Vector2D(0, 1)} + world += cup + + val ball1 = (new Circle(0.2, 1) {pos = Vector2D(0, 2)}).asBody + val ball2 = (new Circle(0.2, 1) {pos = Vector2D(-0.4, 2)}).asBody + val ball3 = (new Circle(0.2, 1) {pos = Vector2D(0.4, 2)}).asBody + world += ball1 + world += ball2 + world += ball3 + } +} diff --git a/src/graphyx/tests/EmptyTest.scala b/src/graphyx/tests/EmptyTest.scala new file mode 100644 index 0000000..bbca800 --- /dev/null +++ b/src/graphyx/tests/EmptyTest.scala @@ -0,0 +1,15 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +object EmptyTest extends Test{ + override val title = "Empty Test" + val world = new World + def init = {} + +} diff --git a/src/graphyx/tests/Friction.scala b/src/graphyx/tests/Friction.scala new file mode 100644 index 0000000..268d054 --- /dev/null +++ b/src/graphyx/tests/Friction.scala @@ -0,0 +1,56 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.geometry._ +import sims.dynamics._ +import sims.dynamics.joints._ + +object Friction extends Test{ + val title = "Friction" + val world = new World + + var r1: RevoluteJoint = _ + var r2: RevoluteJoint = _ + var r3: RevoluteJoint = _ + + def init = { + val ground = (new Rectangle(1000, 0.1, 1) {friction = 1}).asBody + ground.fixed = true + world += ground + + val ball1 = (new Circle(0.2, 1) {pos = Vector2D(0, 1); friction = 0.05}).asBody + ball1.angularVelocity = -80 + ball1.monitor = true + val ball2 = (new Circle(0.2, 1) {pos = Vector2D(1, 1); friction = 0.2}).asBody + ball2.angularVelocity = -80 + ball2.monitor = true + val ball3 = (new Circle(0.2, 1) {pos = Vector2D(2, 1); friction = 1}).asBody + ball3.angularVelocity = -80 + ball3.monitor = true + + world += ball1 + world += ball2 + world += ball3 + + world.monitors += ("", (b: Body) => "I=" + b.I + "\tw=" + b.angularVelocity + "\tEcin=" + 0.5 * b.I * b.angularVelocity * b.angularVelocity) + + r1 = RevoluteJoint(ground, ball1, ball1.pos) + r2 = RevoluteJoint(ground, ball2, ball2.pos) + r3 = RevoluteJoint(ground, ball3, ball3.pos) + world += r1 + world += r2 + world += r3 + } + + override def fireEvent = { + world -= r1 + world -= r2 + world -= r3 + } + +} diff --git a/src/graphyx/tests/Friction2.scala b/src/graphyx/tests/Friction2.scala new file mode 100644 index 0000000..6eb445b --- /dev/null +++ b/src/graphyx/tests/Friction2.scala @@ -0,0 +1,33 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.geometry._ +import sims.dynamics._ +import sims.dynamics.joints._ + +object Friction2 extends Test{ + val title = "Friction2" + val world = new World {override val detector = new sims.collision.GridDetector(this) {gridSide = 0.2}} + + def init = { + val shapes = for (i <- (0 to 20).toList) yield (new Rectangle(0.2, 0.1, 1) { + pos = Vector2D(0.4 * i, 0) + friction = (i * 1.0 / 10) + restitution = 0 + }) + val ground = new Body(shapes: _*) //Rectangle(100, 0.1, 1).asBody + ground.pos = Vector2D(0,0) + ground.fixed = true + 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)}) + b.pos = Vector2D(0.1,0.1) + world += b + } +} \ No newline at end of file diff --git a/src/graphyx/tests/General1.scala b/src/graphyx/tests/General1.scala new file mode 100644 index 0000000..1a71c24 --- /dev/null +++ b/src/graphyx/tests/General1.scala @@ -0,0 +1,125 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims._ +import sims.geometry._ +import sims.collision._ +import sims.dynamics._ +import sims.dynamics.joints._ +object General1 extends Test{ + override val title = "General1" + val world = new World + + def init() = { + val b0 = new Circle(0.1,1).asBody + b0.fixed = true + val b1 = (new Circle(0.1,1) {pos = Vector2D(0,1)}).asBody + //b0.linearVelocity = Vector2D(0,0.4) + b0.monitor = true + b1.monitor = true + val circles = for (i <- (0 until 10).toList) yield (new Circle(0.1,1) {pos = Vector2D(0, 1.2 + 0.2 * i)}).asBody + //for (c <- circles) world += c + //world.gravity = Vector2D.Null + // world += b0 + //world += b1 + + world.monitors += ("Veclocity = ", _.linearVelocity.length.toString) + + val b2 = (new Rectangle(0.1,0.15,1) {pos = Vector2D(1,0)}).asBody + b2.fixed = true + b2.rotation = 2 + val b3 = (new Circle(0.1,1) {pos = Vector2D(1,1.1)}).asBody + //world += b2 + //world += b3 + + val b4 = (new Rectangle(0.1,0.15,1) {pos = Vector2D(2,0)}).asBody + b4.fixed = true + b4.rotation = 2 + val b5 = (new Rectangle(0.1,0.15,1) {pos = Vector2D(2,1.2)}).asBody + //world += b4 + //world += b5 + + val bn = (new RegularPolygon(5,0.1,1) {pos = Vector2D(3,0)}).asBody + //world += bn + + //Make cannon and balls + val hull = new Body( + new Rectangle(0.1,0.5,1) {pos = Vector2D(0.1, 0.5)}, + new Rectangle(0.1,0.5,1) {pos = Vector2D(0.5, 0.5)}, + new Rectangle(0.1,0.1,1) {pos = Vector2D(0.3, 0.1)} + ) + hull.fixed = true + hull.rotation -= Math.Pi / 4 + + val ball = new Body( + new Circle(0.1,20) {pos = Vector2D(0.3, 0.3)} + ) + val ball2 = new Body( + new Circle(0.1,20) {pos = Vector2D(0.3, 0.5)} + ) + world += hull + world += ball + world += ball2 + + //Swing + val anchor = (new Circle(0.05,1) {pos = Vector2D(25,10)}).asBody + anchor.fixed = true + val block = (new RegularPolygon(9,0.5,2) {pos = Vector2D(25,1)}).asBody + val joint = new DistanceJoint(anchor, block) + world += anchor + world += block + world += joint + + //Make stack + val stack = for (i <- (0 until 10).toList) yield (new Circle(0.1,1) {pos = Vector2D(30, 0.2 + 0.2 * i)}).asBody + for (e <- stack) world += e + + + /* + val springBoardHull = new Body( + new Rectangle(0.1,0.5,1) {pos = Vector2D(-1.1, 0.5)}, + new Rectangle(0.1,0.5,1) {pos = Vector2D(-1.5, 0.5)}, + new Rectangle(0.1,0.1,1) {pos = Vector2D(-1.3, 0.1)} + ) + springBoardHull.fixed = true + world += springBoardHull + + val springBoard = new Body( + new Circle(0.1,20) {pos = Vector2D(-1.3, 0.5)} + ) + world += springBoard + + val spring = new SpringJoint(springBoardHull, Vector2D(-1.3, 0.1), springBoard, springBoard.pos, 2000) + spring.damping = 10 + world += spring + */ + + val ground = (new Rectangle(1000,0.5,1) {pos = Vector2D(0, -0.4)}).asBody + 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)}) + } + + override def fireEvent() = blastBomb + + def blastBomb() = { + val bombPos = Vector2D(0, 0) + val bombRadius = 1 + val bombImpulse = 10 + val region = new Circle(bombRadius, 0) {pos = bombPos} + val detector = world.detector.asInstanceOf[GridDetector] + val collisions = for (s <- world.shapes; if detector.colliding(collision.Pair(region, s))) yield detector.collision(collision.Pair(region, s)) + for (c <- collisions) { + if (c.shape1 != region) + for(p <- c.points) c.shape1.body.applyImpulse((p - bombPos).unit * bombImpulse, p) + if (c.shape2 != region) + for(p <- c.points) c.shape2.body.applyImpulse((p - bombPos).unit * bombImpulse, p) + } + } +} diff --git a/src/graphyx/tests/General2.scala b/src/graphyx/tests/General2.scala new file mode 100644 index 0000000..2006080 --- /dev/null +++ b/src/graphyx/tests/General2.scala @@ -0,0 +1,28 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.geometry._ +import sims.dynamics._ + +object General2 extends Test{ + val title = "General2" + val world = new World + + def init = { + world += new Body(new Rectangle(100,0.5,1) {pos = Vector2D(0, -0.5)}) {fixed = true} + //new Body(new Circle(0.05,1) {pos = Vector2D(0, 0.05)}), + //new Body(new Rectangle(0.5,0.1,1) {pos = Vector2D(0, 0.2)}), + //new Body(new Circle(0.05,1) {pos = Vector2D(1, 0.05)})) + + world += new Body(new Circle(0.2,1) {pos = Vector2D(5, 0.2)}) + world += new Body(new Rectangle(1.5,0.1,1) {pos = Vector2D(4.5, 0.5)}, new Rectangle(0.05,0.1,1) {pos = Vector2D(3.05,0.7)}) + world += new Body(new Circle(0.1,1) {pos = Vector2D(3.2, 0.7)}) + world += new Body(new Circle(0.5,10) {pos = Vector2D(8, 0.5)}) + + } +} diff --git a/src/graphyx/tests/Joints1.scala b/src/graphyx/tests/Joints1.scala new file mode 100644 index 0000000..ad143ec --- /dev/null +++ b/src/graphyx/tests/Joints1.scala @@ -0,0 +1,24 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.dynamics.joints._ +import sims.geometry._ + +object Joints1 extends Test{ + override val title = "Joints1" + val world = new World + def init = { + val anchor = new Body(new Circle(0.03, 1) {pos = Vector2D(1,5)}) {fixed = true} + val weight = (new Rectangle(0.1, 0.5, 1) {pos = Vector2D(1,0)}).asBody + val joint = new DistanceJoint(anchor, anchor.pos, weight, weight.pos + Vector2D(0.1,0.2)) + world += anchor + world += weight + world += joint + } +} diff --git a/src/graphyx/tests/Joints2.scala b/src/graphyx/tests/Joints2.scala new file mode 100644 index 0000000..9ff5df3 --- /dev/null +++ b/src/graphyx/tests/Joints2.scala @@ -0,0 +1,29 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.dynamics.joints._ +import sims.geometry._ +import sims.util._ +import sims.util.Positioning._ + +object Joints2 extends Test{ + override val title = "Joints2" + val world = new World + def init() = { + val length = 100 + val distance = 0.2 + val anchors = for (i <- (0 until length).toList) yield new Body(new Circle(0.03,1) {pos = Vector2D(i * distance,5)}) {fixed = true} + val balls = for (i <- (0 until length).toList) yield new Body(new Circle(0.1,1) {pos = Vector2D(i * distance,0); restitution = 1}) + balls(0).pos = Vector2D(0, 5) + Polar(5, -Math.Pi / 1.5).toCarthesian + val joints = for (i <- (0 until length).toList) yield new DistanceJoint(anchors(i), balls(i)) + for (a <- anchors) world += a + for (b <- balls) world += b + for (j <- joints) world += j + } +} diff --git a/src/graphyx/tests/Net.scala b/src/graphyx/tests/Net.scala new file mode 100644 index 0000000..c340a80 --- /dev/null +++ b/src/graphyx/tests/Net.scala @@ -0,0 +1,22 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims._ +import sims.geometry._ +import sims.dynamics._ + +object Net extends Test{ + val title = "Net" + val world = new World + + def init = { + val n = new prefabs.Net(10, 10, Vector2D(4,4)) + n.bodies(9).fixed = true + world += n + } +} diff --git a/src/graphyx/tests/RagdollTest.scala b/src/graphyx/tests/RagdollTest.scala new file mode 100644 index 0000000..63c9ce5 --- /dev/null +++ b/src/graphyx/tests/RagdollTest.scala @@ -0,0 +1,26 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.dynamics.joints._ +import sims.geometry._ +import sims.prefabs._ + +object RagdollTest extends Test { + val title = "Ragdoll" + val world = new World + + def init = { + val ground = new Body((for (i <- 0 to 1000) yield new Circle(0.5,1) {pos = Vector2D(0.5 * (i - 500), 0)}): _*) + ground.fixed = true + world += ground + + world += new Ragdoll(Vector2D(0, 5)) + } + +} diff --git a/src/graphyx/tests/Restitution.scala b/src/graphyx/tests/Restitution.scala new file mode 100644 index 0000000..9501a36 --- /dev/null +++ b/src/graphyx/tests/Restitution.scala @@ -0,0 +1,21 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.geometry._ +import sims.dynamics._ + +object Restitution extends Test{ + val title = "Restitution" + val world = new World + + def init = { + world += new Body(new Rectangle(1000,0.1,10) {restitution = 1}) {fixed = true} + world ++= (for (i <- 0 until 10) yield (new Circle(0.05, 10) {pos = Vector2D(i * 0.5, 1); restitution = i / 10.0}).asBody) + } + +} diff --git a/src/graphyx/tests/Stacking.scala b/src/graphyx/tests/Stacking.scala new file mode 100644 index 0000000..63734b6 --- /dev/null +++ b/src/graphyx/tests/Stacking.scala @@ -0,0 +1,24 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.geometry._ + +object Stacking extends Test{ + val world = new World + val title = "Stacking" + def init(): Unit = { + val sideWidth = 0.3 + val sideHeight = 0.2 + val boxes = 5 + val distance = 0.1 + val stack = for (i <- (0 until boxes).toList) yield (new Rectangle(sideWidth / (2 + 0.3 * i), sideHeight / 2, 1) {pos = Vector2D(1, i * (sideHeight + distance))}).asBody + stack(0).fixed = true + for (box <- stack) world += box + } +} diff --git a/src/graphyx/tests/Test.scala b/src/graphyx/tests/Test.scala new file mode 100644 index 0000000..b539283 --- /dev/null +++ b/src/graphyx/tests/Test.scala @@ -0,0 +1,16 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +trait Test { + val world: World + val title: String + def init(): Unit + def fireEvent(): Unit = println("No custom event method defined.") + override def toString() = title +} diff --git a/src/sims/collision/AABB.scala b/src/sims/collision/AABB.scala new file mode 100644 index 0000000..51b3e12 --- /dev/null +++ b/src/sims/collision/AABB.scala @@ -0,0 +1,29 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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 + */ +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*/ + def overlaps(box: AABB): Boolean = { + val d1 = box.minVertex - maxVertex + val d2 = minVertex - box.maxVertex + !(d1.x > 0 || d1.y > 0 || d2.x > 0 || d2.y > 0) + } +} diff --git a/src/sims/collision/CircleCollision.scala b/src/sims/collision/CircleCollision.scala new file mode 100644 index 0000000..baf401a --- /dev/null +++ b/src/sims/collision/CircleCollision.scala @@ -0,0 +1,22 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import geometry._ +import dynamics._ + +/**Kollision zwischen zwei Kreisen.*/ +case class CircleCollision(c1: Circle, c2: Circle) extends Collision { + val shape1 = c1 + val shape2 = c2 + val normal = (c2.pos - c1.pos).unit + val points = { + val distance = (c2.pos - c1.pos).length + val p = shape1.pos + normal * (distance - c2.radius) + List(p) + } +} diff --git a/src/sims/collision/Collision.scala b/src/sims/collision/Collision.scala new file mode 100644 index 0000000..ad23f4d --- /dev/null +++ b/src/sims/collision/Collision.scala @@ -0,0 +1,109 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import dynamics._ +import geometry._ + +/**Kollisionen zwischen zwei Formen enthalten Methoden zur Berrechnen der Kollisionsreaktion.*/ +abstract class Collision extends Constraint { + + /**Erste Kollisionsform (Referenz).*/ + val shape1: Shape + + /**Zweite Kollisionsform (eindringend).*/ + val shape2: Shape + + /**Kollisionspunkte.*/ + val points: Iterable[Vector2D] + + /**Normalenvektor zu der Kollisionsebene.*/ + val normal: Vector2D + + /* C = delta + * Cdot = (vp2 - vp1) dot n + * = v2 + (w2 cross r2) - v2 - (w1 cross r1) + * = v2 + (w2 cross (p - x2)) - v2 - (w1 cross(p - x1)) + * J = [-n -((p-x1) cross n) n ((p-x2) cross n)]*/ + def correctVelocity(h: Double) = { + val coefficientOfRestitution = shape1.restitution * shape2.restitution + for (p <- points) { + val b1 = shape1.body + val b2 = shape2.body + val relativeNormalVelocity = (b2.velocityOfPoint(p) - b1.velocityOfPoint(p)) dot normal + val Cdot = relativeNormalVelocity + relativeNormalVelocity * coefficientOfRestitution + if (Cdot <= 0) { + val r1 = p - b1.pos + val r2 = p - b2.pos + val cr1 = r1 cross normal + val cr2 = r2 cross normal + val invMass = 1/b1.mass * (normal dot normal) + 1/b1.I * cr1 * cr1 + 1/b2.mass * (normal dot normal) + 1/b2.I * cr2 * cr2 + val m = if (invMass == 0.0) 0.0 else 1/invMass + val lambda = -m * Cdot + //wenn fixed, dann ist Masse unendlich => kein 'if (fixed != true)' + b1.linearVelocity += -normal * lambda / b1.mass + b1.angularVelocity += -(r1 cross normal) * lambda / b1.I + b2.linearVelocity += normal * lambda / b2.mass + b2.angularVelocity += (r2 cross normal) * lambda / b2.I + correctFriction(p, (-normal * lambda).length / h, h) + } + } + } + + /* Cdot = vt = [v2 + (w2 cross r2) - v1 - (w2 cross r2)] dot t + * J = [-t -(r2 cross t) t (r1 cross t)] + * 1/m = J * M * JT + * = 1/m1 * (t dot t) + 1/m2 * (t dot t) + 1/I1 * (r1 cross u)^2 + 1/I2 * (r2 cross u)^2*/ + def correctFriction(point: Vector2D, normalForce: Double, h: Double) = { + val b1 = shape1.body + val b2 = shape2.body + val tangent = normal.leftNormal + val Cdot = (b2.velocityOfPoint(point) - b1.velocityOfPoint(point)) dot tangent + val r1 = point - b1.pos + val r2 = point - b2.pos + val cr1 = r1 cross tangent + val cr2 = r2 cross tangent + val invMass = 1/b1.mass * (tangent dot tangent) + 1/b1.I * cr1 * cr1 + 1/b2.mass * (tangent dot tangent) + 1/b2.I * cr2 * cr2 + val m = if (invMass == 0.0) 0.0 else 1/invMass + val mu = shape1.friction * shape2.friction + val lambda = -m * Cdot + val cf = shape1.friction * shape2.friction + val cl = Math.min(Math.max(-normalForce * cf * h, lambda), normalForce * cf * h) + val impulse = tangent * cl + b1.applyImpulse(-impulse, point) + b2.applyImpulse(impulse, point) + } + + def correctPosition(h: Double) = { + val b1 = shape1.body + val b2 = shape2.body + + for (p <- points) { + val overlap = shape1.project(normal) overlap shape2.project(normal) + val C = Collision.ToleratedOverlap - overlap + if (C <= 0.0) { + val r1 = p - b1.pos + val r2 = p - b2.pos + val cr1 = r1 cross normal + val cr2 = r2 cross normal + val invMass = 1/b1.mass + 1/b1.I * cr1 * cr1 + 1/b2.mass + 1/b2.I * cr2 * cr2 + val m = if (invMass == 0.0) 0.0 else 1/invMass + val impulse = -normal.unit * m * C + b1.pos += -impulse / b1.mass + b1.rotation += -(r1 cross impulse) / b1.I + b2.pos += impulse / b2.mass + b2.rotation += (r2 cross impulse) / b2.I + } + } + } +} + +object Collision { + + /**Erlaubte Ueberlappung.*/ + val ToleratedOverlap: Double = 0.01 +} diff --git a/src/sims/collision/Detector.scala b/src/sims/collision/Detector.scala new file mode 100644 index 0000000..e847235 --- /dev/null +++ b/src/sims/collision/Detector.scala @@ -0,0 +1,23 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + + +import sims.geometry._ +import sims.dynamics._ +import scala.collection._ +import scala.collection.mutable._ + +/**Eine Welt ermittelt ihre Kollisionen durch konkrete Implementierungen dieser Klasse.*/ +abstract class Detector { + + /**Die Welt dessen Formen auf Kollisionen ueberprueft werden sollen.*/ + val world: World + + /**Ergibt alle Kollisionen zwischen Formen der Welt 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 new file mode 100644 index 0000000..2c027a3 --- /dev/null +++ b/src/sims/collision/GridDetector.scala @@ -0,0 +1,122 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import sims.dynamics._ +import sims.geometry._ +import scala.collection._ +import scala.collection.mutable._ + +/**Eine konkrete Implementierung von Detector. GridDetector ermittelt + * alle Kollisionen mit einem Gittersystem.*/ +class GridDetector(override val world: World) extends Detector { + + /**Array von Kollisionserkennungsmethoden fuer Formenpaare.*/ + val detectionMethods = new ArrayBuffer[PartialFunction[(Shape, Shape), Boolean]] + detectionMethods += { + case (c1: Circle, c2: Circle) => { //Kollision wenn Distanz <= Summe der Radien + val d = (c1.pos - c2.pos).length + val rSum = c1.radius + c2.radius + d - rSum <= 0 + } + + case (p1: ConvexPolygon, p2: ConvexPolygon) => { //SAT + val sides = p1.sides ++ p2.sides + val axes = sides map (_.n0) + axes.forall((a: Vector2D) => p1.project(a) overlaps p2.project(a)) + } + + case (p: ConvexPolygon, c: Circle) => { //Distanz von Zentrum zu Seiten oder Eckpunkten + val distances = for (s <- p.sides) yield (s distance c.pos) + distances.exists(_ - c.radius <= 0) || (p contains c.pos) + } + + case (c: Circle, p: ConvexPolygon) => { //Distanz von Zentrum zu Seiten oder Eckpunkten + val distances = for (s <- p.sides) yield (s distance c.pos) + distances.exists(_ - c.radius <= 0) || (p contains c.pos) + } + } + + /**Array von Kollisionsmethoden fuer Formenpaare.*/ + val collisionMethods = new ArrayBuffer[PartialFunction[(Shape, Shape), Collision]] + collisionMethods += { + case (c1: Circle, c2: Circle) => CircleCollision(c1, c2) + case (p1: ConvexPolygon, p2: ConvexPolygon) => PolyCollision(p1, p2) + case (p: ConvexPolygon, c: Circle) => PolyCircleCollision(p, c) + case (c: Circle, p: ConvexPolygon) => PolyCircleCollision(p, c) + } + + /**Gibt an, ob das Formenpaar p kollidiert. + * @param p Formenpaar.*/ + 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.*/ + 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.*/ + var gridSide: Double = 2 + + /**Ergibt potenzielle Kollisionspaare der Welt world. + *

+ * Ein Kollisionspaar ist ein Paar aus zwei verschiedenen Formen, das folgenden Bedingungen unterliegt: + *

*/ + def getPairs = { + val grid = new HashMap[(Int, Int), List[Shape]] + def gridCoordinates(v: Vector2D) = ((v.x / gridSide).toInt, (v.y / gridSide).toInt) + def addToGrid(s: Shape) = { + val aabb = s.AABB + val minCell = gridCoordinates(aabb.minVertex) + val maxCell = gridCoordinates(aabb.maxVertex) + val coords = for(i <- (minCell._1 to maxCell._1); j <- (minCell._2 to maxCell._2)) yield (i, j) + for (c <- coords) { + if (grid.contains(c)) + {if (grid(c).forall(_ ne s)) grid(c) = s :: grid(c)} + else + grid += (c -> List(s)) + } + } + for(s <- world.shapes) addToGrid(s) + var ps: List[Pair] = Nil + for(cell <- grid.values) { + ps = ps ::: (for (s1: Shape <- cell; s2: Shape <- cell; + if (s1 ne s2); + if (s1.body ne s2.body); + if (s1.collidable && s2.collidable); + if (s1.AABB overlaps s2.AABB); + if (!s1.transientShapes.contains(s2) && !s2.transientShapes.contains(s1))) yield Pair(s1, s2) + ).removeDuplicates + } + ps.toSeq + } + + private var cache = (world.time, getPairs) + + /**Alle potentiellen Kollisionspaare der Welt. + * @see getPairs*/ + def pairs = {if (world.time != cache._1) cache = (world.time, getPairs); cache._2} + + /**Ergibt alle kollidierenden Paare.*/ + def collidingPairs: Seq[Pair] = for(p <- pairs; if (colliding(p))) yield p + + /**Ergibt alle Kollisionen.*/ + def collisions: Seq[Collision] = for(p <- pairs; if (colliding(p))) yield collision(p) +} diff --git a/src/sims/collision/Overlap.scala b/src/sims/collision/Overlap.scala new file mode 100644 index 0000000..97ecdd6 --- /dev/null +++ b/src/sims/collision/Overlap.scala @@ -0,0 +1,11 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import sims.geometry._ + +case class Overlap(poly: ConvexPolygon, sideNum: Int, overlap: Double) diff --git a/src/sims/collision/Pair.scala b/src/sims/collision/Pair.scala new file mode 100644 index 0000000..048748d --- /dev/null +++ b/src/sims/collision/Pair.scala @@ -0,0 +1,21 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import sims.dynamics._ + +/**Formenpaar.*/ +case class Pair(s1: Shape, s2: Shape) extends Tuple2(s1, s2){ + def this(t: Tuple2[Shape, Shape]) = this(t._1, t._2) + + override def equals(other: Any) = { //overriden to prevent removal during "GridDetector.getPairs" + other match { + case Pair(a, b) => ((a eq this.s1) && (b eq this.s2)) || ((b eq this.s1) && (a eq this.s2)) + case _ => false + } + } +} diff --git a/src/sims/collision/PolyCircleCollision.scala b/src/sims/collision/PolyCircleCollision.scala new file mode 100644 index 0000000..1bf982e --- /dev/null +++ b/src/sims/collision/PolyCircleCollision.scala @@ -0,0 +1,38 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import sims.dynamics._ +import sims.geometry._ + +/**Kollision zwischen einem konvexen Polygon und einem Kreis.*/ +case class PolyCircleCollision(p: ConvexPolygon, c: Circle) extends Collision { + require(p.isInstanceOf[Shape]) + val shape1 = p.asInstanceOf[Shape] + val shape2 = c + + val normal = { + //minimum overlap + var min = (p.sides(0) distance c.pos) - c.radius + var axis = p.sides(0).n0 + for (s <- p.sides; val delta = (s distance c.pos) - c.radius) if (delta <= 0 && delta < min) { + min = delta + axis = s.n0 + } + for (v <- p.vertices; val delta = (v - c.pos).length - c.radius) if (delta <= 0 && delta <= min){ + min = delta + axis = (c.pos - v).unit + } + axis + } + + val points = List( + c.pos - normal * c.radius + ) + + +} diff --git a/src/sims/collision/PolyCollision.scala b/src/sims/collision/PolyCollision.scala new file mode 100644 index 0000000..bbe5568 --- /dev/null +++ b/src/sims/collision/PolyCollision.scala @@ -0,0 +1,50 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.collision + +import sims.geometry._ +import sims.dynamics._ +import scala.collection.mutable.Map +import scala.collection.mutable._ + +/**Kollision zwischen zwei konvexen Polygonen.*/ +case class PolyCollision(p1: ConvexPolygon, p2: ConvexPolygon) extends Collision { + require(p1.isInstanceOf[Shape]) + require(p2.isInstanceOf[Shape]) + + def overlap(axis: Vector2D) = { + // println((p1.project(axis) overlap p2.project(axis)).toString + " to " + (p2.project(axis) overlap p1.project(axis))) + p1.project(axis) overlap p2.project(axis) + } + + lazy val overlaps = (for (i <- 0 until p2.sides.length) yield Overlap(p2, i, overlap(p2.sides(i).n0))) ++ + (for (i <- 0 until p1.sides.length) yield Overlap(p1, i, overlap(p1.sides(i).n0))) + + private var potMinOverlap = overlaps.find(_.overlap > 0.0) + require(potMinOverlap != None) + private var _minOverlap: Overlap = potMinOverlap.get + var minOverlap: Overlap = { + for (o <- overlaps) if ((o.overlap < _minOverlap.overlap) && (o.overlap > 0.0)) _minOverlap = o + _minOverlap + } + + + private lazy val refPoly = minOverlap.poly + private lazy val incPoly = if (minOverlap.poly eq p1) p2 else p1 + + lazy val shape1 = refPoly.asInstanceOf[Shape] + lazy val shape2 = incPoly.asInstanceOf[Shape] + + lazy val normal = refPoly.sides(minOverlap.sideNum).n0 + lazy val points = (for (v <- incPoly.vertices; if refPoly.contains(v)) yield v) ++ + (for (s <- incPoly.sides; + val clip = s.clipToSegment(refPoly.sides((refPoly.sides.length - (minOverlap.sideNum + 1)) % refPoly.sides.length)); + if (clip != None)) yield clip.get) ++ + (for (s <- incPoly.sides; + val clip = s.clipToSegment(refPoly.sides((refPoly.sides.length - (minOverlap.sideNum - 1)) % refPoly.sides.length)); + if (clip != None)) yield clip.get) +} diff --git a/src/sims/dynamics/Body.scala b/src/sims/dynamics/Body.scala new file mode 100644 index 0000000..d5b2a0e --- /dev/null +++ b/src/sims/dynamics/Body.scala @@ -0,0 +1,143 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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.*/ +class Body(shps: Shape*){ + + /**Einzigartige Identifikationsnummer dieses Koerpers.*/ + val uid = Body.nextUid + + /**Formen aus denen dieser Koerper besteht.*/ + val shapes: List[Shape] = shps.toList + + //Formen werden bei Initialisierung eingefuegt + for (s <- shapes) { + s.body = this + s.refLocalPos = s.pos - pos + s.rotation0 = s.rotation + } + + private var isFixed: Boolean = false + + /**Gibt an ob dieser Koerper fixiert ist.*/ + def fixed = isFixed + + /**Fixiert oder unfixiert diesen Koerper.*/ + def fixed_=(value: Boolean) = { + if (value) {linearVelocity = Vector2D.Null; angularVelocity = 0.0} + isFixed = value + } + + /**Gibt an ob die Eigenschaften dieses Koerpers ueberwacht werden sollen. + * @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 + (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*/ + 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 + + /**Ergibt die aktuelle Rotation dieses Koerpers. + * @return aktuelle Rotation dieses Koerpers*/ + def rotation: Double = _rotation + + /**Setzt die Rotation dieses Koerpers. Dazu werden auch die Positionen und Rotationen seiner Formen entsprechend veraendert. + * @param r neue Rotation*/ + def rotation_=(newRotation: Double) = { + _rotation = newRotation + val stepPos = pos + for (s <- shapes) { + s.rotation = newRotation + s.rotation0 + s.pos = stepPos + (s.refLocalPos rotate (newRotation)) + } + } + + /**Lineargeschwindigkeit dieses Koerpers.*/ + var linearVelocity: Vector2D = Vector2D.Null + + /**Winkelgeschwindigkeit dieses Koerpers.*/ + var angularVelocity: Double = 0 + + /**Lineargeschwindigkeit des gegebenen Punktes auf diesem Koerper. In Weltkoordinaten.*/ + def velocityOfPoint(point: Vector2D) = linearVelocity + ((point - pos).leftNormal * angularVelocity) + + /**Resultierende Kraft auf den Schwerpunkt dieses Koerpers.*/ + var force: Vector2D = Vector2D.Null + + /**Resultierender Drehmoment zu dem Schwerpunkt dieses Koerpers.*/ + var torque: Double = 0 + + /**Ergibt die Masse dieses Koerpers. Die Masse ist gleich die Summe aller Massen seiner Formen. + * @return Masse des Koerpers*/ + 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*/ + 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*/ + 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).*/ + 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*/ + 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).*/ + 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.*/ + 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: _*) + } +} + +object Body { + private var uidCounter = -1 + private def nextUid = {uidCounter += 1; uidCounter} +} \ No newline at end of file diff --git a/src/sims/dynamics/Circle.scala b/src/sims/dynamics/Circle.scala new file mode 100644 index 0000000..26f3ad4 --- /dev/null +++ b/src/sims/dynamics/Circle.scala @@ -0,0 +1,37 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.dynamics + +import sims.geometry._ +import sims.collision._ + +/** + * Circle ist die Definition eines Kreises. + * @param radius Radius dieses Kreises + * @param density Dichte dieses Kreises + */ +case class Circle(radius: Double, // Radius + density: Double) extends Shape{ // Dichte + + 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)) + + def project(axis: Vector2D) = if (axis.x != 0) Projection(axis, + (pos.project(axis).x / axis.x) - radius, + (pos.project(axis).x / axis.x) + radius) + else Projection(axis, + (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 new file mode 100644 index 0000000..74c2af3 --- /dev/null +++ b/src/sims/dynamics/Constraint.scala @@ -0,0 +1,19 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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.*/ +trait Constraint { + + /**Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen entsprechen.*/ + def correctVelocity(h: Double): Unit + + /**Korrigiert die Position der Koerper damit diese den Randbedingungen entsprechen.*/ + def correctPosition(h: Double): Unit +} diff --git a/src/sims/dynamics/Rectangle.scala b/src/sims/dynamics/Rectangle.scala new file mode 100644 index 0000000..adaa634 --- /dev/null +++ b/src/sims/dynamics/Rectangle.scala @@ -0,0 +1,40 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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 + */ +case class Rectangle(halfWidth: Double, + halfHeight : Double, + density: Double) extends Shape with ConvexPolygon{ + + val volume = halfWidth * halfHeight * 4 + + 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*/ + 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*/ + 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 new file mode 100644 index 0000000..c5b8a13 --- /dev/null +++ b/src/sims/dynamics/RegularPolygon.scala @@ -0,0 +1,35 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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. + */ +case class RegularPolygon(n: Int, radius: Double, density: Double) extends Shape with ConvexPolygon{ + require(n >= 3, "Polygon must have at least 3 sides.") + + /**Hoehe eines der konstituierneden Dreiecke des Polygons.*/ + private val h: Double = radius * cos(Pi / n) + /**Halbe Breite eines der konstituierneden Dreiecke des Polygons.*/ + 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) + + def vertices = for (h <- halfDiags) yield pos + h + + val volume = n * h * b + + /**Traegheitsmoment eines der konstituierneden Dreiecke im Zentrum des Polygons.*/ + 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 new file mode 100644 index 0000000..f57bbc6 --- /dev/null +++ b/src/sims/dynamics/Shape.scala @@ -0,0 +1,93 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.dynamics + +import sims.geometry._ +import sims.collision._ + +/** +* Eine abstrakte Form. +*/ +abstract class Shape{ + + /**Einzigartige Identifikationsnummer.*/ + val uid: Int = Shape.nextUid + + /**Kollisionsfaehigkeit.*/ + 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.*/ + 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.*/ + var friction: Double = 0.707 + + /**Position des Schwerpunktes in Welt.*/ + var pos: Vector2D = Vector2D.Null + + /**Rotation. Entspricht Laenge des Rotationsvektors.*/ + var rotation: Double = 0 + + /**Initiale Rotation. (Rotation ohne Koerper)*/ + var rotation0 = 0.0 + + /**Referenzposition in Koerper. Wird zur Rotation von Formen in Koerpern verwendet.*/ + var refLocalPos: Vector2D = Vector2D.Null + + /**Dichte. (Masse pro Flaeche)*/ + val density: Double + + /**Volumen. Entspricht eigentlich der Flaeche dieser Form (in 2D) wird aber zum Errechnen der Masse verwendet.*/ + val volume: Double + + /**Errechnet die Masse dieser Form. Masse ist gleich Volumen mal Dichte. + @return Masse der Form*/ + def mass = volume * density + + /**Errechnet Traegheitsmoment zum Schwerpunkt dieser Form. + @return Traegheitsmoment zum Schwerpunkt*/ + val I: Double + + /**Beinhaltender Koerper. Sollte nicht selbst bei Initialisierung definiert werden.*/ + var body: Body = _ + + /**Gibt das umfassende AABB dieser Form zurueck. + @return umfassendes AABB*/ + 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*/ + def project(axis: Vector2D): Projection + + /**Ermittelt ob der gebene Punkt point in dieser Form enthalten ist.*/ + def contains(point: Vector2D): Boolean + + /**Baut einen Koerper aus dieser Form. + @return ein Koerper bestehend aus dieser Form. */ + def asBody = new Body(this) + + /**Formen mit denen diese Form nicht Kollidiert.*/ + 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) + + /**Erstellt einen Koerper aus dieser Form und den Formen des Koerpers b.*/ + def ^(b: Body) = { + val shapes = this :: b.shapes + new Body(shapes: _*) + } +} + +object Shape { + private var uidCounter = -1 + private def nextUid = {uidCounter += 1; uidCounter} +} diff --git a/src/sims/dynamics/World.scala b/src/sims/dynamics/World.scala new file mode 100644 index 0000000..d7ac8ae --- /dev/null +++ b/src/sims/dynamics/World.scala @@ -0,0 +1,163 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.dynamics + +import sims.geometry._ +import sims.collision._ +import sims.dynamics.joints._ +import scala.collection.mutable._ + +/**Eine Welt enthaelt und Simuliert ein System aus Koerpern und Verbindungen.*/ +class World { + + /**Zeitschritt in dem diese Welt die Simulation vorranschreiten laesst.*/ + var timeStep: Double = 1.0 / 60 + + /**Anzahl der Constraint-Korrekturen pro Zeitschritt.*/ + var iterations: Int = 10 + + /**Schwerkraft die in dieser Welt herrscht.*/ + var gravity = Vector2D(0, -9.81) + + /**Alle Koerper die diese Welt simuliert.*/ + val bodies = new ArrayBuffer[Body] + + /**Alle Verbindungen die diese Welt simuliert.*/ + val joints = new ArrayBuffer[Joint] + + /**Ueberwachungsfunktionen fuer Koerper. + *

+ * Das erste Element des Tuples ist die Ueberschrift und das zweite Element, der Wert.*/ + val monitors = new ArrayBuffer[(String, Body => String)] + + /**Kollisionsdetektor dieser Welt.*/ + val detector: Detector = new GridDetector(this) + + /**Warnung wenn Koerper schneller als Lichtgeschwindigkeit.*/ + var overCWarning = false + + /**Kollisionerkennung.*/ + var enableCollisionDetection = true + + /**Positionskorrekturen.*/ + var enablePositionCorrection = true + + /**Die minimale, nicht als null geltende Geschwindigkeit.*/ + var minLinearVelocity: Double = 0.0001 + + /**Die minimale, nicht als null geltende Winkelgeschwindigkeit.*/ + var minAngularVelocity: Double = 0.0001 + + /**Ergibt alle Formen aus allen Koerpern in dieser Welt.*/ + def shapes = for (b <- bodies; s <- b.shapes) yield s + + /**Fuegt dieser Welt einen Koerper hinzu.*/ + def +=(body: Body) = bodies += body + + /**Fuegt dieser Welt eine Verbindung hinzu.*/ + def +=(joint: Joint): Unit = joints += joint + + /**Fuegt dieser Welt ein vorangefertigtes System vaus Koerpern und Verbindungen hinzu.*/ + def +=(p: prefabs.Prefab): Unit = { + for (b <- p.bodies) this += b + for (j <- p.joints) this += j + } + + def ++=(bs: Seq[Body]) = for(b <- bs) this += b + + /**Entfernt den gegebenen Koerper aus dieser Welt.*/ + def -=(body: Body): Unit = bodies -= body + + /**Entfernt die gegebene Verbindung aus dieser Welt.*/ + def -=(joint: Joint): Unit = joints -= joint + + /**Entfernt das gegebene System aus Koerpern und Verbindungen aus dieser Welt.*/ + def -=(p: prefabs.Prefab): Unit = { + for (b <- p.bodies) this -= b + for (j <- p.joints) this -= j + } + + def --=(bs: Seq[Body]) = for(b <- bs) this -= b + + /**Entfernt alle Koerper, Verbindungen und Ueberwachungsfunktionen dieser Welt.*/ + def clear() = {joints.clear(); bodies.clear(); monitors.clear()} + + /**Aktuelle Zeit in Sekunden dieser Welt. Nach jedem Zeitschritt wird die Zeit erhoeht.*/ + 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. + *

+ * Der Zeitschritt wird in folgenden Phasen ausgefuehrt: + *

    + *
  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. + *
*/ + def step() = { + time += timeStep + + //Kraftobjekte + for (j <- joints) j match {case f: ForceJoint => f.applyForce; case _ => ()} + + //integriert v + for (b <- bodies) { + val m = b.mass + b.applyForce(gravity * b.mass) + val a = b.force / b.mass + val alpha = b.torque / b.I + b.linearVelocity = b.linearVelocity + a * timeStep + b.angularVelocity = b.angularVelocity + alpha * timeStep + } + + //korrigiert v + for (i <- 0 until iterations){ + for(c <- joints) c.correctVelocity(timeStep) + if (enableCollisionDetection) for (c <- detector.collisions) c.correctVelocity(timeStep) + } + + //integriert pos + for (b <- bodies) { + //warning when body gets faster than speed of light + if (b.linearVelocity.length >= 300000000) overCWarning = true + if (b.linearVelocity.length < minLinearVelocity) b.linearVelocity = Vector2D.Null + if (b.angularVelocity.abs < minAngularVelocity) b.angularVelocity = 0.0 + b.pos = b.pos + b.linearVelocity * timeStep + b.rotation = b.rotation + b.angularVelocity * timeStep + b.force = Vector2D.Null + b.torque = 0.0 + } + + //korrigiert pos + if (enablePositionCorrection) for (i <- 0 until iterations){ + for (c <- joints) c.correctPosition(timeStep) + if (enableCollisionDetection) for (c <- detector.collisions) c.correctPosition(timeStep) + } + + postStep() + } + + /**Wird nach jedem Zeitschritt ausgefuehrt.*/ + def postStep() = {} + + /**Ergibt Informationen ueber diese Welt.*/ + def info = { + "Bodies = " + bodies.length + "\n" + + "Shapes = " + shapes.length + "\n" + + "Joints = " + joints.length + "\n" + + "Collisions = " + detector.collisions.length + "\n" + + "Monitors = " + monitors.length + "\n" + + "Gravity = " + gravity + "m/s^2\n" + + "Timestep = " + timeStep + "s\n" + + "Time = " + time + "s\n" + + "Iterations = " + iterations + } +} diff --git a/src/sims/dynamics/joints/DistanceJoint.scala b/src/sims/dynamics/joints/DistanceJoint.scala new file mode 100644 index 0000000..2d5633f --- /dev/null +++ b/src/sims/dynamics/joints/DistanceJoint.scala @@ -0,0 +1,76 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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*/ +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).*/ + val distance = (anchor2 - anchor1).length + + private val a1 = anchor1 - node1.pos + private val a2 = anchor2 - node2.pos + private val initRotation1 = node1.rotation + private val initRotation2 = node2.rotation + + /**Ergibt den Bindungspunkt auf Koerper eins.*/ + def connection1 = (a1 rotate (node1.rotation - initRotation1)) + node1.pos + + /**Ergibt den Bindungspunkt auf Koerper zwei.*/ + 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) + + /* x = connection2 - connection1 + * C = ||x|| - L + * u = x / ||x|| + * v = v2 + w2 cross r2 - v1 - w1 cross r1 + * Cdot = u dot v + * J = [-u -(r1 cross u) u (r2 cross u)] + * 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 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 lambda = -m * Cdot //=-JV/JM^-1JT + val impulse = x.unit * lambda //P=J lambda + node1.applyImpulse(-impulse, connection1) + node2.applyImpulse(impulse, connection2) + } + + override def correctPosition(h: Double) = { + val C = x.length - distance + val cr1 = (connection1 - node1.pos) cross x.unit + val cr2 = (connection2 - node2.pos) cross x.unit + 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 + val impulse = -x.unit * m * C + node1.pos -= impulse / node1.mass + node2.pos += impulse / node2.mass + node1.rotation -= ((connection1 - node1.pos) cross impulse) / node1.I + node2.rotation += ((connection2 - node2.pos) cross impulse) / node2.I + } + +} \ No newline at end of file diff --git a/src/sims/dynamics/joints/ForceJoint.scala b/src/sims/dynamics/joints/ForceJoint.scala new file mode 100644 index 0000000..fa17eac --- /dev/null +++ b/src/sims/dynamics/joints/ForceJoint.scala @@ -0,0 +1,14 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.dynamics.joints + +/**Eine Verbindung die Kraft auf ihre Bindungskoerper ausueben kann.*/ +trait ForceJoint { + + /**Uebt eine Kraft auf die Bindungskoerper aus.*/ + def applyForce(): Unit +} diff --git a/src/sims/dynamics/joints/Joint.scala b/src/sims/dynamics/joints/Joint.scala new file mode 100644 index 0000000..9690af2 --- /dev/null +++ b/src/sims/dynamics/joints/Joint.scala @@ -0,0 +1,27 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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.*/ +abstract class Joint extends Constraint{ + + /**Erster Koerper der Verbindung.*/ + val node1: Body + + /**Zweiter Koerper der Verbindung.*/ + val node2: Body + + /**Korrigiert die Geschwindigkeit der Koerper damit diese den Randbedingungen der Verbindung entsprechen.*/ + def correctVelocity(h: Double): Unit + + /**Korrigiert die Position der Koerper damit diese den Randbedingungen der Verbindung entsprechen.*/ + 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 new file mode 100644 index 0000000..7a7ae1c --- /dev/null +++ b/src/sims/dynamics/joints/RevoluteJoint.scala @@ -0,0 +1,55 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.dynamics.joints + +import sims.geometry._ +import sims.math._ +import sims.dynamics._ +import Math._ + +/**Ein Gelenk, dass zwei Koerper an einem Punkt verbindet. Inspiriert von JBox2D.*/ +case class RevoluteJoint(node1: Body, node2: Body, anchor: Vector2D) extends Joint{ + private val a1 = anchor - node1.pos + private val a2 = anchor - node2.pos + private val initRotation1 = node1.rotation + private val initRotation2 = node2.rotation + def connection1 = (a1 rotate (node1.rotation - initRotation1)) + node1.pos + def connection2 = (a2 rotate (node2.rotation - initRotation2)) + node2.pos + + def x = connection2 - connection1 + def v = node2.velocityOfPoint(connection2) - node1.velocityOfPoint(connection1) + + /* x = connection2 - connection1 + * C = x + * Cdot = v = v2 - v1 = v2 + (w2 cross r2) - v1 - (w1 cross r1) + * J = [-I -r1_skew I r2_skew ] ????? + */ + def correctVelocity(h: Double) = { + val m1 = node1.mass + val m2 = node2.mass + val I1 = node1.I + val I2 = node2.I + val r1 = connection1 - node1.pos + val r2 = connection2 - node2.pos + + val K1 = new Matrix22(1/m1 + 1/m2, 0, + 0, 1/m1 + 1/m2) + val K2 = new Matrix22(1/I1 * r1.x * r1.x, -1/I1 * r1.x * r1.y, + -1/I1 * r1.x * r1.y, 1/I1 * r1.x * r1.x) + val K3 = new Matrix22(1/I2 * r2.x * r2.x, -1/I2 * r2.x * r2.y, + -1/I2 * r2.x * r2.y, 1/I2 * r2.x * r2.x) + val pivotMass = (K1 + K2 + K3).invert + val cdot = v + val p = pivotMass * cdot + node1.applyImpulse(p, connection1) + node2.applyImpulse(-p, connection2) + } + + def correctPosition(h: Double) = { + + } +} diff --git a/src/sims/dynamics/joints/SpringJoint.scala b/src/sims/dynamics/joints/SpringJoint.scala new file mode 100644 index 0000000..f03b35d --- /dev/null +++ b/src/sims/dynamics/joints/SpringJoint.scala @@ -0,0 +1,60 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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 + */ +case class SpringJoint(node1: Body, anchor1: Vector2D, node2: Body, anchor2: Vector2D, springConstant: Double, initialLength: Double) extends Joint with ForceJoint{ + + def this(node1: Body, anchor1: Vector2D, node2: Body, anchor2: Vector2D, springConstant: Double) = { + this(node1: Body, anchor1, node2: Body, anchor2, springConstant: Double, (anchor2 - anchor1).length) + } + + def this(node1: Body, node2: Body, springConstant: Double, initialLength: Double) = { + this(node1: Body, node1.pos, node2: Body, node2.pos, springConstant: Double, initialLength: Double) + } + def this(node1: Body, node2: Body, springConstant: Double) = { + this(node1: Body, node1.pos, node2: Body, node2.pos, springConstant: Double, (node2.pos - node1.pos).length) + } + + private val a1 = anchor1 - node1.pos + private val a2 = anchor2 - node2.pos + private val initRotation1 = node1.rotation + private val initRotation2 = node2.rotation + + /**Ergibt den Bindungspunkt auf Koerper eins.*/ + def connection1 = (a1 rotate (node1.rotation - initRotation1)) + node1.pos + + /**Ergibt den Bindungspunkt auf Koerper zwei.*/ + def connection2 = (a2 rotate (node2.rotation - initRotation2)) + node2.pos + + /**Daempfung.*/ + var damping = 0.0 + + /**Relative Position der Bindungspunkte.*/ + def x = connection2 - connection1 + + /**Ergibt die Federkraft nach dem Hookschen Gesetz.*/ + def force = (x.length - initialLength) * springConstant + + /**Uebt die Federkraft auf die Bindungspunkte aus.*/ + def applyForce() = { + node1.applyForce(x.unit * force - ((node1 velocityOfPoint connection1) * damping) project x, connection1) + node2.applyForce(-x.unit * force - ((node2 velocityOfPoint connection2) * damping) project x, connection2) + } + + def correctPosition(h: Double) = () + def correctVelocity(h: Double) = () +} \ No newline at end of file diff --git a/src/sims/dynamics/joints/test/UnitCircleJoint.scala b/src/sims/dynamics/joints/test/UnitCircleJoint.scala new file mode 100644 index 0000000..64f613c --- /dev/null +++ b/src/sims/dynamics/joints/test/UnitCircleJoint.scala @@ -0,0 +1,45 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.dynamics.joints.test + +import sims.dynamics._ +import sims.geometry._ + +class UnitCircleJoint(body: Body, anchor: Vector2D) extends Joint{ + + val node1 = body + val node2 = body + + private val a = anchor - body.pos + private val initRotation = body.rotation + def connection = (a rotate (body.rotation - initRotation)) + body.pos + def x = connection + def v = body.velocityOfPoint(connection) + + /* + * C = ||x|| - 1 + * Cdot = x/||x|| dot v = u dot v + * J = [u (r cross u)] + */ + def correctVelocity(h: Double) = { + val r = connection - body.pos + val u = x.unit + val cr = r cross u + val mc = 1.0/(1/body.mass + 1/body.I * cr * cr) + val lambda = -mc * (u dot v) + val Pc = u * lambda + + val vupdate = u * lambda / body.mass + val wupdate = (r cross u) * lambda / body.I + + println("dv = " + vupdate + " dw = " + wupdate) + body.linearVelocity = body.linearVelocity + u * lambda / body.mass + body.angularVelocity = body.angularVelocity + (r cross u) * lambda / body.I + } + + def correctPosition(h: Double) = {} +} diff --git a/src/sims/geometry/ConvexPolygon.scala b/src/sims/geometry/ConvexPolygon.scala new file mode 100644 index 0000000..7bf881c --- /dev/null +++ b/src/sims/geometry/ConvexPolygon.scala @@ -0,0 +1,61 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.geometry + +import sims.collision._ +import sims.geometry._ + +/**Gemeinsame Eigenschaften aller konvexen Polygone.*/ +trait ConvexPolygon { + + /**Ergibt Position aller Ecken dieses Polygons. Die Ecken sind gegen den Uhrzeigersinn folgend. + * @return Ortsvektoren der Ecken*/ + def vertices: Seq[Vector2D] + + /**Ergibt alle Seiten dieses Polygons. + * @return Seiten dieses Polygons*/ + 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*/ + 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} + Projection(axis, + (bounds(0) /: bounds)(Math.min(_,_)), + (bounds(0) /: bounds)(Math.max(_,_))) + } + + /**Errechnet das AABB dieses Polygons + * @return umfassendes AABB + * @see collision.AABB*/ + def AABB = { + val xs = vertices map (_.x) + val ys = vertices map (_.y) + new AABB(Vector2D(Iterable.min(xs), Iterable.min(ys)), + Vector2D(Iterable.max(xs), Iterable.max(ys))) + } + + /**Ueberprueft ob sich der gegebene Punkt point in diesem Polygon befindet. + *

+ * 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.*/ + def contains(point: Vector2D) = { + val r = new Ray(point, Vector2D.i) + var intersections = 0 + for (s <- sides; if (r intersects s)) intersections += 1 + for (v <- vertices; if (r contains v)) intersections -= 1 + intersections % 2 != 0 + } +} diff --git a/src/sims/geometry/Projection.scala b/src/sims/geometry/Projection.scala new file mode 100644 index 0000000..5f2d0f0 --- /dev/null +++ b/src/sims/geometry/Projection.scala @@ -0,0 +1,34 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.geometry + +import sims.math._ + +/**Projektion auf eine Achse. + *

+ * 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*/ +case class Projection(axis: Vector2D, + lower: Double, + upper: Double) { + require(axis != Vector2D.Null) + + /**Ueberprueft ob sich diese Projektion mit der Projektion other ueberschneidet.*/ + 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.*/ + 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 new file mode 100644 index 0000000..c898e03 --- /dev/null +++ b/src/sims/geometry/Ray.scala @@ -0,0 +1,53 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.geometry + +import sims.math._ +import Math._ + +/**Eine Halbgerade wird definiert durch: + * @param point ein Aufpunkt + * @param direction ein Richtungsvektor*/ +case class Ray(point: Vector2D, direction: Vector2D) { + + //Ein Nullvektor hat keine Richtung + require(direction != Vector2D.Null) + + /**Ueberprueft ob diese Halbgerade das gegebene Segment ueberschneidet. + * @param das auf Ueberschneidung zu uerberpruefende Segment*/ + def intersects(s: Segment) = { + val p1 = point + val p2 = point + direction + val p3 = s.vertex1 + val p4 = s.vertex2 + val d = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y) + val na = (p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x) + val nb = (p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x) + if (d == 0 && na == 0 && nb == 0) + true //lines are coincident + else if (d == 0) + false //parallel + else { + val ua = na / d + val ub = nb / d + (ub >= 0) && (ub <= 1) && (ua >= 0) + } + } + + /**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*/ + def contains(p: Vector2D) = { + val v = p - point + p == point || + Matrix22(direction, v).det == 0 && + signum(direction.x) == signum(v.x) && + signum(direction.y) == signum(v.y) + } +} diff --git a/src/sims/geometry/Segment.scala b/src/sims/geometry/Segment.scala new file mode 100644 index 0000000..8700979 --- /dev/null +++ b/src/sims/geometry/Segment.scala @@ -0,0 +1,70 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.geometry + +/**Ein Segment wird durch seine beiden Extrempunkte gegeben. + * @param vertex1 Ortsvektor des 1. Extrempunkts + * @param vertex2 Ortsvektor des 2. Extrempunkts*/ +case class Segment(vertex1: Vector2D, vertex2: Vector2D){ + require(vertex1 != vertex2, "A segment must have 2 distinct vertices!") + + /**Laenge dieses Segments.*/ + val length = (vertex2 - vertex1).length + + /**Vektor von EP1 zu EP2.*/ + val d = vertex2 - vertex1 + + /**Einheitsrichtungsvektor.*/ + val d0 = d.unit + + /**Normalenvektor. Richtung: 90 Grad rechts zu d.*/ + val n = d.rightNormal + + /**Normaleneinheitsvektor. Richtung: 90 Grad rechts zu d.*/ + val n0 = n.unit + + /**Kleinster Abstand zwischen diesem Segment und dem Punkt p.*/ + def distance(point: Vector2D): Double = { + val v = point - vertex1 //Vektor von EP1 zu 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 + (v project n0).length + else if (alpha < 0) //Punkt ist naeher zu EP1 + (point - vertex1).length + else if (alpha > 0) //Punkt ist naeher zu EP2 + (point - vertex2).length + else + throw new IllegalArgumentException("Error occured trying to compute distance between segment and point.") + } + + def clipToSegment(s: Segment): Option[Vector2D] = { + + val distance1 = (vertex1 - s.vertex1) dot s.n0 + val distance2 = (vertex2 - s.vertex1) dot s.n0 + + if (distance1 * distance2 < 0) { //auf anderen Seiten + /* Geradengleichungen + * ================== + * Segment1: s1: x = a + alpha * r | alpha in [0,1] + * Segment2: s2: x = b + beta * s | beta in [0,1] + * + * alpha = [s2(a1-b1)-s1(a2-b2)] / [r2s1-r1s2] + * beta = [r2(b1-a1)-r1(b2-a2)] / [r1s2-r2s1] + * = [r1(b2-a2)]-r2(b1-a1) / [r2s1-r1s2] + * s1: vertex1 + alpha * d + * s2: s.vertex1 + beta * s.d + */ + val denom: Double = d.y * s.d.x - d.x * s.d.y + val alpha: Double = (s.d.y * (vertex1.x - s.vertex1.x) - s.d.x * (vertex1.y - s.vertex1.y)) / denom + val beta: Double = (d.x * (s.vertex1.y - vertex1.y) - d.y * (s.vertex1.x - vertex1.x)) / denom + if (0.0 <= alpha && alpha <= 1.0 && 0.0 <= beta && beta <= 1.0) Some(vertex1 + d * alpha) + else None + } + else None + } +} diff --git a/src/sims/geometry/Vector2D.scala b/src/sims/geometry/Vector2D.scala new file mode 100644 index 0000000..03d1ea4 --- /dev/null +++ b/src/sims/geometry/Vector2D.scala @@ -0,0 +1,99 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.geometry + +import scala.Math._ + +/**Ein 2-dimensionaler Vektor. + * @param x 1. Komponente + * @param y 2. Komponente*/ +case class Vector2D(x: Double, y: Double) { + + /**Vektoraddition. + * @param v zu addierender Vektor + * @return dieser Vektor addiert mit v*/ + def +(v: Vector2D): Vector2D = Vector2D(x + v.x, y + v.y) + + /**Vektorsubstraktion. + * @param v zu substrahierender Vektor + * @return dieser Vektor substrahiert mit v*/ + def -(v: Vector2D): Vector2D = this + (v * -1) + + /**Multiplikation mit einem Skalar. + * @param n Faktor + * @return dieser Vektor multipliziert mit n*/ + def *(n: Double): Vector2D = Vector2D(x * n, y * n) + + /**Division durch ein Skalar. + * @param n Nenner + * @return dieser Vektor dividiert durch n*/ + def /(n: Double): Vector2D = this * (1/n) + + /**Minusvorzeichen.*/ + def unary_- : Vector2D = Vector2D(-x, -y) + + /**Skalarprodukt. + * @param v ein anderer Vektor + * @return Skalarprodukt von diesem Vektor mit v*/ + 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.*/ + def cross(v: Vector2D): Double = x * v.y - y * v.x + + /**Norm dieses Vektors.*/ + val length: Double = Math.sqrt(x * x + y * y) + + /**Einheitsvektor dieses Vektors.*/ + 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*/ + def project(v: Vector2D): Vector2D = { + if (v != Vector2D.Null) + v * ((this dot v) / (v dot v)) + else + Vector2D.Null + } + + /**Errechnet eine Rotation dieses Vektors. + * @param angle Winkel in Radian + * @return der um angle rad rotierte Vektor*/ + def rotate(angle: Double): Vector2D = { + Vector2D(cos(angle) * x - sin(angle) * y, + cos(angle) * y + sin(angle) * x) + } + + /**Linker Normalenvektor. (-y, x)*/ + def leftNormal: Vector2D = Vector2D(-y, x) + + /**Rechter Normalenvektor. (y, -x)*/ + def rightNormal: Vector2D = Vector2D(y, -x) + + /**Ueberprueft, ob die Komponenten dieses Vektors gleich Null sind.*/ + def isNull: Boolean = this == Vector2D.Null + + /**Ergibt eine Liste der Komponenten dieses Vektors.*/ + def components = List(x, y) +} + +/**Dieses Objekt enthaelt spezielle Vektoren.*/ +object Vector2D { + + /**Nullvektor.*/ + val Null = Vector2D(0,0) + + /**Ein horizontaler Einheitsvektor mit den Komponenten (1;0).*/ + val i = Vector2D(1,0) + + /**Ein vertikaler Einheitsvektor mit den Komponenten (0;1).*/ + val j = Vector2D(0,1) +} + diff --git a/src/sims/math/Matrix22.scala b/src/sims/math/Matrix22.scala new file mode 100644 index 0000000..b10e02a --- /dev/null +++ b/src/sims/math/Matrix22.scala @@ -0,0 +1,57 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +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 + */ +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*/ + def this(c1: Vector2D, c2: Vector2D) = this(c1.x, c2.x, c1.y, c2.y) + + /**Ergibt die Determinante dieser Matrix. + * @return Determinante dieser Matrix*/ + def det = c11 * c22 - c21 * c12 + + /**Addition.*/ + def +(m: Matrix22) = + new Matrix22(c11 + m.c11, c12 + m.c12, + c21 + m.c21, c22 + m.c22) + + /**Multiplikation mit einem Skalar.*/ + def *(n: Double) = + new Matrix22(c11 * n, c12 * n, + c21 * n, c22 * n) + + /**Multiplikation mit einer anderen 2x2-Matrix.*/ + 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).*/ + def *(v: Vector2D) = + new Vector2D(c11 * v.x + c12 * v.y, + c21 * v.x + c22 * v.y) + + /**Inverse.*/ + def invert = + new Matrix22(c22 / det, -c12 / det, + -c21 / det, c11 / det) + } + +object Matrix22 { + def apply(c1: Vector2D, c2: Vector2D) = new Matrix22(c1.x, c2.x, c1.y, c2.y) +} diff --git a/src/sims/prefabs/Net.scala b/src/sims/prefabs/Net.scala new file mode 100644 index 0000000..d3f4d57 --- /dev/null +++ b/src/sims/prefabs/Net.scala @@ -0,0 +1,47 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.prefabs + +import sims.geometry._ +import sims.dynamics._ +import sims.dynamics.joints._ + +class Net(width: Int, height: Int, initPos: Vector2D) extends Prefab { + val nodeDistance: Double = 0.2 + val nodeRadius: Double = 0.05 + val nodeDensity: Double = 4 + + val springConstant: Double = 50 + val springDamping: Double = 0 + + private val connectors: Array[Array[Body]] = + makeConnectors(width, height) + + override val bodies: List[Body] = for (row <- connectors.toList; elem <- row) yield elem + override val joints = connect(connectors) + + private def makeConnectors(w: Int, h: Int): Array[Array[Body]] = { + for(i <- (0 until w).toArray[Int]) yield + for(j <- (0 until h).toArray[Int]) yield + new Body(new Circle(nodeRadius, nodeDensity) {pos = Vector2D(nodeDistance * i, nodeDistance * j) + initPos}) + } + + private def connect(connectors: Array[Array[Body]]): List[DistanceJoint] = { + var r: List[DistanceJoint] = Nil + for(i <- 0 to connectors.length - 1; j <- 0 to connectors(i).length - 1) { + if (i > 0) + r = connect(connectors(i-1)(j),connectors(i)(j)) :: r + if (j > 0) + r = connect(connectors(i)(j-1),connectors(i)(j)) :: r + } + r + } + + private def connect(s1: Body, s2: Body): DistanceJoint = + new DistanceJoint(s1, s1.pos, s2, s2.pos) + +} \ No newline at end of file diff --git a/src/sims/prefabs/Prefab.scala b/src/sims/prefabs/Prefab.scala new file mode 100644 index 0000000..84bb3b7 --- /dev/null +++ b/src/sims/prefabs/Prefab.scala @@ -0,0 +1,15 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.prefabs + +import sims.dynamics._ +import sims.dynamics.joints._ + +trait Prefab { + val bodies: Iterable[Body] = Nil + val joints: Iterable[Joint] = Nil +} diff --git a/src/sims/prefabs/Pylon.scala b/src/sims/prefabs/Pylon.scala new file mode 100644 index 0000000..7f3211f --- /dev/null +++ b/src/sims/prefabs/Pylon.scala @@ -0,0 +1,47 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.prefabs + +import sims.geometry._ +import sims.dynamics._ +import sims.dynamics.joints._ + +class Pylon extends Prefab{ + val position: Vector2D = Vector2D(2,1) + val nodeDensity: Double = 100 + val beamHeight: Double = 1 + val beamWidth: Double = 0.5 + val beamNumber: Int = 10 + + private val nodeRow1 = (for (i <- 0 to beamNumber) yield (new Circle(0.01, nodeDensity) { + pos = position + Vector2D(0, i * beamHeight)}).asBody).toList + private val nodeRow2 = (for (i <- 0 to beamNumber) yield (new Circle(0.01, nodeDensity) { + pos = position + Vector2D(beamWidth, i * beamHeight)}).asBody).toList + + private val beamRow1 = (for (i <- 0 until nodeRow1.length - 1) yield + new DistanceJoint(nodeRow1(i), nodeRow1(i).pos, nodeRow1(i+1), nodeRow1(i + 1).pos)).toList + private val beamRow2 = (for (i <- 0 until nodeRow1.length - 1) yield + new DistanceJoint(nodeRow2(i), nodeRow2(i).pos, nodeRow2(i+1), nodeRow2(i + 1).pos)).toList + + private val latBeams = (for (i <- 0 to beamNumber) yield + new DistanceJoint(nodeRow1(i), nodeRow2(i))).toList + private val diagBeams1 = (for (i <- 0 until beamNumber) yield + new DistanceJoint(nodeRow1(i), nodeRow2(i + 1))).toList + private val diagBeams2 = (for (i <- 0 until beamNumber) yield + new DistanceJoint(nodeRow2(i), nodeRow1(i + 1))).toList + + + + + lazy val nodes = nodeRow1 ++ nodeRow2 + lazy val beams = beamRow1 ++ beamRow2 ++ latBeams ++ diagBeams1 ++ diagBeams2 + + override val bodies = nodes + override val joints = beams + + +} diff --git a/src/sims/prefabs/Ragdoll.scala b/src/sims/prefabs/Ragdoll.scala new file mode 100644 index 0000000..ad58653 --- /dev/null +++ b/src/sims/prefabs/Ragdoll.scala @@ -0,0 +1,43 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.prefabs + +import sims.dynamics._ +import sims.dynamics.joints._ +import sims.geometry._ + +class Ragdoll(position: Vector2D) extends Prefab { + val headTorso = new Body(new Circle(0.1, 1) {pos = position}, + new Rectangle(0.09, 0.35, 1) {pos = position + Vector2D(0, -0.45)}) + val thigh1 = (new Rectangle(0.075, 0.17, 1) {pos = position + Vector2D(0, -0.97)}).asBody + val thigh2 = (new Rectangle(0.075, 0.17, 1) {pos = position + Vector2D(0, -0.97)}).asBody + val tibia1 = (new Rectangle(0.075, 0.25, 1) {pos = position + Vector2D(0, -1.39)}).asBody + val tibia2 = (new Rectangle(0.075, 0.25, 1) {pos = position + Vector2D(0, -1.39)}).asBody + val foot1 = (new Circle(0.08, 1) {pos = position + Vector2D(0, -1.72)}).asBody + val foot2 = (new Circle(0.08, 1) {pos = position + Vector2D(0, -1.72)}).asBody + val upperArm1 = (new Rectangle(0.17, 0.06, 1) {pos = position + Vector2D(0.17, -0.16)}).asBody + val upperArm2 = (new Rectangle(0.17, 0.06, 1) {pos = position + Vector2D(-0.17, -0.16)}).asBody + val forearm1 = (new Rectangle(0.15, 0.06, 1) {pos = position + Vector2D(0.49, -0.16)}).asBody + val forearm2 = (new Rectangle(0.15, 0.06, 1) {pos = position + Vector2D(-0.49, -0.16)}).asBody + val hand1 = (new Circle(0.07, 1) {pos = position + Vector2D(0.71, -0.16)}).asBody + val hand2 = (new Circle(0.07, 1) {pos = position + Vector2D(-0.71, -0.16)}).asBody + + override val bodies = List(headTorso, + thigh1, thigh2, + tibia1, tibia2, + foot1, foot2, + upperArm1, upperArm2, + forearm1, forearm2, + hand1, hand2) + private val shapes = bodies.flatMap(_.shapes) + for (s <- shapes) s.transientShapes ++= shapes + + val shoulder1 = RevoluteJoint(headTorso, upperArm1, position + Vector2D(0, -0.16)) + val shoulder2 = RevoluteJoint(headTorso, upperArm2, position + Vector2D(0, -0.16)) + override val joints = List(shoulder1, shoulder2) + +} diff --git a/src/sims/util/Polar.scala b/src/sims/util/Polar.scala new file mode 100644 index 0000000..931be08 --- /dev/null +++ b/src/sims/util/Polar.scala @@ -0,0 +1,17 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.util + +import sims.geometry._ +import scala.Math._ + +/**Polare Koordinaten.*/ +case class Polar(distance: Double, angle: Double) { + + /**Ergibt die Vektorrepraesantation dieser polaren Koordinaten.*/ + def toCarthesian = Vector2D(distance * sin(angle), distance * cos(angle)) +} diff --git a/src/sims/util/Positioning.scala b/src/sims/util/Positioning.scala new file mode 100644 index 0000000..433feaf --- /dev/null +++ b/src/sims/util/Positioning.scala @@ -0,0 +1,24 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.util + +import sims.geometry._ +import sims.dynamics._ + +/**Objekt mit Hiflsfunktionen fuer komfortables Positionieren von Koerpern.*/ +object Positioning { + + implicit def int2RelativeVector(x: Int): RelativeVector = new RelativeVector(x, 0) + implicit def double2RelativeVector(x: Double): RelativeVector = new RelativeVector(x, 0) + implicit def vector2RelativeVector(v: Vector2D): RelativeVector = new RelativeVector(v.x, v.y) + implicit def polar2Carthesian(p: Polar): Vector2D = p.toCarthesian + implicit def polar2RelativeVector(p: Polar): RelativeVector = vector2RelativeVector(p.toCarthesian) + + def position(s: Shape)(a: Vector2D) = { + s.pos = a + } +} diff --git a/src/sims/util/RelativeVector.scala b/src/sims/util/RelativeVector.scala new file mode 100644 index 0000000..374f92c --- /dev/null +++ b/src/sims/util/RelativeVector.scala @@ -0,0 +1,24 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.util + +import sims.geometry._ +import sims.dynamics._ + +class RelativeVector(val x: Double, val y: Double) { + def above(point: Vector2D): Vector2D = point + Vector2D(0, x) + def below(point: Vector2D): Vector2D = point - Vector2D(0, x) + def left(point: Vector2D): Vector2D = point - Vector2D(x, 0) + def right(point: Vector2D): Vector2D = point + Vector2D(x, 0) + def from(point: Vector2D): Vector2D = point + Vector2D(x, y) + + def above(s: Shape): Vector2D = this.above(s.pos) + def below(s: Shape): Vector2D = this.below(s.pos) + def left(s: Shape): Vector2D = this.left(s.pos) + def right(s: Shape): Vector2D = this.right(s.pos) + def from(s: Shape): Vector2D = this.from(s.pos) +} -- cgit v1.2.3