Example #1
0
    def onEnterWorld(self, prereqs):
        if BattleReplay.g_replayCtrl.isPlaying:
            return
        self._loadModels(prereqs)
        if len(self.models) > 0:
            self._addSound(self.models[0])
        self.__decisionStrategy = self.__doUsualFly
        if self.flyAroundCenter != Flock.STRATEGY_USUAL_FLY:
            self.__setupFlyAroundCenter()
        self.filter = BigWorld.BoidsFilter()
        self.filter.speed = self.speedAtBottom
        self.filter.yprSpeed = Vector3(self.yawSpeed, self.pitchSpeed,
                                       self.rollSpeed)
        self.filter.deadZonePosition = self.position
        self.filter.deadZoneRadius = self.deadZoneRadius
        self.middlePosition = Math.Vector3()
        self.minHeight = self.position.y
        self.maxHeight = self.minHeight + self.height
        for boid in self.models:
            boid.visible = True

        self.middlePosition = Math.Vector3(self.position)
        self.physics = 0
        newPosition = Math.Vector3(self.position)
        newPosition.y = (self.minHeight + self.maxHeight) / 2.0
        self.physics.teleport(newPosition)
        self.__makeDecision()
Example #2
0
    def onEnterWorld(self, prereqs):
        if BigWorld.isForwardPipeline():
            return
        self._loadModels(prereqs, self.spaceID)
        if self.models:
            self._addSound(self.models[0])
        self.__decisionStrategy = self.__doUsualFly
        if self.flyAroundCenter != Flock.STRATEGY_USUAL_FLY:
            self.__setupFlyAroundCenter()
        self.filter = BigWorld.BoidsFilter()
        self.filter.speed = self.speedAtBottom
        self.filter.yprSpeed = Vector3(self.yawSpeed, self.pitchSpeed,
                                       self.rollSpeed)
        self.filter.deadZonePosition = self.position
        self.filter.deadZoneRadius = self.deadZoneRadius
        self.middlePosition = Math.Vector3()
        self.minHeight = self.position.y
        self.maxHeight = self.minHeight + self.height
        for boid in self.models:
            boid.visible = True

        self.middlePosition = Math.Vector3(self.position)
        newPosition = Math.Vector3(self.position)
        newPosition.y = (self.minHeight + self.maxHeight) / 2.0
        self.teleport(newPosition, Math.Vector3(self.yaw, self.pitch,
                                                self.roll))
        self.__makeDecision()