Public Types | Public Member Functions | Public Attributes

wit::MotionEvent Class Reference

#include <wit/event.h>

List of all members.

Public Types

enum  Type {
  Joystick, Analog, Motion, Pointer,
  PointerLeave, ButtonPress, ButtonRelease, User = 256
}

Public Member Functions

 MotionEvent (Controller ctype, unsigned short id, float x, float y, float z, float pitch, float roll)
int type () const

Public Attributes

float x
float y
float z
float pitch
float roll
Controller controllerType
unsigned short controllerNumber

Detailed Description

The MotionEvent class describes the change in motion sensor readings for the Wii Remote or Nunchuk. Events are not generated if the controller is held in the same position. To reduce jitter and avoid generating excessive events, very small changes to the accelerometer readings are ignored.

Motion sensor events are only generated when the wit::UseMotion feature is set.

See also:
wit::EventHandler::motionEvent()

Definition at line 68 of file event.h.


Member Enumeration Documentation

enum wit::Event::Type [inherited]
Enumerator:
Joystick 

The event was generated by changing the position of an analog joystick.

Analog 

The event was generated by changing the pressure on an analog button.

Motion 

The event was generated by the motion sensor of a Wii Remote or Nunchuk.

Pointer 

The event was generated by the infrared sensor of a Wii Remote.

PointerLeave 

The event was generated by the pointer moving out of a hotspot.

ButtonPress 

The event was generated by pressing a non-analog button or by fully depressing an analog button.

ButtonRelease 

The event was generated by releasing a non-analog button or by releasing a fully-depressed analog button,

User 

Base value for user-defined events.

Definition at line 12 of file event.h.


Constructor & Destructor Documentation

wit::MotionEvent::MotionEvent ( Controller  ctype,
unsigned short  id,
float  x,
float  y,
float  z,
float  pitch,
float  roll 
)

Constructs a motion sensor event with the specified type for the specified controller.

See the various member variables for definitions of the parameters.

Definition at line 298 of file event.cpp.


Member Function Documentation

int wit::Event::type (  ) const [inherited]

Returns the type of the event.

Definition at line 30 of file event.cpp.


Member Data Documentation

unsigned short wit::InputEvent::controllerNumber [inherited]

Indicates which controller generated the event, generally numbered 0 to 3 for Wii Remotes and their accessories and numbered 4 to 7 for GameCube controllers.

Distinguishing between attached accessories can be done by reading the controllerType variable.

Definition at line 35 of file event.h.

Indicates which type of controller generated the event.

Definition at line 34 of file event.h.

Contains the pitch of the controller, that is, the controller's orientation pivoting around the x-axis.

See also:
x

Definition at line 72 of file event.h.

Contains the roll of the controller, that is, the controller's orientation pivoting around the y-axis.

See also:
y

Definition at line 72 of file event.h.

Contains the force measured by the x-axis sensor of the controller, that is, the axis perpendicular to the length of the controller and parallel to the ground when the controller is in a neutral position. The value should be near 0.0 in the neutral position.

Definition at line 72 of file event.h.

Contains the force measured by the y-axis sensor of the controller, that is, the axis parallel to the length of the controller. The value should be near 0.0 in the neutral position.

Definition at line 72 of file event.h.

Contains the force measured by the z-axis sensor of the controller, that is, the axis perpendicular to the ground when the controller is in a neutral position. The value should reflect the force of gravity in the neutral position.

Definition at line 72 of file event.h.


The documentation for this class was generated from the following files: