예제 #1
0
파일: Schema.cpp 프로젝트: foogywoo/drone
bool Schema::connect(Schema::Connection &connection)
{
   Gear *gearA;                                                                             
   Gear *gearB;                                                                             
   AbstractPlug *input;                                                                     
   AbstractPlug *output;                                                                    
                                                                                            
   if ( (gearA=getGearByName(connection.gearA())) == NULL)                                        
   {                                                                                        
     std::cout << "connectPlugs fail: " + connection.gearA() + " not found!" << std::endl;  
     return false;                                                                                
   }                                                                                        
                                                                                                                                                                                        
   if ( (gearB=getGearByName(connection.gearB())) == NULL)                                        
   {                                                                                        
     std::cout << "connectPlugs fail: " + connection.gearB() + " not found!" << std::endl;  
     return false;                                                                                
   }                                                                                        
                                                                                            
   if ( (output=gearA->getOutput(connection.output())) == NULL)                             
   {                                                                                        
     std::cout << "connectPlugs fail: " + connection.output() + " not found!" << std::endl; 
     return false;                                                                                
   }                                                                                        
                                                                                            
   if ( (input=gearB->getInput(connection.input())) == NULL)                                
   {                                                                                        
     std::cout << "connectPlugs fail: " + connection.input() + " not found!" << std::endl;  
     return false;                                                                                
   }                                                                                        
                                                                                            
   return output->connect(input);
}
예제 #2
0
//Compares that two gears are equal
bool Gear::operator == (const Gear& other)
{
	return ((this->ownHead == other.getOwnItem(HEAD)) &&
		(this->ownBoots == other.getOwnItem(BOOTS)) &&
		(this->ownRing == other.getOwnItem(RING)) &&
		(this->ownShield == other.getOwnItem(SHIELD)) &&
		(this->ownWeapon == other.getOwnItem(WEAPON)));
}
예제 #3
0
void display (void)
{
	glClearColor (0.0, 0.0, 0.0, 0.0);
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glShadeModel (GL_SMOOTH);
	//glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );  // WIREFRAME
	
	displayFog();

	glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
	glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
	glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
	glLightfv(GL_LIGHT0, GL_POSITION, light_position);

	glMatrixMode (GL_MODELVIEW);
	glLoadIdentity();

	camera.update();

	glDisable(GL_CULL_FACE);
	skybox.display();
	glEnable(GL_CULL_FACE);

	table.display();
	drawShadows();
	mainGear.display();
	powerGear.display();
	smallMiddleGear.display();
	bigPowerGear.display();
	sideGear.display();
	sidePole.display();
	powerPole.display();
	powerPole2.display();
	powerPole3.display();
	powerPole4.display();
	sun.display();
	baseBox.display();
	coverBox.display();
	coverBox2.display();
	coverBox3.display();
	coverBox4.display();
	moonCylinder.display();
	drawPlanets();
	neptunePole.display();
	uranusPole.display();
	saturnPole.display();
	jupiterPole.display();
	marsPole.display();
	earthPole.display();
	venusPole.display();
	mercuryPole.display();
	saturnRingPole.display();

	glutSwapBuffers();
}
예제 #4
0
void idle(void)
{
	mainGear.spin(orbitSpeed * 60);  // values defined allow for good interlocking and speed , obtained through trial and error
	powerGear.spin(-orbitSpeed * 200); 
	smallMiddleGear.spin(orbitSpeed * 200);
	bigPowerGear.spin(-orbitSpeed * 60);
	sideGear.spin(-orbitSpeed * 400);
	sidePole.spin(orbitSpeed * 400);
	sun.update();
	updatePlanets();

	glutPostRedisplay();
}
예제 #5
0
Geom::PathVector
LPEGears::doEffect_path (Geom::PathVector const &path_in)
{
    Geom::PathVector path_out;
    Geom::Path gearpath = path_in[0];

    Geom::Path::iterator it(gearpath.begin());
    if ( it == gearpath.end() ) return path_out;

    Gear * gear = new Gear(teeth, 200.0, phi * M_PI / 180);
    Geom::Point gear_centre = (*it).finalPoint();
    gear->centre(gear_centre);
    gear->angle(atan2((*it).initialPoint() - gear_centre));

    ++it;
	if ( it == gearpath.end() ) return path_out;
    gear->pitch_radius(Geom::distance(gear_centre, (*it).finalPoint()));

    path_out.push_back( gear->path());

    for (++it; it != gearpath.end() ; ++it) {
        // iterate through Geom::Curve in path_in
        Gear* gearnew = new Gear(gear->spawn( (*it).finalPoint() ));
        path_out.push_back( gearnew->path() );
        delete gear;
        gear = gearnew;
    }
    delete gear;

    return path_out;
}
예제 #6
0
Geoscape::Geoscape(Career* career)
{
    _career = career;
    _endOfActivity = false;
    _requestedActivity = NULL;
    _passedTime = 0.0f;
    _blinkingTime = 0.0f;

    // create geoscape window
    _geoscape = Gameplay::iGui->createWindow( "Geoscape" ); assert( _geoscape );
    _geoscape->getPanel()->setRenderCallback( panelRenderCallback, this );
    _moveMap = false;
    _lastPosIsValid = false;
    _lastX = _lastY = 0;
    _currX = _currY = 0;
    _geoscapeMode = NULL;

    // create locations
    if( _career->isHomeDefined() )
    {
        Location* homeLocation = new Location( this, 0 );
        _locations.push_back( homeLocation );
        if( _career->getHomePlacementFlag() )
        {
            homeLocation->setPlayer( true );
            _career->setHomePlacementFlag( false );
        }
    }
    for( unsigned int i=1; i<database::LocationInfo::getNumRecords(); i++ )
    {
        _locations.push_back( new Location( this, i ) );
    }

    // make market offers
    for( unsigned int i=0; i<125; i++ )
    {
        Gear marketOffer = generateGear( getCore()->getRandToolkit()->getUniform( 0, 1 ) > 0.75f );
        if( marketOffer.isTradeable() ) addGearToMarket( marketOffer );
    }

    // MULTIVERSION ISSUE �    // if player is in inaccessible location
    if( _career->isHomeDefined() )
    {
        Location* location = getPlayerLocation();
        if( location && !database::LocationInfo::getRecord( location->getDatabaseId() )->accessible )
        {
            // move player to the dropzone
            location->setPlayer( false );
            getLocation( unsigned int( 0 ) )->setPlayer( true );
        }
예제 #7
0
void drawShadows()
{
	GLfloat shadow_proj[16];
	glDisable(GL_TEXTURE_2D);
	glDisable(GL_LIGHTING);
	glDisable(GL_DEPTH_TEST);
	glEnable(GL_BLEND);
	glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	
	glPushMatrix();
    GLfloat plane_eq[] = {0.0, 1.0, 0.0, 0.0};
	ShadowHelper::shadow_matrix(light_position,plane_eq,shadow_proj);
	glMultMatrixf(shadow_proj);
		
	coverBox.displayShadow();
	coverBox2.displayShadow();
	coverBox3.displayShadow();
	coverBox4.displayShadow();
	mainGear.displayShadow();
	powerGear.displayShadow();
	smallMiddleGear.displayShadow();
	bigPowerGear.displayShadow();
	sideGear.displayShadow();
	sidePole.displayShadow();
	powerPole.displayShadow();
	powerPole2.displayShadow();
	powerPole3.displayShadow();
	powerPole4.displayShadow();
	sun.displayShadow();
	baseBox.displayShadow();
	moonCylinder.displayShadow();
	drawPlanetsShadow();
	saturnRingPole.displayShadow();
	
	neptunePole.displayShadow();   // ONLY one visible at set lighting angle . Inner MIddle POle
	//uranusPole.displayShadow();  
	//saturnPole.displayShadow();
	//jupiterPole.displayShadow();
	//marsPole.displayShadow();
	//earthPole.displayShadow();
	//venusPole.displayShadow();
	//mercuryPole.displayShadow();

	glPopMatrix();

	glDisable(GL_BLEND);
	glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);
}
예제 #8
0
파일: Schema.cpp 프로젝트: foogywoo/drone
bool Schema::save(QDomDocument& doc, QDomElement &parent, bool onlySelected)
{
  QDomElement rootElem = doc.createElement(XML_TAGNAME.c_str());
  parent.appendChild(rootElem);

  //save all gears
  QDomElement gearsElem = doc.createElement("Gears");
  rootElem.appendChild(gearsElem);

  for (std::list<Gear*>::iterator it=_gears.begin();it!=_gears.end();++it)
  {
    GearGui* ggui = (*it)->getGearGui();
    if( onlySelected && ( ggui==NULL || !( ggui->isSelected() ) ))
      continue;
    std::cerr<<"About to save!"<<std::endl;
    (*it)->save(doc, gearsElem);            
  }


  //save all connections
  QDomElement connectionsElem = doc.createElement("Connections");
  rootElem.appendChild(connectionsElem);

  std::list<Connection*> connections;
  getAllConnections(connections);

  for (std::list<Connection*>::iterator it = connections.begin(); it != connections.end(); ++it)
  {
    Gear * gA = getGearByName((*it)->gearA());
    Gear * gB = getGearByName((*it)->gearB());
    GearGui* ggA = (gA==NULL?NULL:gA->getGearGui());
    GearGui* ggB = (gB==NULL?NULL:gB->getGearGui());
    
    if(onlySelected 
       && (ggA == NULL || !ggA->isSelected() || ggB == NULL || !ggB->isSelected()))
      continue;
       
    (*it)->save(doc, connectionsElem);
    delete (*it);//free
  }
    
  return true;
}
예제 #9
0
/*
 * "SHARAV TECH ENGINE" experiments
 */
int main(int argc, char** argv) {
    std::cout << "<<<<< WELCOME TO STE 0.0.1 >>>>>" << std::endl;
    std::cout << "<<<<< SYSTEM STARTING >>>>>" << std::endl;
    Gear *gear = Gear::getSingleton();
    DofExperiment *dofExp = new DofExperiment();
    DeferredExperiment *deferredExp = new DeferredExperiment();
    gear->addState("dof"     , dofExp);
    gear->addState("deferred", deferredExp);
    gear->changeState("deferred");
    while (gear->keepRunning()) {
        gear->input();
        gear->update();
        gear->render();
    }
    delete gear;
    std::cout << "<<<<< SYSTEM ENDED >>>>>" << std::endl;
    return 0;
}
예제 #10
0
void init (void) 
{
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_NORMALIZE);
	glCullFace(GL_BACK);
	glEnable(GL_COLOR_MATERIAL);
	glEnable(GL_TEXTURE_2D);

	skybox = SpaceWall();
	table = TableSurface();
	
	sun = Sun(0.0f , 13.0f , 0.0f);
	centralPole = Cylinder(0,8.0f,0 ,0.54f , 12.0f , 30);
	
	baseBox = Box(0,1.01f,0 , 10,10,2);
	coverBox = Box(0,3.2f,3.8f , 10,1,0.5);
	coverBox2 = Box(0,3.2f,-3.8f , 10,1,0.5);
	coverBox3 = Box(4.4f,3.3f,0 , 9,1,0.5);
	coverBox3.setAngle(90 ,180 , 90);
	coverBox4 = Box(-4.4f,3.3f,0 , 9,1,0.5f);
	coverBox4.setAngle(90 ,180 , 90);
	
	mainGear = Gear(0 ,2.3f ,0 , 0.5f , 4.0f ,  0.4f , 50 ,0.35f);
	bigPowerGear = Gear(-4.3f ,2.8f ,3.8f , 0.2f , 4.0f ,  0.4f , 50 ,0.35f);
	powerGear = Gear(4.3f ,2.3f ,3.8f , 0.2f , 1.6f ,  0.4f , 20 ,0.35f);
	smallMiddleGear = Gear(0 ,2.8f ,0 , 0.5f , 1.6f ,  0.4f , 20 ,0.35f);
	sideGear = Gear(5.9f ,1.5f ,3.8f , 0.2f , 0.7f ,  0.2f , 10 ,0.35f);
	sidePole = Cylinder(5.9f ,1.5f ,3.8f ,0.18f , 2.0f , 30);
	sidePole.setAngle(180 ,90 ,0);
	sideGear.setAngle(180 ,90 ,0);
	
	saturnRingPole = Cylinder(4.3f ,3.3f ,3.8f ,0.04f , 4.3f , 20);
	saturnRingPole.setAngle(0,0 ,0);
	
	powerPole = Cylinder(4.3f ,3.3f ,3.8f ,0.18f , 2.0f , 30);
	powerPole2 = Cylinder(-4.3f ,3.3f ,3.8f ,0.18f , 2.0f , 30);
	powerPole3 = Cylinder(-4.3f ,3.3f ,-3.8f ,0.18f , 2.0f , 30);
	powerPole4 = Cylinder(4.3f ,3.3f ,-3.8f ,0.18f , 2.0f , 30);
	
	moonCylinder = Cylinder(-4.3f ,3.3f ,2.0f ,0.3f, 1.0f , 30);

	neptunePole = Cylinder(0,4.62f,0 ,0.9f , 3.3f , 30);
	uranusPole = Cylinder(0,5.0f,0 ,0.8f , 3.5f , 30);
	saturnPole = Cylinder(0,5.4f,0 ,0.7f , 3.7f , 30);
	jupiterPole = Cylinder(0,5.8f,0 ,0.6f , 3.9f , 30);
	marsPole = Cylinder(0,6.2f,0 ,0.5f , 4.1f , 30);
	earthPole = Cylinder(0,6.58f,0 ,0.4f , 4.3f , 30);
	venusPole = Cylinder(0,6.96f,0 ,0.3f , 4.5f , 30);
	mercuryPole = Cylinder(0,8,0 ,0.2f , 5.0f , 30);

	saturnRing = SaturnRing(0 ,11.0f ,0 ,2.4f , 0.2f , 30);
	saturnRing.yAngle = -12;
	
	setUpPlanet(mercury , 5 ,4.1f ,9.5f , 0.4f , "Textures\\mercury.bmp");
	setUpPlanet(venus , 10 ,1.62f ,9.0f , 1.0f ,  "Textures\\venus.bmp");
	setUpPlanet(earth , 15 ,1 ,8.5f , 1.0 ,  "Textures\\earth.bmp");
	setUpPlanet(mars , 20 ,0.53f ,8.0f , 0.53f ,  "Textures\\mars.bmp");
	setUpPlanet(jupiter , 25 ,0.08f ,7.5 , 2.0f ,  "Textures\\jupiter.bmp");
	setUpPlanet(saturn , 30 ,0.0339f ,7.0f , 1.5f ,  "Textures\\saturn.bmp");
	setUpPlanet(uranus , 35 ,0.011f ,6.5f , 1.2f ,  "Textures\\uranus.bmp");
	setUpPlanet(neptune , 40 ,0.006f ,6.0f , 1.2f,  "Textures\\neptune.bmp");
	setUpPlanet(moon , 2 ,13 ,8.8f  , 0.3f ,  "Textures\\moon.bmp");

	//Earths Tilt
	earth.planet.setAngle(-90,23.5,0);
}
예제 #11
0
파일: Bolt.cpp 프로젝트: arturoc/gears
void Bolt::connectTo(Gear & gear){
	mom = &gear;

	ofLogNotice() << "connected " << getName() << " to " << gear.getName();
}
예제 #12
0
void Divine::onBeginEvent(Geoscape* geoscape)
{
    castBoogieEvent();
    castFestivalEvent();
    castClimbingEvent();
    castSmokeballEvent();
    castCommunityEvent();

    // if player isn't in home location and isn't travelling
    if( geoscape->getPlayerLocation() && geoscape->getPlayerLocation()->getDatabaseId() != 0 )
    {
        // location info
        database::LocationInfo* info = database::LocationInfo::getRecord( geoscape->getPlayerLocation()->getDatabaseId() );

        // home location travelling cost
        Vector2f currentCoords = geoscape->getPlayerLocation()->getLocationCoords();
        Vector2f targetCoords = geoscape->getHomeLocation()->getLocationCoords();
        float targetDistance = ( targetCoords - currentCoords ).length();
        targetDistance = targetDistance * 40075.696f / geoscape->getWindow()->getPanel()->getRect().getWidth();
        float referenceCost = 0.05f;
        float targetCost = targetDistance * referenceCost;
        float referenceTime = 0.1f;
        float targetTime = targetDistance * referenceTime;

        // check we have enought money to stay in location
        if( targetCost + info->stayFee < _career->getVirtues()->evolution.funds )
        {
            // pay fee
            _career->getVirtues()->evolution.funds -= info->stayFee;
        }
        else
        {
            // travel to home location
            // remove player from location
            unsigned int departureId = geoscape->getPlayerLocation()->getDatabaseId();
            geoscape->getPlayerLocation()->setPlayer( false );
            // decrease funds
            _career->getVirtues()->evolution.funds -= targetCost;
            // add event
            _career->addEvent( new Travel( _career, departureId, 0, targetTime ) );
            // message
            geoscape->addHistory( Gameplay::iLanguage->getUnicodeString(293), Vector4f( 1,0.25,0.25,1 ) );
        }
    }

    // simulate market dynamics
    unsigned int maxTransactions = 210;
    // simulate buying
    unsigned int numTransactions = getCore()->getRandToolkit()->getUniformInt() % maxTransactions;
    while( numTransactions && geoscape->getMarketSize() )
    {
        // buy random gear
        geoscape->removeGearFromMarket( 
            getCore()->getRandToolkit()->getUniformInt() % geoscape->getMarketSize()
        );
        numTransactions--;
    }
    // simulate selling
    numTransactions = getCore()->getRandToolkit()->getUniformInt() % maxTransactions;
    while( numTransactions )
    {
        // sell random gear
        Gear gear = geoscape->generateGear( getCore()->getRandToolkit()->getUniform( 0, 1 ) > 0.75f );
        if( gear.isTradeable() ) geoscape->addGearToMarket( gear );
        numTransactions--;
    }
}
void castingCallback_OpenAir_HardLanding(Actor* parent)
{
    Mission* mission = dynamic_cast<Mission*>( parent ); assert( mission );    

    // exit point
    Enclosure* exitPoint = parent->getScene()->getExitPointEnclosure( mission->getMissionInfo()->exitPointId );

    // cast player on exit point
    mission->setPlayer( new Jumper( mission, NULL, exitPoint, NULL, NULL, NULL ) );

    // setup full signature for player
    mission->getPlayer()->setSignatureType( stFull );

    // choose prize
    Gear prize;
    prize.state = 1.0f;
    unsigned int numOfAttempts = 0;
    do
    {
        switch( getCore()->getRandToolkit()->getUniformInt() % 4 )
        {
        case 0: 
            prize.type = gtHelmet;
            prize.id   = getCore()->getRandToolkit()->getUniformInt() % database::Helmet::getNumRecords();
            assert( prize.id < database::Helmet::getNumRecords() );
            break;
        case 1: 
            prize.type = gtSuit; 
            prize.id   = getCore()->getRandToolkit()->getUniformInt() % database::Suit::getNumRecords();
            assert( prize.id < database::Suit::getNumRecords() );
            break;
        case 2: 
            prize.type = gtRig; 
            prize.id   = getCore()->getRandToolkit()->getUniformInt() % database::Rig::getNumRecords();
            assert( prize.id < database::Rig::getNumRecords() );
            break;
        case 3: 
            prize.type = gtCanopy; 
            prize.id   = getCore()->getRandToolkit()->getUniformInt() % database::Canopy::getNumRecords();
            assert( prize.id < database::Canopy::getNumRecords() );
            break;
        default:
            assert( !"shouldn't be here!" );
        }
        numOfAttempts++;
        if( numOfAttempts >= 100 ) break;
    }
    while( !prize.isTradeable() );

    // cast goals
    new GoalStateOfHealth( mission->getPlayer() );
    new GoalStateOfGear( mission->getPlayer() );
    new GoalLanding( mission->getPlayer() );
    new GoalExperience( mission->getPlayer() );
	new GoalFreeFallTime( mission->getPlayer() );
	new GoalCanopyTime( mission->getPlayer() );

    // cast hard landing goal
    switch( getCore()->getRandToolkit()->getUniformInt() % 4 )
    {
    case 0:
        new GoalHardLanding( mission->getPlayer(), Vector3f( 54729.2f, 12.5f, 710.7f ), 25, prize );
        break;
    case 1:
        new GoalHardLanding( mission->getPlayer(), Vector3f( -20161.7f, 5270.0f, 14244.7f ), 15, prize );
        break;
    case 2:
        new GoalHardLanding( mission->getPlayer(), Vector3f( -33753.8f, 9175.5f, -41883.1f ), 25, prize );
        break;
    case 3:
        new GoalHardLanding( mission->getPlayer(), Vector3f( 29874.7f, 1350.1f, 15392.7f ), 25, prize );
        break;
    }

    // play original music for this mission
    Gameplay::iGameplay->playSoundtrack( "./res/sounds/music/lot of lie.ogg" );
}
예제 #14
0
/*
	Initial function, called before display
*/
void init(GLWrapper *glw)
{
	printInstructions();
	angle_x = 0.0f;
	angle_x_inc = 0.0f;
	angle_y = 0.0f;
	angle_y_inc = 0.0f;
	angle_z = 0.0f;
	angle_z_inc = 0.1f;
	scale_val = 1.0;
	move_model_x = 0;
	move_model_y = 0;
	move_model_z = 0;
	look_x = 0;
	look_y = 0;
	look_z = 0;

	aspect_ratio = 1.3333f;

	// Generate index (name) for one vertex array object
	glGenVertexArrays(1, &vao);

	// Create the vertex array object and make it current
	glBindVertexArray(vao);


	/* Define an array of colours */
	float vertexColours[] = {
		0.627f, 0.627f, 0.627f, 1.0f
	};
	
	/* Create vec4 arrays for each object and vec3 arrays to contain normals*/
	Gear gear;
	glm::vec4 * gearTest = gear.createGear(radius, sides, teeth, 0.195f, 0.0f);
	glm::vec3 * gearOneNormal = gear.calculateNormals(gearTest, sides, teeth);
	glm::vec4 * gearTwo = gear.createGear(0.3, 10, 5, 0.180f, 35.0f);
	glm::vec3 * gearTwoNormal = gear.calculateNormals(gearTwo, 10, 5);
	glm::vec4 * gearThree = gear.createGear(radius, sides, teeth, 0.195f, 24.0f);
	glm::vec3 * gearThreeNormal = gear.calculateNormals(gearThree, sides, teeth);
	glm::vec4 * gearFour = gear.createGear(1.0, 26, 16, 0.195f, 10.0f);
	glm::vec3 * gearFourNormal = gear.calculateNormals(gearFour, 26, 20);
	Crank crankClass;
	glm::vec4 * crank = crankClass.buildCrank();
	glm::vec3 * crankNormal = crankClass.calculateNormals(crank);
	
	/* Create a vertex buffer object to store vertices */
	glGenBuffers(1, &positionBufferGearOne);
	glBindBuffer(GL_ARRAY_BUFFER, positionBufferGearOne);
	glBufferData(GL_ARRAY_BUFFER, (368 * sizeof(glm::vec4)), gearTest, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	/* Create a vertex buffer object to store normals */
	glGenBuffers(1, &gearOneNormals);
	glBindBuffer(GL_ARRAY_BUFFER, gearOneNormals);
	glBufferData(GL_ARRAY_BUFFER, (368 * sizeof(glm::vec3)), gearOneNormal, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

	/* Create a vertex buffer object to store vertices */
	glGenBuffers(1, &positionBufferGearTwo);
	glBindBuffer(GL_ARRAY_BUFFER, positionBufferGearTwo);
	glBufferData(GL_ARRAY_BUFFER, (368 * sizeof(glm::vec4)), gearTwo, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	/* Create a vertex buffer object to store normals */
	glGenBuffers(1, &gearTwoNormals);
	glBindBuffer(GL_ARRAY_BUFFER, gearTwoNormals);
	glBufferData(GL_ARRAY_BUFFER, (368 * sizeof(glm::vec3)), gearTwoNormal, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

	/* Create a vertex buffer object to store vertices */
	glGenBuffers(1, &positionBufferGearThree);
	glBindBuffer(GL_ARRAY_BUFFER, positionBufferGearThree);
	glBufferData(GL_ARRAY_BUFFER, (368 * sizeof(glm::vec4)), gearThree, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	/* Create a vertex buffer object to store normals */
	glGenBuffers(1, &gearThreeNormals);
	glBindBuffer(GL_ARRAY_BUFFER, gearThreeNormals);
	glBufferData(GL_ARRAY_BUFFER, (368 * sizeof(glm::vec3)), gearThreeNormal, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

	/* Create a vertex buffer object to store vertices */
	glGenBuffers(1, &positionBufferGearFour);
	glBindBuffer(GL_ARRAY_BUFFER, positionBufferGearFour);
	glBufferData(GL_ARRAY_BUFFER, (700 * sizeof(glm::vec4)), gearFour, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	/* Create a vertex buffer object to store normals */
	glGenBuffers(1, &gearFourNormals);
	glBindBuffer(GL_ARRAY_BUFFER, gearFourNormals);
	glBufferData(GL_ARRAY_BUFFER, (700 * sizeof(glm::vec3)), gearFourNormal, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

	/* Create a vertex buffer object to store vertices */
	glGenBuffers(1, &positionBufferCrank);
	glBindBuffer(GL_ARRAY_BUFFER, positionBufferCrank);
	glBufferData(GL_ARRAY_BUFFER, (72 * sizeof(glm::vec4)), crank, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	/* Create a vertex buffer object to store normals */
	glGenBuffers(1, &crankNormals);
	glBindBuffer(GL_ARRAY_BUFFER, crankNormals);
	glBufferData(GL_ARRAY_BUFFER, (72 * sizeof(glm::vec3)), crankNormal, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);


	/* Create a vertex buffer object to store vertex colours */
	glGenBuffers(1, &colourObject);
	glBindBuffer(GL_ARRAY_BUFFER, colourObject);
	glBufferData(GL_ARRAY_BUFFER, sizeof(vertexColours), vertexColours, GL_STATIC_DRAW);
	glBindBuffer(GL_ARRAY_BUFFER, 0);

	try
	{
		program = glw->LoadShader("lab2.vert", "lab2.frag");
	}
	catch (std::exception &e)
	{
		std::cout << "Caught exception: " << e.what() << std::endl;
		std::cin.ignore();
		exit(0);
	}

	/* Define uniforms to send to vertex shader */
	modelID = glGetUniformLocation(program, "model");
	viewID = glGetUniformLocation(program, "view");
	projectionID = glGetUniformLocation(program, "projection");
}