CHAPTER 2 ■ SETTING UP DIFFERENT CAMERA MODES IN YOUR 3D WORLD
108
nodeDBL = new OcTreeNode(center + new Vector3(-sizeOver4, ➥
-sizeOver4, sizeOver4), sizeOver2);
childList.Add(nodeUFR);
childList.Add(nodeUFL);
childList.Add(nodeUBR);
childList.Add(nodeUBL);
childList.Add(nodeDFR);
childList.Add(nodeDFL);
childList.Add(nodeDBR);
childList.Add(nodeDBL);
}
private void Distribute(DrawableModel dModel)
{
Vector3 position = dModel.Position;
if (position.Y > center.Y) //Up
if (position.Z < center.Z) //Forward
if (position.X < center.X) //Left
nodeUFL.AddDrawableModel(dModel);
else //Right
nodeUFR.AddDrawableModel(dModel);
else //Back
if (position.X < center.X) //Left
nodeUBL.AddDrawableModel(dModel);
else //Right
nodeUBR.AddDrawableModel(dModel); ...