Point2PointConstraint refuses to move, at all.

gsimard
Posts: 4
Joined: Fri Mar 01, 2013 5:20 pm

Point2PointConstraint refuses to move, at all.

Post by gsimard »

Hello,

I'm trying to use a Point2PointConstraint between two objects in my game.

For some reason, whenever I do, the objects just get completely stuck.

One object is much more massive than the other (1000x).

If I understand properly the way Point2PointConstraint is supposed to work, using it with a single object should allow that object to spin freely about its pivot, right ? As in: btPoint2PointConstraint(body, pivot)

Even when doing that, the object (body) gets stuck. I can crash stuff all I want into it and it won't bulge.

Did I get the basics wrong here ?

Thank you,
Guillaume
gsimard
Posts: 4
Joined: Fri Mar 01, 2013 5:20 pm

Re: Point2PointConstraint refuses to move, at all.

Post by gsimard »

Ah, I think I'm unto something.

The two objects I'm linking have collision shapes of type BvhTriangleMeshShape which extends TriangleMeshShape, which (rightfully) does not know how to calculate its inertia tensor.

Code: Select all

	public void calculateLocalInertia(float mass, Vector3f inertia) {
		// moving concave objects not supported
		assert (false);
		inertia.set(0f, 0f, 0f);
	}
I've inherited BvhTriangleMeshShape and added a calculateLocalInertia similar to that of the SphereShape and it seems to work now.. more testing needed though :)

Cheers,
Guillaume