1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. 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!
  3. 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
  4. 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

    Joined:
    Jun 17, 2009
    Messages:
    4
    Balance:
    0Coins
    Ratings:
    +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;