summaryrefslogtreecommitdiff
path: root/src/graphyx/graphics/Parser.scala
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2009-11-28 20:25:35 +0000
committerJakob Odersky <jodersky@gmail.com>2009-11-28 20:25:35 +0000
commit5031df4b26afd515274b5ca34f0d5380a99e4223 (patch)
tree41aac12ec2c03426910de72486a2d87e58cebc44 /src/graphyx/graphics/Parser.scala
parentfbdf90f0deb14ddd8a457ff1f5f7715e4d3c2f2a (diff)
downloadsims-5031df4b26afd515274b5ca34f0d5380a99e4223.tar.gz
sims-5031df4b26afd515274b5ca34f0d5380a99e4223.tar.bz2
sims-5031df4b26afd515274b5ca34f0d5380a99e4223.zip
Minor graphyx modifications. Added tests. Added 'PrismaticJoint' (still incomplete). Started to transfer 'ForceJoints' to ordinary joints who use only constraints for correction. Started to add materials.
Diffstat (limited to 'src/graphyx/graphics/Parser.scala')
-rw-r--r--src/graphyx/graphics/Parser.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/graphyx/graphics/Parser.scala b/src/graphyx/graphics/Parser.scala
index 7871ae8..9468d16 100644
--- a/src/graphyx/graphics/Parser.scala
+++ b/src/graphyx/graphics/Parser.scala
@@ -24,7 +24,8 @@ object Parser {
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.")
+ case j: Joint => if (!throwOnUnknown) new GraphicalJoint{override val real = j; def draw = ()}
+ else throw new IllegalArgumentException("Cannot cast '" + real.getClass + "' to a graphical object.")
}
def toGraphical(real: Collision) = GraphicalCollision(real)