Photon Unity Networking v1.101

Public Member Functions | List of all members
PhotonTransformViewPositionControl Class Reference

Public Member Functions

 PhotonTransformViewPositionControl (PhotonTransformViewPositionModel model)
 
void SetSynchronizedValues (Vector3 speed, float turnSpeed)
 These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement. More...
 
Vector3 UpdatePosition (Vector3 currentPosition)
 Calculates the new position based on the values setup in the inspector More...
 
Vector3 GetNetworkPosition ()
 Gets the last position that was received through the network More...
 
Vector3 GetExtrapolatedPositionOffset ()
 Calculates an estimated position based on the last synchronized position, the time when the last position was received and the movement speed of the object More...
 
void OnPhotonSerializeView (Vector3 currentPosition, PhotonStream stream, PhotonMessageInfo info)
 

Constructor & Destructor Documentation

◆ PhotonTransformViewPositionControl()

PhotonTransformViewPositionControl.PhotonTransformViewPositionControl ( PhotonTransformViewPositionModel  model)

Member Function Documentation

◆ GetExtrapolatedPositionOffset()

Vector3 PhotonTransformViewPositionControl.GetExtrapolatedPositionOffset ( )

Calculates an estimated position based on the last synchronized position, the time when the last position was received and the movement speed of the object

Returns
Estimated position of the remote object

◆ GetNetworkPosition()

Vector3 PhotonTransformViewPositionControl.GetNetworkPosition ( )

Gets the last position that was received through the network

Returns

◆ OnPhotonSerializeView()

void PhotonTransformViewPositionControl.OnPhotonSerializeView ( Vector3  currentPosition,
PhotonStream  stream,
PhotonMessageInfo  info 
)

◆ SetSynchronizedValues()

void PhotonTransformViewPositionControl.SetSynchronizedValues ( Vector3  speed,
float  turnSpeed 
)

These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement.

Parameters
speedThe current movement vector of the object in units/second.
turnSpeedThe current turn speed of the object in angles/second.

◆ UpdatePosition()

Vector3 PhotonTransformViewPositionControl.UpdatePosition ( Vector3  currentPosition)

Calculates the new position based on the values setup in the inspector

Parameters
currentPositionThe current position.
Returns
The new position.