Welcome to RenEvo Sign in | Join | Help
in
Home IRC Wiisis C&C FarCry Blogs Forums Photos Downloads

Need help on WRLib_ data from Sensor Bar

Last post 04-21-2008, 10:10 AM by Simon. 4 replies.
Sort Posts: Previous Next
  •  04-12-2008, 1:45 PM 1851

    Need help on WRLib_ data from Sensor Bar

    Dear,

    First I want to thanks for your publish of WRLib. You really did a great work for the wii interaction.

    I find in the WRLib, you add the support for Sensor Bar. However, I find you only give the final point infomation caculated from the for IR.

    This infomation are provided in the following functions.

  • IWR_WiiSensorListener::OnEnterScreen - Called when the cursor first enters the screen.
  • IWR_WiiSensorListener::OnLeaveScreen - Called when the cursor leaves the screen (after the off screen delay has passed).
  • IWR_WiiSensorListener::OnCursorUpdate
  • As for me, sometimes I need all the four IRs' data so that I can determine whether the Sensor bar is rotated. (In my project, I want to keep the Wiimote still and move the sensor bar). Could you give me some suggestions how I can get the four IR's infomation by making use of the WRLib. Thank you!

    Filed under:
  •  04-14-2008, 2:50 AM 1852 in reply to 1851

    Re: Need help on WRLib_ data from Sensor Bar

    Hi Simon,

    The CWR_WiiSensor class holds on to this data, so you can write in accessors to retrieve it. If you need more help, let me know and I'll look up the code later this evening.

    - Kevin

     

  •  04-14-2008, 2:50 PM 1853 in reply to 1852

    Re: Need help on WRLib_ data from Sensor Bar

    Hey Kevin,

    Thanks for your reply. Yes, I can see CWR_WiiSensor class holds this infomatin and calculate the final position from the four IRs.

    However, I find I also need to change IWR_WiiSensorListener class redefine the parameters of the  method and re implement this function since I need four pairs of fX and fY

    virtual void OnCursorUpdate(IWR_WiiRemote *pRemote, IWR_WiiSensor *pSensor, float fX, float fY, float fLastUpdate)

    Then I find only the head file included in the downloadable package. To do this I also need the .cpp files. (Pllease correct me if I am wrong)

    I'll appreciate it very much if you can share these files with me or help me out in other way.

    Filed under:
  •  04-15-2008, 2:22 AM 1854 in reply to 1853

    Re: Need help on WRLib_ data from Sensor Bar

    All source files are included with the API. In your case, if you installed the API to "C:\WRLib\", then the files will be found in:

    IWR_WiiSensor.h - C:\WRLib\include\Interfaces\

    CWR_WiiSensor.h - C:\WRLib\include

    CWR_WiiSensor.cpp - C:\WRLib\source

    You don't have to necessarily change the listener callback function to send this data. You could write an accessor to get the data from the class, and use the passed-in IWR_WiiSensor pointer to access this data from the callback function. This would be the better choice, because if you change the listener callback function's signature, you will have to change it everywhere where it is used. And if you are rebuilding Wiisis with your modified changes, this will definitely need to be done.

  •  04-21-2008, 10:10 AM 1860 in reply to 1854

    Re: Need help on WRLib_ data from Sensor Bar

    Hey Kevin,

    In light of what you said, I got it to work. Thanks very much!

     

    Simon

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems