Download e desenvolvimento de software open source

最近の更新

2012-01-01
2010-03-25
2009-12-26
2009-05-06
2009-04-12
2009-03-02
2008-12-20
2008-08-08

Wikiガイド

サイドバー

class Wrj4P5(WiiRemoteJ For Proce55ing)

Wrj4P5 is the base class for managing the available WiiRemotes and extensions. It provides you with methods

  • to get information from WiiRemotes and one of extensions,

and

on your sketch.

  • need class Loc .

Your sketch (PApplet)

class PApplet
[events for your sketch]
 void boardPressed(int bid)			: button pressed on Balance Board.
 void buttonPressed(RimokonEvent ev, int rid)	: some button pressed on WiiRemote.
 void nunchakuPressed(NunchukEvent ev, int rid) : some button/stick pressed.
 void kurakonPressed(KurakonEvent ev, int rid)	: some button/stick pressed 
 void guitarPressed(GuitarEvent ev, int rid) 	: some button/stick pressed.
 void drumPressed(DrumEvent ev, int rid) 	: some button/stick/Pedal pressed.

 void boardReleased(int bid)			: button released on Balance Board.
 void buttonReleased(RimokonEvent ev, int rid)	: some button released on WiiRemote.
 void nunchakuReleased(NunchukEvent ev, int rid) 	: some button/stick released.
 void kurakonReleased(KurakonEvent ev, int rid) 	: some button/stick released.
 void guitarReleased(GuitarEvent ev, int rid)	: some button/stick released.
 void drumReleased(DrumEvent ev, int rid)	: some button/stick/Pedal released.

 void disconnected(int rid)	: some WiiRemote is disconnected.
 void exDisconnected(int rid)	: a Extension is disconnected from some WiiRemote.

model of Wii

class WRJ4P5
[class member/method]
  PApplet parent;
  int dCount;	: the number of WiiRemotes/Boards connected.(at most 7)
  int rCount;	: the number of WiiRemotes connected.(at most 7)
  int bCount;	: the number of Balance Boards connected.(at most 7)
  float ONE_G = 9.80665f;	:  Gravity_Unit(m/sec/sec)
  boolean IR, EX;	: 'EX' is with extensions (no information of IR soptsize)
		: 'IR' is with IR soptsize (no information from any extention)
  WiiBoard board; 		: the first connected WiiRemote.
  WiiRimokon rimokon;	: the first connected WiiRemote.
  WiiNunchaku nunchaku;	: the Nunchuk of the first WiiRemote.
  WiiKurakon kurakon;	: the ClassicController of the first WiiRemote.
  WiiGuitar guitar;	: the WiiGuitar of the first WiiRemote.
  WiiBoard board(int bid)	: the (bid+1)th Balance Board, or null
  WiiRimokon rimokon(int rid)	: the (rid+1)th WiiRemote, or null
  WiiNunchaku nunchaku(int rid)	: the (rid+1)th Nunchuk, or null
  WiiKurakon kurakon(int rid)	: the (rid+1)th ClassicController, or null
  WiiGuitar guitar(int rid)	: the (rid+1)th WiiGuitar, or null
  boolean isConnecting() : if connection is not completed, draws a splash screen

【constructor】
  Wrj4P5(PApplet parent)		 only constuctor you can use

// connect, must call after the construction. (asynchronized process)
  Wrj4P5 connect()	= connect(1)
  Wrj4P5 connect(int n)	= connect(n, false, false)
  Wrj4P5 connect(boolean ir)	= connect(1, ir, false)
  Wrj4P5 connect(int n, boolean ir)	= connect(n, ir, false)
  Wrj4P5 connect(int n, boolean ir, boolean log)	= connect(n, ir, log, 2)
  Wrj4P5 connect(int n, boolean ir, boolean log, int sense)
	int n  : number of WiiRemotes/Boards to be connected.(1 is default)
	bool ir : EX(use extensions - default) / IR(use IR spotsize) 
	bool log: do you want a detailed log?(false is default)
	int sense: sensitivity of IR-Camera, 0(lowest)/1/2(default)/3/4(highest) 

model of Balance Board

class WiiBoard
[members]
  float sensed[2][2];	// latest sensed by pressure sensors at each corner.(mesured by Kg)
  float psensed[2][2];	// previous sensed value.
  float weight;		// = average of 4 sensor.(mesured by Kg)
  float pweight;		// = previous average of 4 sensor   
  float topRight;	// = sensed[0][0], Top-Right
  float bottomLeft;	// = sensed[1][1], Bottom-Left
  float topLeft;		// = sensed[0][1], Top-Left
  float bottomRight;	// = sensed[1][0], Bottom-Right
  boolean isIlluminated; //status of the LED on the board

[connection/communication]
:<status>
  void requestStatus()	 : command to start getting the newest status report
  boolean isReadingData()	: check if getting status
  boolean isConnected() 	: has 'me' connected ?
:<Battery>
  float getBatteryLevel()	: get the latest battery level, 0(empty) to 1(full)
:<LED Lights>
  boolean isLED()	: check the LED illumination.
  void setLED(boolean illumination)	: set the LED illumination.
:<utils> 【New !】
  Loc guessCoG() : the estimation of the center of gravity, (0,0) to (1,1)
  boolean isleftZone() : is the CoG on the left side of the board 
  boolean isTopZone() : is the CoG on tne top side of the board
  boolean isCentralZone(float tol) : is the CoG on the central zone, gibven torelance
  boolean isCentralZone() : same as above, and the torelance is set to 0.4. 

model of WiiRemote

class WiiRimokon
[members]
  Loc sensed;	: latest sensed 3D(Loc) acceleration measured by Gravity Constant.
  Loc acc;	: latest sensed 3D(Loc) acceleration(m/sec/sec)
  Loc[] irLights; : 2D position and size of each IRlights, 3rd is a size of IR spot
  WiiNunchaku nunchaku;	: the Nunchuk connected, initial value w/o connection.
  WiiKurakon kurakon;	: the ClassicController connected, initial value w/o connection
  WiiGuitar guitar;	: the Gutar connected, initial value w/o connection.
  WiiDrum drum;		: the Drum connected, initial value w/o connection.

    [TODO]
//  Loc vel;	: latest sensed 3D(Loc) velocity(m/sec)
//  Loc pos;	: latest sensed 3D(Loc) location(m)
//  Loc cursor;	: latest sensed 2D(Loc) location(%) of the cross cursor.
//  Loc angAcc; : 3D(Loc) angular acceleration(rad/sec/sec) - will need a fixed nunchuk
//  Loc angVel; : 3D(Loc) angular velocity(rad/sec) - will need a fixed nunchuk
//  Loc direction;	: 3D(Loc) normalized direction - will need a fixed nunchuk

[connection/communication]
:<Attitude of 'me'>
  float stablePitch()	: current pich(radian), exact only in stable handling
  float stableRoll()	: current roll(radian), exact only in stable handling
 [too many ToDo]
:<status>
  void requestStatus()	 : command to start getting the newest status report
  boolean isReadingData()	: check if getting status
  boolean isExtensionConnected()	: has a extension connected
  boolean isConnected() 	: has 'me' connected ?
:<Battery>
  float getBatteryLevel()	: get the latest battery level, 0(empty) to 1(full)
:<LED Lights>
  boolean isLED(int lid)	: check the specified LED illumination.
  void setLED(int lid, boolean illumination)	: set the specified LED illumination.
  boolean[] getLEDs()	 : check the all LEDs illumination.
  void setLEDs(boolean[] illumination)	: set the each LEDs illumination.
:<Speaker> !! [ToDo]
  void bufferSound(AudioInputStream audioIn) : prepare the prebufferd sound.(only one)
  float getVolume()	: check the speaker's volume level, min(0) to max(1)
  void setVolume(float volume)	: set the speaker's volume level, min(0) to max(1)
  boolean isPlaying()	: check if playing sound.
  void playBuffer()	: play the prebufferd sound.
  void play(AudioInputStream audioIn)	: play the specified AudioInputStream sound.
  void stopSound()	: stop sound.
:<Vibrator>
  boolean isVibrating()	: check if vibrating
  float getVibrationMagnitude(int magnitude)	: get vibration magnitude.(0 to 1)
  void setVibrationMagnitude(int magnitude)	: set vibration magnitude.(0 to 1)
  void startVibrating()	: start vibration with current mag.
  void vibrateFor(long time)	: vibration for given duration.(ms)
  void stopVibrating()	: stop vibration.
:<IRsenser>
  boolean isIRSensorEnabled()	: check IRsensor enabled.

and

class RimokonEvent - event from WiiRemote
[Constants]
  static int A
  static int B
  static int DOWN
  static int HOME
  static int LEFT
  static int MINUS
  static int ONE
  static int PLUS
  static int RIGHT
  static int TWO
  static int UP
[Constructor]
  RimokonEvent()
[Method]
  boolean isPressed(int btnMask)
  boolean isOnlyPressed(int btnMask)
  boolean isAnyPressed(int btnMask)
  boolean wasPressed(int btnMask)
  boolean wasOnlyPressed(int btnMask)
  boolean wasReleased(int btnMask)

model of Nunchuk

class Nunchaku
[members]
  Loc sensed	// latest senced 3D(Loc) acceleration measured by G.
  Loc acc	// latest senced 3D(Loc) acceleration(m/sec/sec)
  Loc stick	// latest senced 2D(Loc) location(%) of the stick.
// [TODO!]
//  public Loc vel	// latest senced 3D(Loc) velocity(m/sec)
//  public Loc pos	// latest senced 3D(Loc) location(m)
:<Attitude>
  float stablePitch()	// pitch(radian), exact only in stable handling
  float stableRoll()	// roll(radian), exact only in stable handling

and

class NunchakuEvent
[Constants]
  static int C
  static int Z
  Loc Stick
[Constructor]
  NunchakuEvent()
[Method]
  boolean isPressed(int btnMask)
  boolean isOnlyPressed(int btnMask)
  boolean isAnyPressed(int btnMask)
  boolean wasPressed(int btnMask)
  boolean wasOnlyPressed(int btnMask)
  boolean wasReleased(int btnMask)

model of Classic Controller

class Kurakon
[propaties]
  Loc lStick 
  Loc rStick
  float lTrigger;	// latest sensed pressure(%) of the left trigger button.
  float rTrigger;	// latest sensed pressure(%) of the right trigger button.

and

class KurakonEvent
[Constants]
  static int A
  static int B
  static int DPAD_DOWN
  static int DPAD_RIGHT
  static int DPAD_LEFT
  static int DPAD_UP
  static int HOME
  static int MINUS 
  static int PLUS
  static int LEFT_TRIGGER
  static int RIGHT_TRIGGER
  static int LEFT_Z
  static int RIGHT_Z
  static int X
  static int Y
[Constructor]
  KurakonEvent()
[Method]
  boolean isPressed(int btnMask)
  boolean isOnlyPressed(int btnMask)
  boolean isAnyPressed(int btnMask)
  boolean wasPressed(int btnMask)
  boolean wasOnlyPressed(int btnMask)
  boolean wasReleased(int btnMask)

model of Guitar

class WiiGuitar
[propaties]
   Loc stick	// latest sensed 2D(Loc) location(%) of the stick.
   float whammy	// latest sensed pressure(%) of the WhammyBar.

and

class GuitarEvent
[Constants]
  static int BLUE
  static int GREEN
  static int ORANGE
  static int RED
  static int STRUM_DOWN
  static int STRUM_UP
  static int YELLOW
  static int MINUS
  static int PLUS
[Constructor]
  GuitarEvent()
[Method]
  boolean isAnyPressed(int button)	// check the given button is pressed.
  boolean isOnlyPressed(int button)	// check the given button is pressed.
  boolean isPressed(int button)		// check the given button is pressed.
  boolean wasOnlyPressed(int button)	// check the given button was pressed.
  boolean wasPressed(int button)	// check the given button was pressed.
  boolean wasReleased(int button)	// check the given button was released.
  Loc getStick() 		// get the current stick 2D(Loc) position. (-1 to 1)
  float getWhammyBar()		// get the current amount the whammy bar is pushed. (0 to 1)

new face! model of Drum

class WiiDrum
[propaties]
   Loc stick	// latest sensed 2D(Loc) location(%) of the stick.

and

class DrumEvent
[Constants]
  static int BLUE
  static int GREEN
  static int ORANGE
  static int RED
  static int PEDAL
  static int YELLOW
  static int MINUS
  static int PLUS
[Constructor]
  DrumEvent()
[Method]
  boolean isAnyPressed(int button)	// check the given button is pressed.
  boolean isOnlyPressed(int button)	// check the given button is pressed.
  boolean isPressed(int button)		// check the given button is pressed.
  boolean wasOnlyPressed(int button)	// check the given button was pressed.
  boolean wasPressed(int button)	// check the given button was pressed.
  boolean wasReleased(int button)	// check the given button was released.
  Loc getStick() 		// get the current stick 2D(Loc) position. (-1 to 1)
  float getSoftness()  		// no hit (0.0) to the hardest hit(1.0),  (0 to 1)
  int getSoftnessPad()  		// pad id, the softness was sensed. (symbal/bass)


SourceForge.JP is a Japanese version of SourceForge.net. For developments that are not related to Japan, we recommend you to use SourceForge.net.