new Vector3f (0,0,1),
new Vector3f (0,0,1));
gelenk2.setLimit((float) Math.toRadians(-140), (float) Math.toRadians(-50));
Point2PointConstraint gewichtBefestigung = new Point2PointConstraint(
armAgent2.getRigidBody(),
gewichtAgent.getRigidBody(),
new Vector3f (5,0,0),
new Vector3f (0,0,0));
Transform localA = new Transform();
localA.setIdentity();
Transform localB = new Transform();
localB.setIdentity();
localA.origin.set(new Vector3f (0,0,0));
localB.origin.set(new Vector3f (0,0,0));
Generic6DofConstraint senkrecht = new Generic6DofConstraint(
groundAgent.getRigidBody(),
gewichtAgent.getRigidBody(),
localA,
localB,
true);
senkrecht.setLimit(0, -.9f, .9f);
senkrecht.setLimit(1, 7, 100);
senkrecht.setLimit(2, -.9f, .9f);
env.getDynamicsWorld().addConstraint(gelenk1, true);
env.getDynamicsWorld().addConstraint(gelenk2, true);
env.getDynamicsWorld().addConstraint(gewichtBefestigung, true);
env.getDynamicsWorld().addConstraint(senkrecht, true);
env.addAgent(groundAgent);
env.addAgent(armAgent1);
env.addAgent(armAgent2);
env.addAgent(gewichtAgent);
///////////////////////////////////////
////////////PENDEL
///////////////////////////////////////
BoxShape pendelShape = new BoxShape (new Vector3f (.5f,10,.5f));
env.getCollisionShapes().add(pendelShape);
ConstraintDemoAgent pendelAgent = new ConstraintDemoAgent(
idCounter++,
env,
env.getCollisionShapes().getQuick(2),
new Vector3f (10,25,10),
null,
.5f);
ConstraintDemoAgent pendelKugelAgent = new ConstraintDemoAgent(
idCounter++,
env,
env.getCollisionShapes().getQuick(1),
new Vector3f (10,5,10),
null,
5f);
Point2PointConstraint pendelAufhaengung = new Point2PointConstraint(
pendelAgent.getRigidBody(),
new Vector3f (0,11,0));
Point2PointConstraint pendelKugelBefestigung = new Point2PointConstraint(
pendelAgent.getRigidBody(),
pendelKugelAgent.getRigidBody(),
new Vector3f (0,-10,0),
new Vector3f (0,0,0));