Hi there,
In the game I'm working on, I have a unit of troops (IAnimatedMesh's) that belong to Units (ISceneNode, created with both AddTest and AddEmpty)
What I need to do is be able to select the Unit's bounding box. The problem has been resizing the unit bounding box to include the bounding boxes of the troops. Here's my code:
this.unit_node.BoundingBox.Reset( 1, 1, 1 );
foreach ( TroopMesh t in this.troops )
{
this.unit_node.BoundingBox.AddInternalPoint(
t.MeshNode.BoundingBox );
}
However, when this is all done, the bounding box of unit_node hasn't changed any... I double checked that the bounding boxes of the troops where correct, and they are. Any ideas?
Bounding Box Problems
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1
Try doing this: For the first troop, set the bounding box to that. For each additional troop, add internal box.
[/code]
Code: Select all
int i = 0;
foreach (TroopMesh t in this.troops)
{
if (i == 0) unit_node.BoundingBox == t.MeshNode.BoundingBox;
else unit_node.BoundingBox.addInternalBox(t.MeshNode.BoundingBox);
i++;
}
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1