Point to Point joints don't work right?

I’m probably configuring them wrong, but I’m trying to get some rigid bodies (Parts of a building) to be connected to each other by a Point to Point joint which has a very low allowed movement space. My code is something like the following:



[java]

private void configJoints() {

for(int x = 0; x < numOfParts - 1; x++) {

Vector3f connPoint = partModel[x].getWorldTranslation().clone()/.interpolate(partModel[x + 1].getWorldTranslation().clone(), 0.5f)/;

Vector3f pivotA = partModel[x].worldToLocal(connPoint.clone(), new Vector3f());

Vector3f pivotB = partModel[x + 1].worldToLocal(connPoint.clone(), new Vector3f());

Point2PointJoint connectionJoint = new Point2PointJoint(

partModel.get(x).getControl(RigidBodyControl.class),

partModel.get(x + 1).getControl(RigidBodyControl.class),

pivotA,

pivotB

);

}

Point2PointJoint holder = new Point2PointJoint(

partModel.get(numOfParts).getControl(RigidBodyControl.class),

worldModel.getControl(RigidBodyControl.class),

partModel.get(numOfParts).getWorldTranslation(),

buildingNode.getLocalTranslation());

}

[/java]

Some info on that:

partModel is an ArrayList field

numOfParts = partModel.size()

worldModel is the ground, it’s RigidBodyControl is the physics control of the ground

buildingNode is a Node that contains the location of the building, and all of it’s children.



I later call physicsState.getPhysicsSpace.addAll(buildingNode);



This does add the joints to the scene, and when the building parts have a mass of 0 it looks fine. But when I put the mass up, the joints act as if they’re not connected to each other, and the whole building just falls apart as if there were no joints. I turned on physicsState.getPhysicsSpace.enableDebug(), and I can see the green joints. They’re there, just not behaving correctly. Anybody have an idea why? Thanks in advance!

Edit: Those Vector3f’s shouldn’t be partModel[x], they should be partModel.get(x) and partModel.get(x + 1). Part of it was copied from old code, and that was part of it.

Nevermind, I just redid the entire code and it’s functional now. I must’ve missed something the first time around :stuck_out_tongue: if there’s s a way someone can like, delete this post, go for it.