Пример #1
0
// load original Virtues structure
bool Virtues::loadLegacy (VirtuesLegacy &a) {
	// just hard copy unchanged structures
	memcpy(&this->appearance,	&a.appearance,	sizeof(Virtues::Appearance));
	memcpy(&this->evolution,	&a.evolution,	sizeof(Virtues::Evolution));
	memcpy(&this->predisp,		&a.predisp,		sizeof(Virtues::Skills));
	memcpy(&this->skills,		&a.skills,		sizeof(Virtues::Skills));

	// statistics
	this->statistics.numBaseJumps = a.statistics.numBaseJumps;
	this->statistics.numSkydives = a.statistics.numSkydives;
	this->statistics.playingTime = a.statistics.playingTime;
	this->statistics.canopyTime = 0.0f;
	this->statistics.wingsuitTime = 0.0f;
	this->statistics.freeFallTime = 0.0f;

	this->equipment.experience = a.equipment.experience;
	this->equipment.malfunctions = a.equipment.malfunctions;
	this->equipment.pilotchute = a.equipment.pilotchute;

	// copy equipment stuff
	this->equipment.canopy.loadLegacy(a.equipment.canopy);
	this->equipment.helmet.loadLegacy(a.equipment.helmet);
	this->equipment.rig.loadLegacy(a.equipment.rig);
	this->equipment.suit.loadLegacy(a.equipment.suit);
	this->equipment.sliderOption = a.equipment.sliderOption;

	// new elements
	this->equipment.reserve = Gear(gtReserve, 0);

	return true;
}
Пример #2
0
Career::Career(const char* name)
{
    _name = name;
    _isHomeDefined = false;
    _homeX = _homeY = 0;
    _eventCallback = NULL;
    _eventCallbackData = NULL;

    // initialize game walk-through meter
    initializeWalkthroughMeter();

    // initialize virtues
    _virtues.evolution.funds = _virtues.getSalary();

    // generate beginning helmet, suit and rig
    _virtues.equipment.helmet = Gear( gtHelmet, 0 );
    _virtues.equipment.helmet.state = 1;
    _virtues.equipment.helmet.age   = 0;
    _virtues.equipment.suit   = Gear( gtSuit, 0 );
    _virtues.equipment.suit.state = 1;
    _virtues.equipment.suit.age   = 0;
    _virtues.equipment.rig    = Gear( gtRig, 0 );
    _virtues.equipment.rig.state = 1;
    _virtues.equipment.rig.age   = 0;
	_virtues.equipment.rig.rig_aad = 0;

    // generate skydiving canopy
    _virtues.equipment.canopy = Gear( gtCanopy, 19 );
    _virtues.equipment.canopy.state = 1;
    _virtues.equipment.canopy.age   = 0;
    _virtues.equipment.sliderOption = ::soUp;
    
    // generate skydiving reserve
    _virtues.equipment.reserve = Gear( gtReserve, 0 );
    _virtues.equipment.reserve.state = 1;
    _virtues.equipment.reserve.age   = 0;

    // initialize events
    _events.push_back( new RegularWork( this, true ) );
    _events.push_back( new WeatherForecast( this ) );
    _events.push_back( new Divine( this ) );
    _events.push_back( new Night( this, true ) );
}
Пример #3
0
void GLWidget::setLists()
{
    static GLfloat pos[4]={5.0,5.5,10.0,0.0};
    static GLfloat color[4]={0.8,0.0,0.2,1.0};
    glLightfv(GL_LIGHT0,GL_POSITION,pos);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);
    for( int i = 1; i <= GEARSNUM; i++)
    {
        gear[i]=glGenLists(i);
        glNewList(gear[i],GL_COMPILE);
            glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,color);
            Gear(0.6,2.0,1.0,teethnum,0.7);
        glEndList();
    }
    glEnable(GL_NORMALIZE);
}
Пример #4
0
void Gameplay::generateLicensedCareerGear(Career* career)
{
    // generate equipment

    // equip personal tracking suit
    career->getVirtues()->equipment.suit = Gear( gtSuit, 28 );
    // add wingsuit (white "Falco") in to gear stock
    career->addGear( Gear( gtSuit, 26 ) );

    // equip personal BASE rig
    career->getVirtues()->equipment.rig = Gear( gtRig, 22 );
    // add personal skydiving rig in to gear stock
    career->addGear( Gear( gtRig, 23 ) );

    // equip first personal canopy
    career->getVirtues()->equipment.canopy = Gear( gtCanopy, 105 );
    // add second personal canopy in to gear stock
    career->addGear( Gear( gtCanopy, 106 ) );
    // add third personal canopy in to gear stock
    career->addGear( Gear( gtCanopy, 124 ) );
}
Пример #5
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);
}
Пример #6
0
Gear::Gear(){
    Gear(ofGetWidth()*0.5, ofGetHeight()*0.5, 6,1);
}
Пример #7
0
Virtues::Equipment selectBASEEquipment(Career* career, float windAmbient, float windBlast)
{
    Virtues* virtues = career->getVirtues();

    Virtues::Equipment equipment;

    // orange Syndrome,
    equipment.helmet = Gear( ::gtHelmet, 8 );
    // orange Solifuge Altitude
    equipment.suit = Gear( ::gtSuit, 8 );
    // white Vector Velcro
    equipment.rig = Gear( ::gtRig, 9 );

    #ifdef GAMEPLAY_EDITION_ATARI
        if( career->getLicensedFlag() )
        {
            // FB jumpsuit
            equipment.suit = Gear( ::gtSuit, 28 );
            // FB BASE gear
            equipment.rig = Gear( ::gtRig, 22 );
        }
    #endif

    // choose optimal canopy square    
    float optimalSquare = database::Canopy::getOptimalCanopySquare( 
        virtues->appearance.weight,
        0.5f * ( windAmbient + windBlast )
    );

    // selection source (all purple Psychonauts)
    unsigned int numVariants = 10;
    unsigned int variants[] = { 0,1,2,3,4,5,6,7,8,9 };
    unsigned int variantId = 0;
    float epsilon = fabs( database::Canopy::getRecord( variants[variantId] )->square - optimalSquare );
    for( unsigned int i=1; i<numVariants; i++ )
    {
        float extraEpsilon = fabs( database::Canopy::getRecord( variants[i] )->square - optimalSquare );
        if( extraEpsilon < epsilon )
        {
            epsilon = extraEpsilon;
            variantId = i;
        }
    }

    // select canopy
    equipment.canopy = Gear( ::gtCanopy, variants[variantId] );

    #ifdef GAMEPLAY_EDITION_ATARI
        if( career->getLicensedFlag() )
        {
            if( ( 0.5f * ( windAmbient + windBlast ) ) > 6.0f )
            {
                equipment.canopy = Gear( ::gtCanopy, 105 );
            }
            else
            {
                equipment.canopy = Gear( ::gtCanopy, 106 );
            }
        }
    #endif

    // equipment options
    equipment.malfunctions = false;  // no malfunctions
    equipment.experience   = false;  // no experience
    equipment.pilotchute   = 0;      // 48' pilotchute
    equipment.sliderOption = ::soRemoved; // slider removed

    // result
    return equipment;
}
/*
 *  Configure the landing gear with four points plus the
 * tail skid.
 */
void
Heli::setup_gear()
{
	Forces *		cg		= &this->cg;

	// Remove any that we had last time
	this->gear.clear();


	/*
	 *  Landing skids
	 */
	const double		skid_strength	= 5000; // lb/ft?
	const bool		training_gear	= 0;
	double			length		= 12.0;
	double			width		=  5.6;
	double			offset		=  2.0;
	double			height		= 15.0;

	if( training_gear )
	{
		length		= 30.0;
		width		= 30.0;
	 	offset		=  0.0;
		height		= 20.0;
	}

	this->gear = Gear::skids(
		cg,
		skid_strength,
		length,
		width,
		offset,
		height
	);

	/*
	 *  Skid on the tail is not as strong as the landing skids.
	 * It also has more friction.
	 */
	this->gear.push_back( Gear(
		"tail skid",
		skid_strength / 3.0,
		(-41.5 - cg->fs_cg) / 12.0,
		(  0.0                 ) / 12.0,
		( 15.0 - cg->wl_cg) / 12.0,
		140.0
	));


	/**
	 *  Add contact points for the main rotor.
	 * HTF do you append to a std::vector?
	 */
	const std::vector<Gear>	rotors = Gear::rotor(
		cg,
		this->m.r,
		this->m.fs,
		this->m.wl,
		140.0
	);

	FOR_ALL_CONST( std::vector<Gear>, gear, rotors,
		this->gear.push_back( *gear );
	);
void CreateCareer::generateStartupGearStock(void)
{
    // generate BASE canopies

    #ifdef GAMEPLAY_EDITION_ATARI
        // define selection source (all u-turn morpheus)
        unsigned int numVariants = 9;
        unsigned int variants[] = { 107, 108, 109, 110, 111, 112, 113, 114, 115 };
    #else
        // define selection source (all purple psychonauts)
        unsigned int numVariants = 10;
        unsigned int variants[] = { 0,1,2,3,4,5,6,7,8,9 };
    #endif

    // determine optimal canopy square (size)
    float optimalSquare = database::Canopy::getOptimalCanopySquare( 
        _career->getVirtues()->appearance.weight, 0.0f
    );

    // choose optimal canopy
    unsigned int variantId = 0;
    float epsilon = fabs( database::Canopy::getRecord( variants[variantId] )->square - optimalSquare );
	unsigned int i;
    for( i=1; i<numVariants; i++ )
    {
        float extraEpsilon = fabs( database::Canopy::getRecord( variants[i] )->square - optimalSquare );
        if( extraEpsilon < epsilon )
        {
            epsilon = extraEpsilon;
            variantId = i;
        }
    }

    // equip this canopy
    _career->getVirtues()->equipment.canopy = Gear( gtCanopy, variants[variantId] );

    // determine optimal canopy square (size) for windy weather
    optimalSquare = database::Canopy::getOptimalCanopySquare( 
        _career->getVirtues()->appearance.weight, 9.0f
    );

    // choose optimal canopy
    variantId = 0;
    epsilon = fabs( database::Canopy::getRecord( variants[variantId] )->square - optimalSquare );
    for( i=1; i<numVariants; i++ )
    {
        float extraEpsilon = fabs( database::Canopy::getRecord( variants[i] )->square - optimalSquare );
        if( extraEpsilon < epsilon )
        {
            epsilon = extraEpsilon;
            variantId = i;
        }
    }

    // add this canopy in to gear stock
    _career->addGear( Gear( gtCanopy, variants[variantId] ) );

    // select skydiving canopy and add to gear stock
    if( _career->getVirtues()->appearance.weight > 75.0f )
    {
        #ifdef GAMEPLAY_EDITION_ATARI
            // G-Force 250
            _career->addGear( Gear( ::gtCanopy, 121 ) );
        #else
            // Haibane 250
            _career->addGear( Gear( ::gtCanopy, 19 ) );
        #endif
    }
    else
    {
        #ifdef GAMEPLAY_EDITION_ATARI
            // G-Force 220
            _career->addGear( Gear( ::gtCanopy, 120 ) );
        #else
            // Haibane 220
            _career->addGear( Gear( ::gtCanopy, 18 ) );
        #endif
    }

    // select skydiving rig (Harpy) and add to gear stock
    _career->addGear( Gear( ::gtRig, 17 ) );

    // in demo mode - include wingsuit 
    #ifdef GAMEPLAY_DEMOVERSION
        _career->addGear( Gear( ::gtSuit, 21 ) );
    #endif

    // in demo mode - enable acrobatics
    #ifdef GAMEPLAY_DEMOVERSION
        _career->setAcrobaticsSkill( acroJumpFromRun, true );
        _career->setAcrobaticsSkill( acroFrontFlip, true );
        _career->setAcrobaticsSkill( acroFrontBackFlip, true );
        _career->setAcrobaticsSkill( acroBackFlip, true );
    #endif
}