Compound Body entity with boxes. Incorrect local transform.
Posted: Sat Apr 16, 2011 1:34 pm
I've created a compound bound from a series of boxes:
The problem is that when I draw the original voxels and the white compound body they are not in the same place:

How can I make sure the compound body is centered correctly?
Code: Select all
int numVoxels = voxelAnimator.VoxelSettings.Length;
List<CompoundShapeEntry> boxes = new List<CompoundShapeEntry>(numVoxels);
for (int i = 0; i < numVoxels; ++i)
{
BoxShape box = new BoxShape(
voxelAnimator.VoxelSettings[i].Size,
voxelAnimator.VoxelSettings[i].Size,
voxelAnimator.VoxelSettings[i].Size
);
boxes.Add(
new CompoundShapeEntry(
box,
voxelAnimator.VoxelSettings[i].Position
)
);
}
entity = new CompoundBody(boxes);

How can I make sure the compound body is centered correctly?