public static void Process(IMyEntity entity, SyncEntityType syncType, Vector3D position) { Process(entity, new MessageSyncEntity() { EntityId = entity.EntityId, SyncType = syncType, Position = position }); }
public static void Process(IMyEntity entity, SyncEntityType syncType, Vector3 velocity, Vector3D position, MatrixD matrix) { Process(entity, new MessageSyncEntity() { EntityId = entity.EntityId, SyncType = syncType, Velocity = velocity, Position = position, Matrix = matrix }); }
public static void Process(IMyEntity entity, SyncEntityType syncType) { Process(entity, new MessageSyncEntity() { EntityId = entity.EntityId, SyncType = syncType }); }
private static void CommonProcess(IMyEntity entity, SyncEntityType syncType, Vector3 velocity, Vector3D position, MatrixD matrix) { if (entity == null) { return; } if (syncType.HasFlag(SyncEntityType.Stop)) { entity.Stop(); } // The Physics.LinearVelocity doesn't change the player speed quickly enough before SetPosition is called, as // the player will smack into the other obejct before it's correct velocity is actually registered. if (syncType.HasFlag(SyncEntityType.Velocity) && entity.Physics != null) { entity.Physics.LinearVelocity = velocity; } // The SetWorldMatrix doesn't rotate the player quickly enough before SetPosition is called, as // the player will bounce off objects before it's correct orentation is actually registered. if (syncType.HasFlag(SyncEntityType.Matrix)) { entity.SetWorldMatrix(matrix); } if (syncType.HasFlag(SyncEntityType.Position)) { entity.SetPosition(position); } }