1. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  2. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  3. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

GTR2 Calc Pitch,Roll?

Discussion in 'DIY Motion Simulator Projects' started by manuel007, Jul 15, 2011.

  1. manuel007

    manuel007 New Member

    Jun 17, 2009
    +0 / 0 / -0
    Hi Guys,

    how can i calculate Pitch and Roll from the geometry data? Can anybody help me?

    float carOri[ ORI_MAXIMUM ]; // Pitch, Yaw, Roll. Electronic compass, perhaps?
    This is no data in angle, i mean this is World Space-Position...

    Here is GTR2 Data:

    typedef struct
    float userInput[ ISI_INPUT_MAXIMUM ]; // This structure allows for a number of parameters to be
    // passed from the user to the exteral application via control input
    // in the game. The ISIInputType enum describes which element of this
    // array corresponds to which in-game control. Note that this data
    // is floating point, and can be configured in the game to be driven
    // by an analog input device (joystick). The user may also map the
    // control to a keyboard key, or a digital controller button. This
    // means that the value may be anywhere between 0.0 and 1.0. Also note
    // that these values will not be debounced; if the user
    // maps the External Signal Up control to a key on the keyboard,
    // the coresponding value in this array will remain 1.0 for as long
    // as the user holds the key down.

    float engineRPS; // Engine speed, Radians Per Second.
    float maxEngineRPS; // For use with an analog rpm display.
    float fuelPressure; // KPa
    float fuelLiters; // Current liters of fuel in the tank(s).
    float fuelCapacityLiters; // Maximum capacity of fuel tank(s).
    float engineWaterTemp; //
    float engineOilTemp; //
    float engineOilPressure; //

    float carSpeed; // meters per second
    long numberOfLaps; // # of laps in race, or -1 if player is not in
    // race mode (player is in practice or test mode).

    long completedLaps; // How many laps the player has completed. If this
    // value is 6, the player is on his 7th lap. -1 = n/a

    float lapTimeBest; // Seconds. -1.0 = none
    float lapTimePrevious; // Seconds. -1.0 = none
    float lapTimeCurrent; // Seconds. -1.0 = none

    long position; // Current position. 1 = first place.
    long numCars; // Number of cars (including the player) in the race.

    long gear; // -2 = no data available, -1 = reverse, 0 = neutral,
    // 1 = first gear... (valid range -1 to 7).

    float tireTemp[ TIRE_LOC_MAX ][ TREAD_LOC_MAX ]; // Temperature of three points
    // across the tread of each tire.
    long numPenalties; // Number of penalties pending for the player.

    float carCGLoc[3]; // Physical location of car's Center of Gravity in world space, X,Y,Z... Y=up.
    float carOri[ ORI_MAXIMUM ]; // Pitch, Yaw, Roll. Electronic compass, perhaps?
    float localAcceleration[3]; // Acceleration in three axes (X, Y, Z) of car body (divide by
    // 9.81 to get G-force). From car center, +X=left, +Y=up,
    // +Z=back.
    } GTR2SharedMem;
  2. Ads Master

    Ads Master

    +0 / 0 / -0