Battle Talent  V11
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
CrossLink.Network.NetworkPlayerSync Class Reference

Inherits CrossLink.Network.NetworkSyncBase.

Public Types

enum class  DataType {
  None = 0 , Position = 1 << 0 , Rotation = 1 << 1 , Velocity = 1 << 2 ,
  AngularVelocity = 1 << 3 , RelaId = 1 << 4 , CameraRigPos = 1 << 5 , CameraRigRot = 1 << 6 ,
  HeadsetPos = 1 << 7 , HeadsetRot = 1 << 8 , LeftHandPos = 1 << 9 , LeftHandRot = 1 << 10 ,
  RightHandPos = 1 << 11 , RightHandRot = 1 << 12
}
 

Public Member Functions

PlayerSyncSnapshot Interpolate (PlayerSyncSnapshot from, PlayerSyncSnapshot to, double t)
 
override void OnSerialize (NetworkWriter writer, bool initialState)
 
override void OnDeserialize (NetworkReader reader, bool initialState)
 
void ServerAddSnapshot (PlayerSyncSnapshot snapshot)
 
void ClientAddSnapshot (PlayerSyncSnapshot snapshot)
 
void HardApply ()
 
void HardApply (PlayerSyncSnapshot snapshot)
 
void TickHandAndHands ()
 
Vector3 GetOffsetFromSnapshot ()
 
virtual bool Changed (PlayerSyncSnapshot current)
 
virtual void Reset ()
 
virtual PlayerSyncSnapshot Construct ()
 
void RelaNetworkRB (NetworkRigidbodySyncBase networkRB)
 
void UnRelaNetworkRB ()
 

Public Attributes

Rigidbody targetRig
 
Transform cameraRigTrans
 
Transform headsetTrans
 
Transform leftHandTrans
 
Transform rightHandTrans
 
bool disabledApply = false
 
NetworkRigidbodySyncBase relaRB
 
bool onlySyncOnChange = true
 
float onlySyncOnChangeCorrectionMultiplier = 2
 
bool compressRotation = true
 
float rotationSensitivity = 0.01f
 
bool rbSyncLocalTrans
 
bool cameraRigSyncLocalTrans
 
bool headsetSyncLocalTrans
 
bool leftHandSyncLocalTrans
 
bool rightHandSyncLocalTrans
 
bool timelineOffset = false
 
float positionPrecision = 0.01f
 
float velocityPrecision = 0.01f
 
float angularVelocityPrecision = 0.01f
 
PlayerSyncSnapshot lastSnapshot
 
readonly SortedList< double, PlayerSyncSnapshotclientSnapshots = new SortedList<double, PlayerSyncSnapshot>(16)
 
readonly SortedList< double, PlayerSyncSnapshotserverSnapshots = new SortedList<double, PlayerSyncSnapshot>(16)
 
Vector3 receivePosition
 
Vector3 receiveVelocity
 
Vector3 receiveAngularVelocity
 
Vector3 lastPosition
 
Vector3 lastVelocity
 
Vector3 lastAngularVelocity
 
Vector3 applyPosition
 
Quaternion applyRotation
 
bool syncPosition = true
 
bool syncRotation = true
 
bool syncVelocity = false
 
bool syncAngularVelocity = false
 
bool syncCameraRig = true
 
bool syncHeadset = true
 
bool syncLeftHand = true
 
bool syncRightHand = true
 
bool lerpPosition = true
 
bool lerpRotation = true
 
bool lerpVelocity = true
 
bool lerpAngularVelocity = true
 
System.Action afterApplied = null
 

Protected Member Functions

virtual void OnEnable ()
 
virtual void OnDisable ()
 
override void Update ()
 
override void FixedUpdate ()
 
override void LateUpdate ()
 
override void UpdateServerLerp ()
 
override void UpdateClientLerp ()
 
override void FixedUpdateServerLerp ()
 
override void FixedUpdateClientLerp ()
 
void AddSnapshot (SortedList< double, PlayerSyncSnapshot > snapshots, double timeStamp, int? relaId, Vector3? position, Quaternion? rotation, Vector3? velocity, Vector3? angularVelocity, Vector3? cameraRigPos, Quaternion? cameraRigRot, Vector3? headsetPos, Quaternion? headsetRot, Vector3? leftHandPos, Quaternion? leftHandRot, Vector3? rightHandPos, Quaternion? rightHandRot)
 
virtual void Apply (PlayerSyncSnapshot interpolated, PlayerSyncSnapshot endGoal)
 
bool QuantizedChanged (Vector3 u, Vector3 v, float precision)
 
virtual void OnC2SSync (int? relaId, Vector3? position, Quaternion? rotation, Vector3? velocity, Vector3? angularVelocity, Vector3? cameraRigPos, Quaternion? cameraRigRot, Vector3? headsetPos, Quaternion? headsetRot, Vector3? leftHandPos, Quaternion? leftHandRot, Vector3? rightHandPos, Quaternion? rightHandRot)
 
void OnS2CSync (int? relaId, Vector3? position, Quaternion? rotation, Vector3? velocity, Vector3? angularVelocity, Vector3? cameraRigPos, Quaternion? cameraRigRot, Vector3? headsetPos, Quaternion? headsetRot, Vector3? leftHandPos, Quaternion? leftHandRot, Vector3? rightHandPos, Quaternion? rightHandRot)
 
void SetPosition (Vector3 position)
 
void SetRotation (Quaternion rotation)
 
void SetVelocity (Vector3 velocity)
 
void SetAngularVelocity (Vector3 angularVelocity)
 
int GetRelaId ()
 
Vector3 GetPosition ()
 
Quaternion GetRotation ()
 
Vector3 GetVelocity ()
 
Vector3 GetAngularVelocity ()
 
Vector3 GetScale ()
 

Protected Attributes

Vector3Long lastSerializedPosition = Vector3Long.zero
 
Vector3Long lastDeserializedPosition = Vector3Long.zero
 
Vector3Long lastSerializedVelocity = Vector3Long.zero
 
Vector3Long lastDeserializedVelocity = Vector3Long.zero
 
Vector3Long lastSerializedAngularVelocity = Vector3Long.zero
 
Vector3Long lastDeserializedAngularVelocity = Vector3Long.zero
 
bool cachedSnapshotComparison
 

Properties

bool syncRela [get]
 
double timeStampAdjustment [get]
 
double offset [get]