KPADGetProjectionPos

Syntax

#include <cafe/pads/kpad/kpad.h>

typedef struct Vec2{
    f32 x;
    f32 y;
} Vec2;

typedef struct Rect {
    f32 left;
    f32 top;
    f32 right;
    f32 bottom;
} Rect;

void KPADGetProjectionPos( Vec2 *dst, const Vec2 *src, const Rect *projRect,
                           f32 viRatio );

Parameters

dst Pointer to the Vec2-type variable that stores the coordinates (in projRect) after conversion.
src Pointer to the Vec2-type variable that stores the normalized coordinates prior to conversion (the coordinates with a value of the range in which objects can be captured by DPD is roughly between −1 and 1).
projRect Rectangle in the projection coordinate system.
viRatio Value of fb_width / vi_width.

Return Values

None.

Description

Converts normalized coordinates (the coordinates with a value of the range in which objects can be captured by DPD is roughly between −1 and 1) into projection coordinates. In addition, this function corrects pixel ratio in the horizontal direction. This function calculates the coordinates that are closest to a spot (on the TV screen) being pointed to by the Wii remote.

Do Not Call From

Background Do not call this function from the background.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.
Multiple Cores Do not call this function from more than one Core.

See Also

KPADEnableAimingMode
KPADDisableAimingMode
KPADSetSensorHeight

Revision History

2013/05/08 Automated cleanup pass.
2008/07/08 Added explanations on normalized coordinates.
2006/09/07 Initial version.


CONFIDENTIAL