BitLegit

Just a couple of kids tryin' to make it on their own.

WiiMote

WiiMote Functions 
	void StartSearch()
		- Begins the search for new wiimotes or balance boards. Press the 1 and 2 buttons simultaneously on 
                  a wiimote or press the sync button on the remote to allow it to be discovered. The search lasts 
                  approximately 20 seconds. Newer wiimotes ("with a bluetooth identifier ending in TR") can only be 
                  detected by the Mac version of WiiBuddy and only if the sync button is pressed(not if the 1 and 2 
                  buttons are pressed).

	void StopSearch()    
		- Cancels any ongoing attempts to discover new wiimotes

	int GetDiscoveryStatus()
		- Returns a value representing the current status of the discovery
			0 = not currently searching
			1 = searching
			1## = new remote is found with ## representing its number a negative value means that the 
                              search has ended in failure
			-100 means that the search timed out

	void DropWiiRemote(int i)
		int i : the number of the remote (0-15)
		- Closes the connection to the wiimote or balance board represented by the number given.

	int GetRemoteCount()
		- Returns the total number of wiimotes and balance boards connected.

	bool IsActive(int remote)
		int remote : the number of the remote(0-15)
		- Returns true if there is an open connection to the remote represented by the number given.

	bool IsSearching()
		- Returns true if currently searching for new wiimotes or balance boards.

	float GetBattery(int remote)
		int remote : the number of the remote(0-15)
		- Returns a float between 0 and 1 representing how much power the battery of the remote represented                   by the number given contains

	void SetLEDs(int remote, bool LED1, bool LED2, bool LED3, bool LED4)
		int remote : the number of the remote(0-15)
		bool LED1 : the desired state of the first LED
		bool LED2 : the desired state of the second LED
		bool LED3 : the desired state of the third LED
		bool LED4 : the desired state of the fourth LED (duh.)
		- Updates all four LEDs so that they match the four boolean parameters
		- Balance boards only have the one LED represented by LED1

	bool[] GetLEDS(int remote)
		int remote : the number of the remote(0-15)
		- Returns an array with a length of four. Each boolean represents the LEDs of the wiimote represented 
                  by the number given.
		- The booleans represent the LEDs from left to right.
		- Balance boards only have the one LED represented by the first boolean

	void SetRumble(int remote, bool enabled)
		int remote : the number of the remote(0-15)
		bool enabled : whether or not the wiimote should rumble
		- Balance boards don't rumble

	bool GetRumble(int remote)
		int remote : the number of the remote(0-15)
		- Returns whether or not the wiimote is already rumbling

	void ToggleRumble(int remote)
		int remote : the number of the remote(0-15)
		- Causes the wiimote to either start or stop rumbling, depending on its current state.

	bool GetButton(int remote, string s)
		int remote : the number of the remote(0-15)
		string s : the type of button you wish to check.
		- Returns true if the button is depressed.
		- Acceptable button types:
			"A" "B" "ONE" "1" "TWO" "2" "PLUS" "+" "MINUS" "-" "HOME" "H" "UP" "DOWN" "LEFT" "RIGHT"
			"C" "Z" 
			"CLASSICA" "CLASSICB" "CLASSICMINUS" "CLASSICPLUS" "CLASSICHOME" "CLASSICX" 
			"CLASSICY" "CLASSICUP" "CLASSICDOWN" "CLASSIC LEFT" "CLASSICRIGHT" "CLASSICL"
			"CLASSICR" "CLASSICZL" "CLASSICZR"
			"GUITARGREEN" "GUITARRED" "GUITARYELLOW" "GUITARBLUE" "GUITARORANGE"
			"GUITARPLUS" "GUITARMINUS"
			"DRUMGREEN" "DRUMRED" "DRUMYELLOW" "DRUMBLUE" "DRUMORANGE" "DRUMPLUS"
			"DRUMMINUS""DRUMPEDAL"
			"TURNTABLEGREENLEFT" "TURNTABLEREDLEFT" "TURNTABLEBLUELEFT"
			"TURNTABLEGREENRIGHT" "TURNTABLEREDRIGHT" "TURNTABLEBLUERIGHT"
			"TURNTABLEEUPHORIA" "TURNTABLEPLUS" "TURNTABLEMINUS"

	bool GetButtonDown(int remote, string s)
		int remote : the number of the remote(0-15)
		- Returns true if the button is depressed in the current frame, but was not in the previous frame.
		- Acceptable button types:
			"A" "B" "ONE" "1" "TWO" "2" "PLUS" "+" "MINUS" "-" "HOME" "H" "UP" "DOWN" "LEFT" "RIGHT"
			"C" "Z" 
			"CLASSICA" "CLASSICB" "CLASSICMINUS" "CLASSICPLUS" "CLASSICHOME" "CLASSICX" 
			"CLASSICY" "CLASSICUP" "CLASSICDOWN" "CLASSIC LEFT" "CLASSICRIGHT" "CLASSICL"
			"CLASSICR" "CLASSICZL" "CLASSICZR"
			"GUITARGREEN" "GUITARRED" "GUITARYELLOW" "GUITARBLUE" "GUITARORANGE"
			"GUITARPLUS" "GUITARMINUS"
			"DRUMGREEN" "DRUMRED" "DRUMYELLOW" "DRUMBLUE" "DRUMORANGE" "DRUMPLUS"
			"DRUMMINUS""DRUMPEDAL"
			"TURNTABLEGREENLEFT" "TURNTABLEREDLEFT" "TURNTABLEBLUELEFT"
			"TURNTABLEGREENRIGHT" "TURNTABLEREDRIGHT" "TURNTABLEBLUERIGHT"
			"TURNTABLEEUPHORIA" "TURNTABLEPLUS" "TURNTABLEMINUS"

	bool GetButtonUp(int remote, string s)
		int remote : the number of the remote(0-15)
		- Returns true if the button is not depressed in the current frame but was in the previous frame.
		- Acceptable button types:
			"A" "B" "ONE" "1" "TWO" "2" "PLUS" "+" "MINUS" "-" "HOME" "H" "UP" "DOWN" "LEFT" "RIGHT"
			"C" "Z" 
			"CLASSICA" "CLASSICB" "CLASSICMINUS" "CLASSICPLUS" "CLASSICHOME" "CLASSICX" 
			"CLASSICY" "CLASSICUP" "CLASSICDOWN" "CLASSIC LEFT" "CLASSICRIGHT" "CLASSICL"
			"CLASSICR" "CLASSICZL" "CLASSICZR"
			"GUITARGREEN" "GUITARRED" "GUITARYELLOW" "GUITARBLUE" "GUITARORANGE"
			"GUITARPLUS" "GUITARMINUS"
			"DRUMGREEN" "DRUMRED" "DRUMYELLOW" "DRUMBLUE" "DRUMORANGE" "DRUMPLUS"
			"DRUMMINUS""DRUMPEDAL"
			"TURNTABLEGREENLEFT" "TURNTABLEREDLEFT" "TURNTABLEBLUELEFT"
			"TURNTABLEGREENRIGHT" "TURNTABLEREDRIGHT" "TURNTABLEBLUERIGHT"
			"TURNTABLEEUPHORIA" "TURNTABLEPLUS" "TURNTABLEMINUS"

	Vector3 GetWiimoteAcceleration(int remote)
		int remote : the number of the remote(0-15)
		- Returns a vector3 representing the three axes of the wiimote's acceleration.
		- The x-axis runs from the left side to the right side.
		- The y-axis runs from the expansion port to the IR camera
		- The z-axis runs from the button faces to the battery panel

	float GetIRSensitivity(int remote)
		int remote : the number of the remote(0-15)
		- Returns a value from 1 to 100 representing the IR sensitivity used in GetIRPosition. 
                  Sensitivity is 50 by default.

	void SetIRSensitivity(int i, float sensitivity)
		int remote : the number of the remote(0-15)
		- Sets the sensitivity value to be used y GetIRPosition.
		- Sensitivity value is clamped from 1 to 100.
		- Sensitivity is 50 by default.

	Vector2 GetIRPosition(int remote)
		int remote : the number of the remote(0-15)
		- Returns the x and y coordinate of the IR pointer
		- This function is overly elaborate and attempts to continue functioning, even if the IR camera 
                  loses sight of half the sensor bar. I encourage anyone capable to create a more effective function                  using the raw IR data.

	Vector3 GetIRVector3(int remote)
		int remote : the number of the remote(0-15)
		- Returns the same x and y values as GetIRPosition along with a Z value determined by how close the                   wiimote is to the sensor bar.

	float GetIRRotation(int remote)
		int remote : the number of the remote(0-15)
		- Uses the accelerometer information to determine the angle between the button face of the wiimote 
                  and gravitational upwards, along the axis of the wiimote running from the IR Camera to the 
                  expansion port.
		- The angle is measured in radians. Clockwise roll is positive. Counter clockwise roll is negative.

	Vector3[] GetRawIRData(int remote)
		int remote : the number of the remote(0-15)
		- Returns an array of four Vector3s. The x and y of each Vector3 represent the position of an IR 
                  point, relative to the IR Camera. 
		- The z of each Vector3 represents how close that IR point is.

	bool HasMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- Returns true if external motion plus device is attached or if wiimote has motion pus built in.

	void CheckForMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- If the remote has an unactivated or deactivated Motion Plus attached to it, this will activate it.
		- Once activated, the Motion Plus will still need to be calibrated.

	void DeactivateMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- If the remote has an activated Motion Plus, this will uncalibrate and deactivate it.
		- Doing so may allow for more IR information (so long as no other extension is attached) 

	void ShouldAutomaticallyCheckForMotionPlus(bool should)
		- If true, WiiBuddy will check for attached (but unactivated) motion plus every 4 seconds.
		- Is true by default, but will only work if the Wii prefab is present in the scene

	void ShouldAutomaticallyCalibrateMotionPlus(bool should)
		- If true, WiiBuddy will automatically calibrate any remotes with uncalibrated Motion Plus
		- Calibration happens when an uncalibrated remote is placed face down and motionless for a few seconds.
		- Is true by default, but will only work if the Wii prefab is present in the scene.

	bool IsMotionPlusCalibrated(int remote)
		int remote : the number of the remote(0-15)
		- Returns true if the wiimote's motion plus is available and has been calibrated.
		- Motion plus is calibrated by placing the wiimote face down and motionless.

	Vector3 GetMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- Returns a Vector3 representing the roll, yaw, and pitch of the wiimote
		- Returns Vector3.zero if uncalibrated.

	Vector3 GetRawMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- Returns a Vector3 containing the raw roll, yaw, and pitch of the wiimote.
		- This is Meant to be used for calibrating the Motion Plus without Wii.cs doing it automatically
		- Before calibration, these will represent the raw data of the motion plus.
		- After calibration, these will still be calibrated(I think), but will not exclude near-zero values or use Time.deltaTime

	bool IsRollFast(int remote)
		int remote : the number of the remote(0-15)
		- Returns true if the motion plus is rolling quickly.
		- Does not need to be calibrated.

	bool IsYawFast(int remote)
		int remote : the number of the remote(0-15)
		- Returns true if the motion plus is yawing quickly.
		- Does not need to be calibrated.

	bool IsPitchFast(int remote)
		int remote : the number of the remote(0-15)
		- Returns true if the motion plus is pitching quickly
		- Does not need to be calibrated.

	void CalibrateMotionPlus(int remote, Vector3 calib)
		int remote : the number of the remote(0-15)
		Vector3 calib : the roll, yaw, and pitch which will become the motion plus center values.
		- Calibrates the remote's motion plus so that the entered values represent no rotation.

	void CalibrateMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- Calibrates the remote's motion plus so that the current raw values represent no rotation.

	void UncalibrateMotionPlus(int remote)
		int remote : the number of the remote(0-15)
		- Throws away this motion plus's calibration information.
		- This motion plus must be placed face down to recalibrate.

	int GetExpType(int remote)
		int remote : the number of the remote(0-15)
		-returns an int representing the expansion type plugged into this wiimote.
			0 : no expansion
			1 : nunchuck
			2 : classic controller
			3 : balance board
			4 : guitar
			5 : drumset
			6 : Turntable

	Vector2 GetAnalogStick(int remote)
		int remote : the number of the remote(0-15)
		- If the wiimote has an expansion with an analog stick, a Vector2 is returned representing the x and                  y values of that analog stick. If the expansion is the classic controller, the left analog stick 
                  is used.

	Vector2 GetAnalogStick(int remote, string s)
		int remote : the number of the remote(0-15)
		string s : the type of analog stick you wish to check
		- Acceptable analog stick types
			"NUNCHUCK" "CLASSICLEFT" "CLASSICRIGHT" "GUITAR" "DRUMS" "TURNTABLE"
		- If the specified analog stick is available, the returned Vector2 represents its x and y value.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: