I need to create a number of objects made up of several rectangular boxes, possible best described by this "drawing":
Code: Select all
o-----o
|\ /|
| \ / |
| X |
| / \ |
|/ \|
o-----o
where o's is where joints are. I've got this working fine when centered at the origin (I calculate positions of the joints - the corners of the whole thing - and then the positions for the boxes from there), but cannot rotate this object. I've tried creating a rotation matrix arond a, for example, Vector3.Forward axis, and while the boxes get drawn correctl and seem to interract with the rest of the geometry correctly, the joints do not. I have code that destroys joints when the joined entities get too far from each other, and, immediately upon creation, the joins give an Error of about 1.3f (which tells me nothing, but its obviously not what it should be, since the edges boxes are much closer together).
I'll need to create many of these objects and do not know the positions and orientations ahead of time. Is there any way to create one centered at the origin and then transform the whole thing (so, all the Entities and all Joints) by a given Matrix?