The VPAD library is a high-level abstraction for the Display Remote Control (DRC). This library interprets the raw sensor data into meaningful events for applications.
VPADSetAccParamfunction to adjust the sharpness of the DRC’s accelerometer response and the hand tremor reduction level.
VPADSetBtnRepeatfunction to adjust the digital button repeat.
VPADDisableStickCrossClampfunctions to adjust the clamp processing of the analog sticks.
VPADRead function returns the number of sets of sampling data, or zero
if there are none, and also returns the error code in the variable pointer passed as an argument.
The error codes are as follows:
||There is sampling data.|
||There is no sampling data.|
||The DRC is not connected.|
||VPADBASE library initialization is not complete.|
||Duplicate calls caused failure to obtain permission to process.|
Even when the
VPADRead function returns zero,
the contents of the sampling buffer passed to it as an argument may have changed. The only time
that you can be certain that the contents of the sampling buffer have not changed is when
VPAD_READ_ERR_NO_DATA is returned.
VPADRead is called,
the ring buffer inside the VPAD library is flushed. For this reason,
if data is used by multiple threads, we recommend that you use a single thread and
share the loaded data, rather than calling functions from multiple threads.
When the functions are called multiple times, they return zero when they fail to gain
processing rights and the
also returns the error code
Stick clamp processing is implemented as circular clamping and cross-shape clamping. Circular clamping is
used by default. Select clamp processing by using the
Prohibition processing for the +Control Pad of the DRC is performed internally by the VPADBASE library. If the +Control Pad physically breaks and its input is in a state that is normally impossible, such as simultaneous presses of Left and Right, the library processes it as valid input of Left. Similarly, if Up and Down are simultaneously pressed, the library assumes the valid input to be Up.
VPADRead function is designed with the assumption that
they will be called once
every game frame. However, if the interval between calls to these functions grows too long due
to a processing slowdown or some other reason, the VPAD library's internal ring buffer might
go full circle, and data could be lost.
The sensors used in the DRC are rate sensors (gyroscopes). These rate sensors can get the
angular velocity around the axes for pitch, yaw, and roll. The values for each axis are stored in the
VPADStatus structure and obtained with the
VPADRead function. The
structure has the members
dir. The first two
are defined as type
Vec type direction components are as follows:
x is the pitch, y is the yaw, and
z is the roll. The
gyro member represents the angular
velocity in each direction and stores a value where 1.0 corresponds to 360 dps (degrees per second).
angle member represents the angle in each direction and stores a value where 1.0
corresponds to 360 degrees. The
dir member represents the 3D attitude expressed as a 3x3 matrix.
The VPAD library can perform the following corrections on DRC data.
Excluding zero-point drift correction, these correction processes can each be freely enabled or disabled. (Zero-point drift correction is always enabled.) Parameters can be used to adjust the degree of drift correction.
If this feature is enabled, the system does not respond to small movements. This
feature is effective in situations where, for example, you want to capture only large
movements in a particular direction. Specifically, there is no response to motion
radius, specified by the
function. The closer the current angular velocity is to the specified
the closer to zero the return value of the
VPADIsEnableGyroZeroPlay function becomes.
The zero point may drift due to effects such as temperature while the DRC
is in use. This correction process works by first determining whether the DRC is stationary.
This is performed by checking whether the DRC continues to return the same value for some interval of time.
If the device is deemed to be stationary, the zero point is corrected to reflect the value. Also, three types
of determination criteria have been prepared. Any one of these may be applied. The zero
point is constantly corrected based on how well certain information, such as current acceleration
and past angular acceleration being buffered internally, fits in the specified determination
criteria. You can get information regarding how well data fits from the return value of the
function. The closer the value is to 1, the better the fit. You can also assume that the
closer the value is to 1, the more stable the motion will be.
By configuring a certain attitude as the base attitude, even vigorous swinging that cannot be handled by other correction processing stops causing the attitude to shift far from the base attitude.
When this compensation is enabled, correction is applied using an acceleration value
in cases where the acceleration obtained from the accelerometer fits inside the range
given by the force of gravity plus
revise_range, specified by the
You can expect some degree of improvement in temperature drift when using the zero-point drift correction process. In addition, you should be able to mitigate drift to a certain degree by correcting acceleration before the error becomes too large, and by setting the base model beforehand for scenes in which motions are so small that these corrections are not triggered.
As stated in the specifications for DRC rate sensors, the scale value for the written calibration values can vary by as much as ±8% due to the effects of humidity, air temperature, and device age. This error cannot be mitigated by the VPAD library. When designing for the DRC, therefore, do not attempt to require an exact degree of accuracy.
function calculates angular speed, you can set a different scaling
factor for each direction of motion. Because you can use this function to evaluate the
effect that these errors in attitude and angle will actually have on calculations, use
it when verifying that your game can be played within the range of error.
For more information, see the "Determining Whether the Wii Remote Is at Rest" section in the KPAD Overview. The DRC's case is the same as that of the Wii Remote.
SDK 2.09 includes limited support for two DRCs for development purposes only. For information about how to use two DRCs, refer to Two_DRC_VPAD sample.
Integration with HOME Menu and other system functionality is not supported.
chan argument specifies the target controller number (DRC device) in VPAD
library API. If (1) is specified for
chan and DRC2 is not present,
VPAD_READ_ERR_NO_CONTROLLER is returned in the
2014/01/21 Terminology change to HOME Menu.
2013/05/08 Automated cleanup pass.
2012/07/25 Cleanup Pass
2011/04/30 Added the explanation of +Control Pad Restrictions.
2011/03/30 Initial version.