Right now i'm only gonna explain the box. since its the only primitive i've had issues with so far.
So if you have a box primtiive that is either set as immovable or in a standalone collisionskin the physics are incredibly jittery between the two, causing the body/collision skin to never go inactive.
I've tested this code in the JiggleGame.cs file to make sure it was non of the stuff in my game environment. I don't really consider this these to be small boxes ( in the code below these would be 10 centimeters by 30.. not really small ).
So i have a immovable box that is 4x1x4 meters and the jinga boxes have been scaled 10%. Just to be clear this issue is with a box being used as a immoveable. It doesnt seem to happen with things larger than.. i dont know what size but i know 1x1x1 is somewhat stable.
To test this replace the CreateScene6 with this function below.
private void CreateScene6() { BoxObject boxFloor = new BoxObject(this, boxModel, new Vector3(4, 1, 4), Matrix.Identity, Vector3.Down * 14); // PG: test of immovable body boxFloor.PhysicsBody.Immovable = true; /* PG: test of collision skin without body. boxFloor.PhysicsBody.DisableBody(); boxFloor.PhysicsBody.CollisionSkin.Owner = null; physicSystem.CollisionSystem.AddCollisionSkin(boxFloor.PhysicsBody.CollisionSkin); */ this.Components.Add(boxFloor); float JingaScale = 0.1f; Vector3 PositionOffset = new Vector3(-JingaScale, -12, -1); for (int i = 0; i < 10; i += 2) { BoxObject boxObj0 = new BoxObject(this, boxModel, new Vector3(1, 1f, 3) * JingaScale, Matrix.Identity, new Vector3(0, i * 1f, 1) * JingaScale + PositionOffset); BoxObject boxObj1 = new BoxObject(this, boxModel, new Vector3(1, 1f, 3) * JingaScale, Matrix.Identity, new Vector3(1, i * 1f, 1) * JingaScale + PositionOffset); BoxObject boxObj2 = new BoxObject(this, boxModel, new Vector3(1, 1f, 3) * JingaScale, Matrix.Identity, new Vector3(2, i * 1f, 1) * JingaScale + PositionOffset); this.Components.Add(boxObj0); this.Components.Add(boxObj1); this.Components.Add(boxObj2); BoxObject boxObj3 = new BoxObject(this, boxModel, new Vector3(3, 1f, 1) * JingaScale, Matrix.Identity, new Vector3(1, i * 1f + 1f, 0) * JingaScale + PositionOffset); BoxObject boxObj4 = new BoxObject(this, boxModel, new Vector3(3, 1f, 1) * JingaScale, Matrix.Identity, new Vector3(1, i * 1f + 1f, 1) * JingaScale + PositionOffset); BoxObject boxObj5 = new BoxObject(this, boxModel, new Vector3(3, 1f, 1) * JingaScale, Matrix.Identity, new Vector3(1, i * 1f + 1f, 2) * JingaScale + PositionOffset); this.Components.Add(boxObj3); this.Components.Add(boxObj4); this.Components.Add(boxObj5); } for (int i = 0; i < 10; i++) { CylinderObject cyl = new CylinderObject(this, 0.5f, 1.0f, new Vector3(5, i * 1.01f - 14.2f, 0), cylinderModel); this.Components.Add(cyl); } RagdollObject rgd; // professional stuntmen, noone gets hurt! for (int e = 0; e < 2; e++) { for (int i = 0; i < 2; i++) { rgd = new RagdollObject(this, capsuleModel, sphereModel, boxModel, RagdollObject.RagdollType.Simple, 1.0f); rgd.Position = new Vector3(e * 2, -14, 10 + i * 2); rgd.PutToSleep(); } } for (int x = 0; x < 8; x++) { for (int y = 0; y < 3; y++) if (y % 2 == 0) this.Components.Add(new BoxObject(this, boxModel, new Vector3(1, 1, 1), Matrix.Identity, new Vector3(x * 1.01f - 10.0f, y * 1.01f - 14.5f, 0))); else this.Components.Add(new BoxObject(this, boxModel, new Vector3(1, 1, 1), Matrix.Identity, new Vector3(x * 1.01f - 10.5f, y * 1.01f - 14.5f, 0))); } }
BTW, my understanding is JigLibX's units are meters. So i really think it would be a good idea for all the examples to use something to scale. maybe at least have the ragdolls or car being to scale, Unless i'm incorrect about meters being the scale.
Also This issue does not stand out untill you apply the intertia tensor to the smaller bodies (i'm using GetPrimitiveProperties). My thoughts on that: the values of the matrix are very small like ~ 0.1e-20 .
I'm really hoping I will not end up having to rescale my entire project to get stuff to stop bouncing. I'm planning on having fast moving objects and the 300 meter/s velocity cap i read about in the forums might get in the way.