Attach rigidbody to a point

Post Reply
YanisBDF
Posts: 1
Joined: Fri Jan 31, 2020 11:16 pm

Attach rigidbody to a point

Post by YanisBDF »

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.

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);
		
So, can you help me to find a way to fix a rigidbody to point please ?
Post Reply