is everything based of the 1st shape you add?
Nope, it's based on the center of mass. It just so happens that the first shape's position also aligned with the center of mass. Since the positions specified are the centers of mass of the constituent shapes, and they have equal weight, the center of mass of that compound was just the average of the three points.
Here's another example. It's almost the same, but the weight of the last shape has been increased a huge amount.
var bodies = new List<CompoundShapeEntry>()
{
new CompoundShapeEntry(new SphereShape(.5f), new Vector3(0, 5, 0), 1),
new CompoundShapeEntry(new ConeShape(2, .5f), new Vector3(1, 5, 0), 1),
new CompoundShapeEntry(new SphereShape(.5f), new Vector3(-1, 5, 0), 1000)
};
var cb1 = new CompoundBody(bodies, 45);
This demonstrates how the weighted average works. cb1.Position is {X:-0.997006 Y:5 Z:0}. The local offsets are:
[0]: {X:0.997006 Y:0 Z:0}
[1]: {X:1.997006 Y:0 Z:0}
[2]: {X:-0.002994001 Y:0 Z:0}
Adding everything up still comes out to the correct world space positions. However, now that the weight is so high for the last entry, the center of mass is almost aligned with the last shape! This is also reflected in the calculation of the inertia tensor, which puts 1000/1002 of the mass on the last sphere, and 1/1002 for the other two shapes.
The order of entries isn't considered when computing the center of mass or anything else.
What's odd is that when I move the heavy body up (change its Y value) it stays at the same location, but the two side bodies move up... is that expected from what you explained?
The final world space positions will all be in the expected locations. However, the local space positions are based around the compound body's center of mass. Moving the heavy middle object upward moves the center of mass upward almost as much as the heavy object moves, since it's such a significant part of the total weight. Relative to the center of mass, the two light objects are lower now in local space.
It may help to visualize this situation in the extreme case- imagine the middle object had very nearly 100% of the total weight, so that shape's center was also the compound's center. If you move the heavy object up but keep the light objects stationary, it's equivalent to moving the two nearly weightless shapes down (in local space).