def set_gunAnglesPacked(self, prev): syncGunAngles = getattr(self.filter, 'syncGunAngles', None) if syncGunAngles: yaw, pitch = decodeGunAngles( self.gunAnglesPacked, self.typeDescriptor.gun['pitchLimits']['absolute']) syncGunAngles(yaw, pitch)
def updateGunAngles(self, avatar): stats = self.clientStatus if stats is None: return vehicle = avatar.getVehicleAttached() turretYaw = gunPitch = None if vehicle is not None: vd = vehicle.typeDescriptor turretYaw, gunPitch = decodeGunAngles( vehicle.gunAnglesPacked, vd.gun.pitchLimits['absolute']) stats.turretYaw = turretYaw stats.gunPitch = gunPitch
def __startWGPhysics(self): if not hasattr(self.filter, 'setVehiclePhysics'): return typeDescr = self.typeDescriptor physics = BigWorld.WGVehiclePhysics() physics_shared.initVehiclePhysicsClient(physics, typeDescr) arenaMinBound, arenaMaxBound = (-10000, -10000), (10000, 10000) physics.setArenaBounds(arenaMinBound, arenaMaxBound) physics.owner = weakref.ref(self) physics.staticMode = False physics.movementSignals = 0 self.filter.setVehiclePhysics(physics) physics.visibilityMask = ArenaType.getVisibilityMask(BigWorld.player().arenaTypeID >> 16) yaw, pitch = decodeGunAngles(self.gunAnglesPacked, typeDescr.gun.pitchLimits['absolute']) self.filter.syncGunAngles(yaw, pitch) self.__speedInfo.set(self.filter.speedInfo)
def __startWGPhysics(self): if not hasattr(self.filter, 'setVehiclePhysics'): return typeDescr = self.typeDescriptor physics = BigWorld.WGVehiclePhysics() physics_shared.initVehiclePhysics(physics, typeDescr) arenaMinBound, arenaMaxBound = (-10000, -10000), (10000, 10000) physics.setArenaBounds(arenaMinBound, arenaMaxBound) physics.enginePower = typeDescr.physics['enginePower'] / 1000.0 physics.owner = weakref.ref(self) physics.staticMode = False physics.movementSignals = 0 physics.damageDestructibleCb = None physics.destructibleHealthRequestCb = None self.filter.setVehiclePhysics(physics) physics.visibilityMask = ArenaType.getVisibilityMask(BigWorld.player().arenaTypeID >> 16) yaw, pitch = decodeGunAngles(self.gunAnglesPacked, typeDescr.gun['pitchLimits']['absolute']) self.filter.syncGunAngles(yaw, pitch) self.appearance.fashion.placingCompensationMatrix = self.filter.placingCompensationMatrix
def __startWGPhysics(self): typeDescr = self.typeDescriptor self.wgPhysics = BigWorld.WGVehiclePhysics() physics = self.wgPhysics physics_shared.initVehiclePhysics(physics, typeDescr) arenaMinBound, arenaMaxBound = (-10000, -10000), (10000, 10000) physics.setArenaBounds(arenaMinBound, arenaMaxBound) physics.enginePower = typeDescr.physics['enginePower'] / 1000.0 physics.owner = weakref.ref(self) physics.staticMode = False physics.movementSignals = 0 physics.damageDestructibleCb = None physics.destructibleHealthRequestCb = None self.filter.setVehiclePhysics(physics) player = BigWorld.player() physics.visibilityMask = ArenaType.getVisibilityMask(player.arenaTypeID >> 16) yaw, pitch = decodeGunAngles(self.gunAnglesPacked, typeDescr.gun['pitchLimits']['absolute']) self.filter.syncGunAngles(yaw, pitch) self.appearance.fashion.placingCompensationMatrix = self.filter.placingCompensationMatrix
def __startWGPhysics(self): if not hasattr(self.filter, 'setVehiclePhysics'): return else: typeDescr = self.typeDescriptor physics = BigWorld.WGVehiclePhysics() physics_shared.initVehiclePhysics(physics, typeDescr, None, False) arenaMinBound, arenaMaxBound = (-10000, -10000), (10000, 10000) physics.setArenaBounds(arenaMinBound, arenaMaxBound) physics.enginePower = typeDescr.physics['enginePower'] / 1000.0 physics.owner = weakref.ref(self) physics.staticMode = False physics.movementSignals = 0 physics.damageDestructibleCb = None physics.destructibleHealthRequestCb = None self.filter.setVehiclePhysics(physics) physics.visibilityMask = ArenaType.getVisibilityMask(BigWorld.player().arenaTypeID >> 16) yaw, pitch = decodeGunAngles(self.gunAnglesPacked, typeDescr.gun['pitchLimits']['absolute']) self.filter.syncGunAngles(yaw, pitch) self.__speedInfo.set(self.filter.speedInfo) return
def set_gunAnglesPacked(self, prev): syncGunAngles = getattr(self.filter, 'syncGunAngles', None) if syncGunAngles: yaw, pitch = decodeGunAngles(self.gunAnglesPacked, self.typeDescriptor.gun['pitchLimits']['absolute']) syncGunAngles(yaw, pitch)
def set_gunAnglesPacked(self, prev): if isinstance(self.filter, BigWorld.WGVehicleFilter): yaw, pitch = decodeGunAngles(self.gunAnglesPacked, self.typeDescriptor.gun['pitchLimits']['absolute']) self.filter.syncGunAngles(yaw, pitch)
def getServerGunAngles(self): """Gets approximate gun angles obtained from self.gunAnglesPacked (see vehicle.def). :return: (turretYaw, gunPitch) """ return decodeGunAngles(self.gunAnglesPacked, self.typeDescriptor.gun.pitchLimits['absolute'])
def calc_marker_pos(self, gun_rotator, shot_pos, shot_vector): marker_pos, marker_direction, marker_size, ideal_marker_size, coll_data = gun_rotator._VehicleGunRotator__getGunMarkerPosition(shot_pos, shot_vector, gun_rotator._VehicleGunRotator__dispersionAngles) gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker2(marker_pos, marker_direction, (marker_size, ideal_marker_size), SERVER_TICK_LENGTH, coll_data) gun_rotator._VehicleGunRotator__lastShotPoint = marker_pos gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker(marker_pos, marker_direction, (marker_size, ideal_marker_size), SERVER_TICK_LENGTH, coll_data) gun_rotator._VehicleGunRotator__markerInfo = (marker_pos, marker_direction, marker_size) vehicle = BigWorld.entity(gun_rotator._VehicleGunRotator__avatar.playerVehicleID) vehicle_descr = vehicle.typeDescriptor gun_rotator._VehicleGunRotator__turretYaw, gun_rotator._VehicleGunRotator__gunPitch = decodeGunAngles(vehicle.gunAnglesPacked, vehicle_descr.gun['pitchLimits']['absolute']) gun_rotator._VehicleGunRotator__updateTurretMatrix(gun_rotator._VehicleGunRotator__turretYaw, SERVER_TICK_LENGTH) gun_rotator._VehicleGunRotator__updateGunMatrix(gun_rotator._VehicleGunRotator__gunPitch, SERVER_TICK_LENGTH) self.serverTurretYaw = gun_rotator._VehicleGunRotator__turretYaw self.serverGunPitch = gun_rotator._VehicleGunRotator__gunPitch self.serverReceiveTime = BigWorld.time() return
def calc_marker_pos(self, gun_rotator, shot_pos, shot_vector, dispersion_angle, shot_point): gun_rotator._VehicleGunRotator__dispersionAngle = dispersion_angle if shot_point is None: marker_pos, marker_direction, marker_size, coll_data = gun_rotator._VehicleGunRotator__getGunMarkerPosition( shot_pos, shot_vector, dispersion_angle) gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker2( marker_pos, marker_direction, marker_size, SERVER_TICK_LENGTH, coll_data) gun_rotator._VehicleGunRotator__lastShotPoint = marker_pos gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker( marker_pos, marker_direction, marker_size, SERVER_TICK_LENGTH, coll_data) gun_rotator._VehicleGunRotator__markerInfo = (marker_pos, marker_direction, marker_size) self.coll_data = coll_data else: gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker2( shot_point, gun_rotator._VehicleGunRotator__markerInfo[1], gun_rotator._VehicleGunRotator__markerInfo[2], SERVER_TICK_LENGTH, self.coll_data) gun_rotator._VehicleGunRotator__lastShotPoint = shot_point gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker( shot_point, gun_rotator._VehicleGunRotator__markerInfo[1], gun_rotator._VehicleGunRotator__markerInfo[2], SERVER_TICK_LENGTH, self.coll_data) gun_rotator._VehicleGunRotator__markerInfo = ( shot_point, gun_rotator._VehicleGunRotator__markerInfo[1], gun_rotator._VehicleGunRotator__markerInfo[2]) vehicle = BigWorld.entity( gun_rotator._VehicleGunRotator__avatar.playerVehicleID) vehicle_descr = vehicle.typeDescriptor gun_rotator._VehicleGunRotator__turretYaw, gun_rotator._VehicleGunRotator__gunPitch = decodeGunAngles( vehicle.gunAnglesPacked, vehicle_descr.gun['pitchLimits']['absolute']) gun_rotator._VehicleGunRotator__updateTurretMatrix( gun_rotator._VehicleGunRotator__turretYaw, SERVER_TICK_LENGTH) gun_rotator._VehicleGunRotator__updateGunMatrix( gun_rotator._VehicleGunRotator__gunPitch, SERVER_TICK_LENGTH) self.serverTurretYaw = gun_rotator._VehicleGunRotator__turretYaw self.serverGunPitch = gun_rotator._VehicleGunRotator__gunPitch self.serverReceiveTime = BigWorld.time() return
def getServerGunAngles(self): return decodeGunAngles(self.gunAnglesPacked, self.typeDescriptor.gun.pitchLimits['absolute'])
def calc_marker_pos(self, gun_rotator, shot_pos, shot_vector): marker_pos, marker_direction, marker_size, ideal_marker_size, coll_data = gun_rotator._VehicleGunRotator__getGunMarkerPosition( shot_pos, shot_vector, gun_rotator._VehicleGunRotator__dispersionAngles) gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker2( marker_pos, marker_direction, (marker_size, ideal_marker_size), SERVER_TICK_LENGTH, coll_data) gun_rotator._VehicleGunRotator__lastShotPoint = marker_pos gun_rotator._VehicleGunRotator__avatar.inputHandler.updateGunMarker( marker_pos, marker_direction, (marker_size, ideal_marker_size), SERVER_TICK_LENGTH, coll_data) gun_rotator._VehicleGunRotator__markerInfo = (marker_pos, marker_direction, marker_size) vehicle = BigWorld.entity( gun_rotator._VehicleGunRotator__avatar.playerVehicleID) vehicle_descr = vehicle.typeDescriptor gun_rotator._VehicleGunRotator__turretYaw, gun_rotator._VehicleGunRotator__gunPitch = decodeGunAngles( vehicle.gunAnglesPacked, vehicle_descr.gun['pitchLimits']['absolute']) gun_rotator._VehicleGunRotator__updateTurretMatrix( gun_rotator._VehicleGunRotator__turretYaw, SERVER_TICK_LENGTH) gun_rotator._VehicleGunRotator__updateGunMatrix( gun_rotator._VehicleGunRotator__gunPitch, SERVER_TICK_LENGTH) return