static void RenderWalls() { Gl.glLineWidth(2.0f); Gl.glBegin(Gl.GL_LINES); { WallForce shell = wallForce; Gl.glColor4f(0.75f, 0.75f, 0.75f, 0.5f); Gl.glVertex2d(shell.left + shell.border, shell.top); Gl.glVertex2d(shell.left + shell.border, shell.bottom); Gl.glVertex2d(shell.right - shell.border, shell.top); Gl.glVertex2d(shell.right - shell.border, shell.bottom); Gl.glVertex2d(shell.left, shell.top - shell.border); Gl.glVertex2d(shell.right, shell.top - shell.border); Gl.glVertex2d(shell.left, shell.bottom + shell.border); Gl.glVertex2d(shell.right, shell.bottom + shell.border); WallRepulse wall = world.bodyWallRepulse; Gl.glColor4f(0.5f, 0.5f, 0.5f, 1.0f); Gl.glVertex2d(wall.left + wall.border, wall.top); Gl.glVertex2d(wall.left + wall.border, wall.bottom); Gl.glVertex2d(wall.right - wall.border, wall.top); Gl.glVertex2d(wall.right - wall.border, wall.bottom); Gl.glVertex2d(wall.left, wall.top - wall.border); Gl.glVertex2d(wall.right, wall.top - wall.border); Gl.glVertex2d(wall.left, wall.bottom + wall.border); Gl.glVertex2d(wall.right, wall.bottom + wall.border); } Gl.glEnd(); }
public static void Initialize() { blueprintsCollection = new Array[7] { Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint, Blueprints.SimpleX3.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Building.blueprint, Blueprints.Chair.blueprint, Blueprints.Human.blueprint }; // SimpleX1; SimpleX2; SimpleX3; Rectangle; Human; Building; Chair; // bodiesCollection = new Array[2] { Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint }; //currentBlueprints = new Array[5] { Blueprints.SimpleX2.blueprint, Blueprints.SimpleX1.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint }; GenerateBodies(bodiesCollection); wallForce = new WallForce(9999, 9999); gravityForce = new GravityForce(); dragParticle = new DragParticle(); lockParticle = new LockParticle(); pushParticle = new PushParticleGroup(); panAndZoom = new PanAndZoom(); // automatic grouping of service elements IList <Object> groupElems = new List <Object>(); groupElems.Add(wallForce); groupElems.Add(gravityForce); groupElems.Add(dragParticle); groupElems.Add(lockParticle); groupElems.Add(pushParticle); groupElems.Add(panAndZoom); foreach (Object elem in groupElems) { if (elem is IEnvironmentForce) { world.environmentForces.Add(elem as IEnvironmentForce); } if (elem is IService) { interactionServices.Add(elem as IService); } if (elem is MouseService) { mouseServices.Add(elem as MouseService); } } }
public static void Initialize() { blueprintsCollection = new Array[7] { Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint, Blueprints.SimpleX3.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Building.blueprint, Blueprints.Chair.blueprint, Blueprints.Human.blueprint }; // SimpleX1; SimpleX2; SimpleX3; Rectangle; Human; Building; Chair; // bodiesCollection = new Array[2] { Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint }; //currentBlueprints = new Array[5] { Blueprints.SimpleX2.blueprint, Blueprints.SimpleX1.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint }; GenerateBodies(bodiesCollection); wallForce = new WallForce(9999, 9999); gravityForce = new GravityForce(); dragParticle = new DragParticle(); lockParticle = new LockParticle(); pushParticle = new PushParticleGroup(); panAndZoom = new PanAndZoom(); // automatic grouping of service elements IList<Object> groupElems = new List<Object>(); groupElems.Add(wallForce); groupElems.Add(gravityForce); groupElems.Add(dragParticle); groupElems.Add(lockParticle); groupElems.Add(pushParticle); groupElems.Add(panAndZoom); foreach (Object elem in groupElems) { if (elem is IEnvironmentForce) world.environmentForces.Add(elem as IEnvironmentForce); if (elem is IService) interactionServices.Add(elem as IService); if (elem is MouseService) mouseServices.Add(elem as MouseService); } }