C# Class NaviDevice, Navi

This class is responsible for taking the unreliable network pose data and interpolating. The interpolated data can be accessed via the DeviceLocation static variable, which is the transform of the game object this script is attached to. Supports only one device.
Inheritance: MonoBehaviour
显示文件 Open project: vmohan7/Navi Class Usage Examples

Public Methods

Method Description
OnDestroy ( ) : void

Called when object is destroyed i.e. when game ends

SetServerScreenSize ( int width, int height ) : void

Stores the smart device's width and height to be accessed by the game

Start ( ) : void

Called after Gameobject is initalized. We start listening for pose data

Update ( ) : void

Called every frame and interpolates the current pose to the synchronized pose based on time.

Private Methods

Method Description
OnAccelerationData ( int connectionID, Vector3 syncAccelData ) : void

Calculates the difference in time between sycnhronizations based on acceleration data sent from the network

OnPoseData ( int connectionID, Vector3 syncPosition, Quaternion syncRotation ) : void

Calculates the difference in time between sycnhronizations based on pose data sent from the network

Method Details

OnDestroy() public method

Called when object is destroyed i.e. when game ends
public OnDestroy ( ) : void
return void

SetServerScreenSize() public method

Stores the smart device's width and height to be accessed by the game
public SetServerScreenSize ( int width, int height ) : void
width int The width of the smart device
height int The height of the smart device
return void

Start() public method

Called after Gameobject is initalized. We start listening for pose data
public Start ( ) : void
return void

Update() public method

Called every frame and interpolates the current pose to the synchronized pose based on time.
public Update ( ) : void
return void