JOODE: BoxBoxCollisions

Ok - this seems to be a major problem, so I’ve just opened a new thread for that.

I’ve found a very strange effect. If I scale the normal with an value >1 the objects seem to behave more ok, if the value <1 the strange effect increases.

I’ve changed the normal this way:


		if (normalR != null) {

			normal.m[0] = normalR.getValue(0);

			normal.m[1] = normalR.getValue(4);

			normal.m[2] = normalR.getValue(8);

		}

		else {

			MathUtils.dMULTIPLY0_331 (normal,b1.R,normalC);

		}

		normal.scale(20f);  // <- THIS  IS  MY  CHANGE

		invert_normal = !invert_normal; //SEEMS TO MAKE THE CODE WORK A BIT BETTER :-(

		if (invert_normal) {

			normal.scale(-1);

		}

		depth = -s;


Something I also found out: some boxes seem to disappear, when they collide. This is more or less independent of the scale value (at least I wasn’t able to see a major difference)

The boxes dissapearing I think is the calculations being screwed up somewhere, and the boxes given an infinite position or something. Hmmm. Maybe there should be a fail safe somewhere to make sure that does not happen.

When I collide the Boxes I get loads of
vector has zero size
messages.

I don’t get those, when I collide Spheres. Do you know where this message gets called?

Edit:
Ok found it: MathUtils.dNormalize4(Real)
It again has nothing directly to do with BoxBoxCollsions. As the only possibility it could get called from is:

dxStepBody(float) - net.java.dev.joode.body.Body
	step(World, Body[], int, Joint[], int, float) - net.java.dev.joode.stepper.InternalStepIsland_x1
		dxProcessIslands(World, float, StepperFunction) - net.java.dev.joode.stepper.StepUtils
			step(float) - net.java.dev.joode.world.World
				step() - net.java.dev.joode.test.step.SphereCollisionTest
					main(String[]) - net.java.dev.joode.test.step.SphereCollisionTest
		step(World, Body[], int, Joint[], int, float) - net.java.dev.joode.stepper.InternalStepIsland
			dxProcessIslands(World, float, StepperFunction) - net.java.dev.joode.stepper.StepUtils
				step(float) - net.java.dev.joode.world.World
					step() - net.java.dev.joode.test.step.SphereCollisionTest
						main(String[]) - net.java.dev.joode.test.step.SphereCollisionTest
	step(World, Body[], int, Joint[], int, float) - net.java.dev.joode.stepper.InternalStepIsland_x2
		dxProcessIslands(World, float, StepperFunction) - net.java.dev.joode.stepper.StepUtils
			step(float) - net.java.dev.joode.world.World
				step() - net.java.dev.joode.test.step.SphereCollisionTest

Oh you beat me to it. Yeah. The orientation gets screwed up in the step_island method I think at the bottom. I am not really sure what this actually means. It seems like it is probably the data that is put in the contactGeoms is not quite right and its causeing crazy side effects in the LCP algorithm. Unfortunatly the LCP algoithm is not really garuanteed to be correct anyway (even in the pure academic sense, forget about bugs) so its hard extrapolating meaning.