public RefModel() { modelID = ""; worldMatrix = Matrix.Identity; origen = new Origen(); rotX = 0; rotY = 0; rotZ = 0; transX = 1; transY = 1; transZ = 1; }
/// <summary> /// inserts the shape into the tree /// </summary> /// <param name="shape"></param> public void insert(Origen shape) { //insert the shape if there is no shape in this branch of the tree if (null == null) { // data = shape; } else { //theres data in this branch so decide which branch the shape will need to go to byte x, y, z; short ix, iy, iz; //check to see which side its on on the x axis if (shape.OrigenX > OrigenX) { x = 1; ix = 1; } else { x = 0; ix = -1; } if (shape.OrigenY > OrigenY) { y = 1; iy = 1; } else { y = 0; iy = -1; } if (shape.OrigenZ > OrigenZ) { z = 1; iz = 1; } else { z = 0; iz = -1; } //check to see if the branch in x,y,z is null and if it is construct it if (nodes[x][y][z] == null) { nodes[x][y][z] = new Octree(OrigenX + ix, OrigenY + iy, OrigenZ + iz); } //insert in the new tree nodes[x][y][z].insert(shape); } }
private List<Origen> getCollisions(Origen shape, List<Origen> shapes) { return null; }
/// <summary> /// Returns the shapes in the bucket of the most probale /// </summary> /// <param name="shape"></param> /// <returns></returns> public Origen[] getCollisions(Origen shape) { List<Origen> shapes = new List<Origen>(); return getCollisions(shape, shapes).ToArray(); }