public ChangeMapInformation GetChangeMapInformation(MapChangeRegion region) { ChangeMapInformation information = new ChangeMapInformation(); information.position = (OldPosition - region.Position) * region.Rotation.GetInverse(); information.lookDirection = ((PlayerIntellect)Intellect).LookDirection * region.Rotation.GetInverse(); information.velocity = MainBody.LinearVelocity * region.Rotation.GetInverse(); information.health = Health; if (region.SaveWeapons) { information.weapons = weapons; information.activeWeaponIndex = GetWeaponIndex((activeWeapon != null) ? activeWeapon.Type : null); } return(information); }
public void ApplyChangeMapInformation(ChangeMapInformation information, SpawnPoint spawnPoint) { if (spawnPoint == null) return; Position = spawnPoint.Position + information.position * spawnPoint.Rotation; ((PlayerIntellect)Intellect).LookDirection = information.lookDirection * spawnPoint.Rotation; MainBody.LinearVelocity = information.velocity * spawnPoint.Rotation; OldPosition = Position; OldRotation = Rotation; weapons = information.weapons; SetActiveWeapon(information.activeWeaponIndex); Life = information.life; }
public void ApplyChangeMapInformation(ChangeMapInformation information, SpawnPoint spawnPoint) { if (spawnPoint == null) { return; } Position = spawnPoint.Position + information.position * spawnPoint.Rotation; ((PlayerIntellect)Intellect).LookDirection = information.lookDirection * spawnPoint.Rotation; MainBody.LinearVelocity = information.velocity * spawnPoint.Rotation; OldPosition = Position; OldRotation = Rotation; weapons = information.weapons; SetActiveWeapon(information.activeWeaponIndex); Life = information.life; }
public ChangeMapInformation GetChangeMapInformation( MapChangeRegion region ) { ChangeMapInformation information = new ChangeMapInformation(); information.position = ( OldPosition - region.Position ) * region.Rotation.GetInverse(); information.lookDirection = ( (PlayerIntellect)Intellect ).LookDirection * region.Rotation.GetInverse(); information.velocity = MainBody.LinearVelocity * region.Rotation.GetInverse(); information.life = Life; information.weapons = weapons; information.activeWeaponIndex = GetWeaponIndex( ( activeWeapon != null ) ? activeWeapon.Type : null ); return information; }
public ChangeMapInformation GetChangeMapInformation(Teleporter teleporter) { ChangeMapInformation information = new ChangeMapInformation(); information.position = new Vec3(0, 0, OldPosition.Z - teleporter.Position.Z); information.health = Health; information.weapons = weapons; information.activeWeaponIndex = GetWeaponIndex( (activeWeapon != null) ? activeWeapon.Type : null); return information; }