Does Hardware Input is working?

Discussion in 'Plugins' started by magicfr, Jan 18, 2012.

  1. magicfr

    magicfr Registered

    Joined:
    Jan 4, 2012
    Messages:
    332
    Likes Received:
    27
    Hello,

    I try to code a camera motion.

    I managed to trace into my plug, I get UpdateTelemetry called.

    I set bool HasHardwareInputs() { return( true ); }

    But those 3 functions are never called
    void UpdateHardware( const float fDT );
    void EnableHardware() { mEnabled = true; } // message from game to enable hardware
    void DisableHardware() { mEnabled = false; } // message from game to disable hardware
    bool CheckHWControl( const char * const controlName, float &fRetVal );

    What did I miss?

    Cheers,
    Seb
     
  2. magicfr

    magicfr Registered

    Joined:
    Jan 4, 2012
    Messages:
    332
    Likes Received:
    27
    I find something, it's was so obvious I didn't see it.
    In exemple.hpp void UpdateHardware( const float fDT ); function signature is wrong,
    in internalPLugin.hpp it is :
    virtual void UpdateHardware( const double fDT ) {}
    So I fixed it in exemple.hpp, but the function is called only 1 time... :(

    And

    void EnableHardware() { mEnabled = true; } // message from game to enable hardware
    void DisableHardware() { mEnabled = false; } // message from game to disable hardware
    bool CheckHWControl( const char * const controlName, float &fRetVal );

    Are stilled not called at all :(
     
  3. magicfr

    magicfr Registered

    Joined:
    Jan 4, 2012
    Messages:
    332
    Likes Received:
    27
    Was same bug with bool CheckHWControl( const char * const controlName, float &fRetVal ); wich must be
    bool CheckHWControl( const char * const controlName, double &fRetVal );

    But there still a bug,
    void UpdateHardware( const double fDT ) is called only 20s then nothing.
     
  4. magicfr

    magicfr Registered

    Joined:
    Jan 4, 2012
    Messages:
    332
    Likes Received:
    27
    OKeeyyyy

    Here the strage behavior I have.

    When I go race.

    1)void ExampleInternalsPlugin::EnterRealtime() is called.
    2)void ExampleInternalsPlugin::UpdateHardware( const double fDT ) is called for 20 seconds
    bool ExampleInternalsPlugin::CheckHWControl( const char * const controlName, double &fRetVal ) is NOT called.
    3)bool ExampleInternalsPlugin::HasHardwareInputs() is called, I return (true).
    from there
    4)bool ExampleInternalsPlugin::HasHardwareInputs() is called, I return (true).
    void ExampleInternalsPlugin::UpdateHardware( const double fDT ) is NOT called
    bool ExampleInternalsPlugin::CheckHWControl( const char * const controlName, double &fRetVal ) is called.

    So I got no way to incread time or have a delta time, which make the example not working at all.

    Please help.
     
  5. 88mphTim

    88mphTim racesimcentral.net

    Joined:
    Sep 23, 2010
    Messages:
    10,840
    Likes Received:
    314
    Asking about this for you...
     
  6. magicfr

    magicfr Registered

    Joined:
    Jan 4, 2012
    Messages:
    332
    Likes Received:
    27
    Thanks You :)
     
  7. dlecoutre

    dlecoutre Registered

    Joined:
    Feb 15, 2012
    Messages:
    21
    Likes Received:
    0
    Have you been able to figure out your issue ? I'm working on this function as well. I was able to make it call by the game, but not all the variables that they provide are updated and editable. E.g. I know when the player turn the steering wheel or when you look left or right, and I can control that as well.
     
  8. magicfr

    magicfr Registered

    Joined:
    Jan 4, 2012
    Messages:
    332
    Likes Received:
    27
    Well, UpdateHardware is still not called :(

    So I did a workaround, I update all my internal objects in UpdateTelemetry.
    And I "call" command in CheckHWControl

    But there still a problem, if the player push look left for example, I don't have the value updated in CheckHWControl.

    Also I never managed to make UpdateGraphics works, I wanted to get camera info there.
     
  9. soledad

    soledad Registered

    Joined:
    Jan 10, 2012
    Messages:
    34
    Likes Received:
    0
    anymore news on this issue ?

    because it's not really clear to me if
    a: I'm doing something wrong here,
    b: should use a workaround, and how exactly ?
    c: we should wait for another build ..

    even if I apply magicfr's fixes both these functions ( CheckHWControl and UpdateHardware) are never called ??

    would be nice to get some (official) conformation on this, as I really like to move forward with my plugin

    thanx
     
    Last edited by a moderator: Jul 19, 2012

Share This Page