public void box(double positionX, double positionY, double positionZ, string textureName, double height, double width) { Objects.Box b; Engine.Collision collision; b = new Objects.Box(positionX, positionY, positionZ, textureName, height, width); boxs.Add(b); collision = new Engine.Collision(positionX - width - 1, positionX + width + 1, positionZ - width - 1, positionZ + width + 1, 5); collisions.Add(collision); }
public void sphere(double radio, Color color, double positionX, double positionY, double positionZ) { Objects.Sphere s; Engine.Collision collision; s = new Objects.Sphere(radio, color, positionX, positionY, positionZ); spheres.Add(s); collision = new Engine.Collision(positionX - radio, positionX + radio, positionZ - radio, positionZ + radio, 3); collisions.Add(collision); }
public void cone(double radio, double height, Color color, double positionX, double positionY, double positionZ) { Objects.Cone c; Engine.Collision collision; c = new Objects.Cone(radio, height, color, positionX, positionY, positionZ); cones.Add(c); collision = new Engine.Collision(positionX - radio, positionX + radio, positionZ - (height / 2), positionZ + (height / 2), 4); collisions.Add(collision); }
public void end(double positionX, double positionY, double positionZ, string textureName, bool isX) { Objects.Photo p; Engine.Collision collision; p = new Objects.Photo(positionX, positionY, positionZ, textureName, 6, 1, isX); photos.Add(p); collision = new Engine.Collision(positionX - 1, positionX + 1, positionZ - 1, positionZ + 1, 4); collisions.Add(collision); }
public void enemy(double positionX, double positionY, double positionZ, string textureName, double height, double width) { Objects.Enemy e; Engine.Collision collision; e = new Objects.Enemy(positionX, positionY, positionZ, textureName, height, width); enemys.Add(e); enemys[enemys.Count - 1].indexCollision = collisions.Count; collision = new Engine.Collision(positionX - 2, positionX + 2, positionZ - 2, positionZ + 2, 3); collisions.Add(collision); }
public void wallZ(double z1, double z2, double x, double height, string textureName, bool hasColumnsInit, bool hasColumnsEnd) { int tree; Objects.Plane p; Objects.Rectangle r; Engine.Collision collision; Objects.Photo photo; collision = new Engine.Collision(x - 0.5, x + 0.5, z1, z2, 2); collisions.Add(collision); photo = new Objects.Photo(x + 0.1, 3.5, z2 - 5, "workArt" + random.Next(1, 19) + ".png", 4, 3, true); photos.Add(photo); tree = random.Next(1, 4); photo = new Objects.Photo(x + 0.2, 0, z2 - 8, "tree" + tree + ".png", 9, 2, true); photos.Add(photo); photo = new Objects.Photo(x + 0.2, 0, z2 - 3, "tree" + tree + ".png", 9, 2, true); photos.Add(photo); box(x + 4, 0, z2 - 2.1, "box" + random.Next(1, 5) + ".jpg", 3, 2); p = new Objects.Plane(); p.textureName = textureName; for (double i = z1; i < z2; i += quality) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x; r.points[0][1] = j; r.points[0][2] = i; r.points[1][0] = x; r.points[1][1] = j; r.points[1][2] = i + quality; r.points[2][0] = x; r.points[2][1] = j + quality; r.points[2][2] = i + quality; r.points[3][0] = x; r.points[3][1] = j + quality; r.points[3][2] = i; p.rectangles.Add(r); } } if (hasColumnsInit) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x - 0.2; r.points[0][1] = j; r.points[0][2] = z1; r.points[1][0] = x + 0.2; r.points[1][1] = j; r.points[1][2] = z1; r.points[2][0] = x + 0.2; r.points[2][1] = j + quality; r.points[2][2] = z1; r.points[3][0] = x - 0.2; r.points[3][1] = j + quality; r.points[3][2] = z1; p.rectangles.Add(r); } } if (hasColumnsEnd) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x - 0.2; r.points[0][1] = j; r.points[0][2] = z2; r.points[1][0] = x + 0.2; r.points[1][1] = j; r.points[1][2] = z2; r.points[2][0] = x + 0.2; r.points[2][1] = j + quality; r.points[2][2] = z2; r.points[3][0] = x - 0.2; r.points[3][1] = j + quality; r.points[3][2] = z2; p.rectangles.Add(r); } } planes.Add(p); }
public void wallX(double x1, double x2, double z, double height, string textureName, bool hasColumnsInit, bool hasColumnsEnd) { int tree; Objects.Plane p; Objects.Rectangle r; Engine.Collision collision; Objects.Photo photo; collision = new Engine.Collision(x1, x2, z - 0.5, z + 0.5, 1); collisions.Add(collision); photo = new Objects.Photo(x1 + 5, 3.5, z + 0.1, "workArt" + random.Next(1, 19) + ".png", 4, 3, false); photos.Add(photo); tree = random.Next(1, 4); photo = new Objects.Photo(x1 + 8, 0, z + 0.2, "tree" + tree + ".png", 9, 2, false); photos.Add(photo); photo = new Objects.Photo(x1 + 3, 0, z + 0.2, "tree" + tree + ".png", 9, 2, false); photos.Add(photo); box(x1 + 1.1, 0, z + 4, "box" + random.Next(1, 5) + ".jpg", 2, 1); p = new Objects.Plane(); p.textureName = textureName; for (double i = x1; i < x2; i += quality) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = i; r.points[0][1] = j; r.points[0][2] = z; r.points[1][0] = i + quality; r.points[1][1] = j; r.points[1][2] = z; r.points[2][0] = i + quality; r.points[2][1] = j + quality; r.points[2][2] = z; r.points[3][0] = i; r.points[3][1] = j + quality; r.points[3][2] = z; p.rectangles.Add(r); } } if (hasColumnsInit) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x1; r.points[0][1] = j; r.points[0][2] = z - 0.2; r.points[1][0] = x1; r.points[1][1] = j; r.points[1][2] = z + 0.2; r.points[2][0] = x1; r.points[2][1] = j + quality; r.points[2][2] = z + 0.2; r.points[3][0] = x1; r.points[3][1] = j + quality; r.points[3][2] = z - 0.2; p.rectangles.Add(r); } } if (hasColumnsEnd) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x2; r.points[0][1] = j; r.points[0][2] = z - 0.2; r.points[1][0] = x2; r.points[1][1] = j; r.points[1][2] = z + 0.2; r.points[2][0] = x2; r.points[2][1] = j + quality; r.points[2][2] = z + 0.2; r.points[3][0] = x2; r.points[3][1] = j + quality; r.points[3][2] = z - 0.2; p.rectangles.Add(r); } } planes.Add(p); }
public void wallZ(double z1, double z2, double x, double height, string textureName, double quality, bool hasColumnsInit, bool hasColumnsEnd) { Objects.Plane p; Objects.Rectangle r; Engine.Collision collision; collision = new Engine.Collision(x - 0.5, x + 0.5, z1, z2, 2); collisions.Add(collision); p = new Objects.Plane(); p.textureName = textureName; for (double i = z1; i < z2; i += quality) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x; r.points[0][1] = j; r.points[0][2] = i; r.points[1][0] = x; r.points[1][1] = j; r.points[1][2] = i + quality; r.points[2][0] = x; r.points[2][1] = j + quality; r.points[2][2] = i + quality; r.points[3][0] = x; r.points[3][1] = j + quality; r.points[3][2] = i; p.rectangles.Add(r); } } if (hasColumnsInit) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x - 0.2; r.points[0][1] = j; r.points[0][2] = z1; r.points[1][0] = x + 0.2; r.points[1][1] = j; r.points[1][2] = z1; r.points[2][0] = x + 0.2; r.points[2][1] = j + quality; r.points[2][2] = z1; r.points[3][0] = x - 0.2; r.points[3][1] = j + quality; r.points[3][2] = z1; p.rectangles.Add(r); } } if (hasColumnsEnd) { for (double j = 0; j < height; j += quality) { r = new Objects.Rectangle(); r.points[0][0] = x - 0.2; r.points[0][1] = j; r.points[0][2] = z2; r.points[1][0] = x + 0.2; r.points[1][1] = j; r.points[1][2] = z2; r.points[2][0] = x + 0.2; r.points[2][1] = j + quality; r.points[2][2] = z2; r.points[3][0] = x - 0.2; r.points[3][1] = j + quality; r.points[3][2] = z2; p.rectangles.Add(r); } } planes.Add(p); }