Space Engineers
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Properties | List of all members
Sandbox.Game.Replication.MyGridPhysicsStateGroup Class Reference

Responsible for synchronizing entity physics over network More...

Inheritance diagram for Sandbox.Game.Replication.MyGridPhysicsStateGroup:
Sandbox.Game.Replication.MyEntityPhysicsStateGroup VRage.Network.IMyStateGroup VRage.Network.IMyNetObject VRage.Network.IMyEventOwner

Public Member Functions

 MyGridPhysicsStateGroup (MyEntity entity, IMyReplicable ownerReplicable)
 
override MyPlayer GetControllingPlayer ()
 
override bool Serialize (BitStream stream, EndpointId forClient, uint timestamp, byte packetId, int maxBitPosition)
 
- Public Member Functions inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
delegate void MovedDelegate (ref MatrixD oldTransform, ref MatrixD newTransform)
 
delegate void VelocityDelegate (ref Vector3 oldVelocity, ref Vector3 newVelocity)
 
 MyEntityPhysicsStateGroup (MyEntity entity, IMyReplicable ownerReplicable)
 
void CreateClientData (MyClientStateBase forClient)
 Called on server new clients starts replicating this group. More...
 
void DestroyClientData (MyClientStateBase forClient)
 Called on server when client stops replicating this group. More...
 
void ClientUpdate (uint timestamp)
 
virtual void Destroy ()
 Called when state group is being destroyed. More...
 
void OnAck (MyClientStateBase forClient, byte packetId, bool delivered)
 Called for each packet id sent to client from this state group. When ACK received, called immediatelly. When several other packets received from client, but some were missing, called for each missing packet. More...
 
void ForceSend (MyClientStateBase clientData)
 
- Public Member Functions inherited from VRage.Network.IMyStateGroup
void ClientUpdate (MyTimeSpan clientTimestamp)
 Update method called on client. More...
 
void Serialize (BitStream stream, EndpointId forClient, MyTimeSpan timestamp, byte packetId, int maxBitPosition)
 (De)serializes group state or it's diff for client. When writing, you can write beyond maxBitPosition, but message won't be sent and ACKs won't be received for it. ReplicationServer will detect, that state group written beyond packet size and revert it. When nothing written, ReplicationServer will detect that and state group won't receive ACK for that packet id. More...
 
void TimestampReset (MyTimeSpan timestamp)
 
bool IsStillDirty (EndpointId forClient)
 

Static Public Member Functions

static MyCubeGrid GetMasterGrid (MyCubeGrid grid)
 Returns master grid More...
 
static void ReadSubGrids (BitStream stream, uint timestamp, bool apply, bool lowPrecisionOrientation, ref Vector3D basePos)
 
static bool WriteSubgrids (MyCubeGrid masterGrid, BitStream stream, ref EndpointId forClient, uint timestamp, int maxBitPosition, bool lowPrecisionOrientation, ref Vector3D basePos, ref int currentSentPosition)
 
- Static Public Member Functions inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
static bool ResponsibleForUpdate (MyEntity entity, EndpointId endpointId)
 

Protected Member Functions

override float GetGroupPriority (int frameCountWithoutSync, MyClientInfo client, PrioritySettings settings)
 
- Protected Member Functions inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
virtual bool IsMoving (MyEntity entity)
 
float GetBasicPhysicsPriority (MyClientInfo client)
 Takes into account: Static body (zero priority for static), ResponsibilityForUpdate by client (zero priority for not responsible), otherwise returns OwnerReplicable priority. More...
 
float GetMovementScale (PrioritySettings prioritySettings, out float updateOncePer)
 Gets priority scale and update rate based on prioritySettings. More...
 
bool SerializeServerTransform (BitStream stream, MyEntity entity, Vector3D?deltaPosBase, bool movingOnServer, uint timeStamp, bool lowPrecisionOrientation, ref Vector3D outPosition, ref Quaternion outOrientation, ref MatrixD outWorldMartix, Func< MyEntity, Vector3D, bool > posValidation=null)
 
void SerializeServerVelocities (BitStream stream, MyEntity entity, float simulationRatio, bool movingOnServer, ref Vector3 outLinearVelocity, ref Vector3 outAngularVelocity)
 

Static Protected Member Functions

static bool IsMovingSubGrid (MyEntity entity)
 
- Static Protected Member Functions inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
static bool SerializeTransform (BitStream stream, MyEntity entity, Vector3D?deltaPosBase, bool lowPrecisionOrientation, bool applyWhenReading, bool movingOnServer, uint timeStamp, Func< MyEntity, Vector3D, bool > posValidation=null, MovedDelegate moveHandler=null)
 Serializes transform into 10 to 30.5 bytes. More...
 
static void SerializeVelocities (BitStream stream, MyEntity entity, float simulationRatio, bool applyWhenReading, bool movingOnServer, VelocityDelegate velocityHandler=null)
 Serializes velocities into 12 bytes. More...
 

Properties

new MyCubeGrid Entity [get]
 
- Properties inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
bool IsAccelerating [get]
 
virtual bool IsControlledLocally [get]
 
static float EffectiveSimulationRatio [get]
 
MovedDelegate MoveHandler [get]
 
VelocityDelegate VelocityHandler [get]
 
virtual StateGroupEnum GroupType [get]
 
- Properties inherited from VRage.Network.IMyStateGroup
StateGroupEnum GroupType [get]
 
IMyReplicable Owner [get]
 

Additional Inherited Members

- Public Attributes inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
readonly MyEntity Entity
 
readonly IMyReplicable OwnerReplicable
 
const int NUM_DECIMAL_PRECISION = 3
 
- Protected Attributes inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
Func< MyEntity, Vector3D, bool > m_positionValidation
 
readonly PrioritySettings m_prioritySettings = new PrioritySettings()
 
uint m_lastMovementFrame = 0
 
bool m_lowPrecisionOrientation
 
- Static Protected Attributes inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
static float PRECISION = 1/(float)Math.Pow(10,NUM_DECIMAL_PRECISION)
 
- Events inherited from Sandbox.Game.Replication.MyEntityPhysicsStateGroup
MovedDelegate OnMoved
 Event which occurs when entity is moved by network. More...
 
VelocityDelegate OnVelocityChanged
 

Detailed Description

Responsible for synchronizing entity physics over network

Definition at line 28 of file MyGridPhysicsStateGroup.cs.

Constructor & Destructor Documentation

Sandbox.Game.Replication.MyGridPhysicsStateGroup.MyGridPhysicsStateGroup ( MyEntity  entity,
IMyReplicable  ownerReplicable 
)
inline

Definition at line 40 of file MyGridPhysicsStateGroup.cs.

Member Function Documentation

override MyPlayer Sandbox.Game.Replication.MyGridPhysicsStateGroup.GetControllingPlayer ( )
inlinevirtual

Reimplemented from Sandbox.Game.Replication.MyEntityPhysicsStateGroup.

Definition at line 56 of file MyGridPhysicsStateGroup.cs.

override float Sandbox.Game.Replication.MyGridPhysicsStateGroup.GetGroupPriority ( int  frameCountWithoutSync,
MyClientInfo  client,
PrioritySettings  settings 
)
inlineprotectedvirtual
static MyCubeGrid Sandbox.Game.Replication.MyGridPhysicsStateGroup.GetMasterGrid ( MyCubeGrid  grid)
inlinestatic

Returns master grid

Definition at line 84 of file MyGridPhysicsStateGroup.cs.

static bool Sandbox.Game.Replication.MyGridPhysicsStateGroup.IsMovingSubGrid ( MyEntity  entity)
inlinestaticprotected

Definition at line 207 of file MyGridPhysicsStateGroup.cs.

static void Sandbox.Game.Replication.MyGridPhysicsStateGroup.ReadSubGrids ( BitStream  stream,
uint  timestamp,
bool  apply,
bool  lowPrecisionOrientation,
ref Vector3D  basePos 
)
inlinestatic

Definition at line 215 of file MyGridPhysicsStateGroup.cs.

override bool Sandbox.Game.Replication.MyGridPhysicsStateGroup.Serialize ( BitStream  stream,
EndpointId  forClient,
uint  timestamp,
byte  packetId,
int  maxBitPosition 
)
inlinevirtual
static bool Sandbox.Game.Replication.MyGridPhysicsStateGroup.WriteSubgrids ( MyCubeGrid  masterGrid,
BitStream  stream,
ref EndpointId  forClient,
uint  timestamp,
int  maxBitPosition,
bool  lowPrecisionOrientation,
ref Vector3D  basePos,
ref int  currentSentPosition 
)
inlinestatic

Definition at line 231 of file MyGridPhysicsStateGroup.cs.

Property Documentation

new MyCubeGrid Sandbox.Game.Replication.MyGridPhysicsStateGroup.Entity
get

Definition at line 36 of file MyGridPhysicsStateGroup.cs.


The documentation for this class was generated from the following file: