I'm having a problem with loading in an animatedb3d purely so i can use find childto get the various pieces of the model. I have a turret cannon as on of the children, BUT, it's global position is the same the centre of the combined mesh, because the mesh has been offset.
So, finding entityx() etc etc, gives me 0,0,0
Using entityx()+TRUE flag, gives me the 0,0,0 of the combined mesh. Basically 0,0,0 if i just load it in.
Problem is my turrent as i said, it offset from the 0,0,0, so any attempts to rotate it, cause the centre of rotation to be at 0,0,0 of the comined mesh locally, instead of rotating using the centre of the geometry.
The only way round this i can see is:
Run through all the vertices, and get the centre point in local co-ords from that.
FitMesh around the 0,0,0 locally.
The PositionEntity at the centre co-ords i found.
Is there an easier way?
So, finding entityx() etc etc, gives me 0,0,0
Using entityx()+TRUE flag, gives me the 0,0,0 of the combined mesh. Basically 0,0,0 if i just load it in.
Problem is my turrent as i said, it offset from the 0,0,0, so any attempts to rotate it, cause the centre of rotation to be at 0,0,0 of the comined mesh locally, instead of rotating using the centre of the geometry.
The only way round this i can see is:
Run through all the vertices, and get the centre point in local co-ords from that.
FitMesh around the 0,0,0 locally.
The PositionEntity at the centre co-ords i found.
Is there an easier way?