blob: 0c7b23461c48c314e620e51264b9da60b2a4ecf6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* _____ _ __ ________ ___ *\
** / ___/(_) |/ / ___/ |__ \ Simple Mechanics Simulator 2 **
** \__ \/ / /|_/ /\__ \ __/ / copyright (c) 2011 Jakob Odersky **
** ___/ / / / / /___/ / / __/ **
** /____/_/_/ /_//____/ /____/ **
\* */
package sims.dsl
import sims.dynamics._
import sims.math._
class RichBody(val body: Body) {
def at(point: Vector2D) = new BodyPoint(body, point)
def atLocal(point: Vector2D) = new BodyPoint(body, body.position + point)
def :@(point: Vector2D) = at(point)
def :@@(point: Vector2D) = atLocal(point)
def @:(point: Vector2D) = at(point)
def @@:(point: Vector2D) = atLocal(point)
def @@(point: Vector2D) = at(point)
}
object Test {
val b = new Body(null)
val q = b :@@ (1.0, 2.0) revolute b
}
|