Attach rigidbody to a point
Posted: Wed Mar 18, 2020 12:30 pm
Hello, I am trying to create road sign, that can be broken when a certain impulsion or force is applied. I tried to create a Point2Point constraint to fix the rigidbody to a point, but it just added a certain sort of animation when another rigidbody walk through it.
So, can you help me to find a way to fix a rigidbody to point please ?
Code: Select all
CollisionShape boxShape = new BoxShape(new Vector3f(0.1f,1.5f,0.1f));
collisionShapes.add(boxShape);
tr.origin.set(0f, 1.5f-4.5f, 10);
box = localCreateRigidBody(10, tr, boxShape);
contraint = new Point2PointConstraint(box, new Vector3f(0,-1.5,0));
dynamicsWorld.addConstraint(contraint, false);