aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/sims/dsl/BodyPoint.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/sims/dsl/BodyPoint.scala')
-rw-r--r--src/main/scala/sims/dsl/BodyPoint.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/scala/sims/dsl/BodyPoint.scala b/src/main/scala/sims/dsl/BodyPoint.scala
new file mode 100644
index 0000000..5572b48
--- /dev/null
+++ b/src/main/scala/sims/dsl/BodyPoint.scala
@@ -0,0 +1,20 @@
+/* _____ _ __ ________ ___ *\
+** / ___/(_) |/ / ___/ |__ \ Simple Mechanics Simulator 2 **
+** \__ \/ / /|_/ /\__ \ __/ / copyright (c) 2011 Jakob Odersky **
+** ___/ / / / / /___/ / / __/ **
+** /____/_/_/ /_//____/ /____/ **
+\* */
+
+package sims.dsl
+
+import sims.dynamics._
+import sims.math._
+
+class BodyPoint(val body: Body, val point: Vector2D) {
+ def this(body: Body) = this(body, body.position)
+
+ def distance(bp: BodyPoint) = new DistanceJoint(body, point, bp.body, bp.point)
+
+ def revolute(bp: BodyPoint) = new RevoluteJoint(body, bp.body, point)
+
+} \ No newline at end of file