当前位置: 首页>>代码示例>>Python>>正文


Python Matrix.applyVector方法代码示例

本文整理汇总了Python中Math.Matrix.applyVector方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.applyVector方法的具体用法?Python Matrix.applyVector怎么用?Python Matrix.applyVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Math.Matrix的用法示例。


在下文中一共展示了Matrix.applyVector方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __update

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyVector [as 别名]
 def __update(self, dx, dy, dz, rotateMode = True, zoomMode = True, isCallback = False):
     prevPos = self.__inputInertia.calcWorldPos(self.__aimingSystem.matrix)
     distChanged = False
     if zoomMode and dz != 0:
         prevDist = self.__aimingSystem.distanceFromFocus
         distDelta = dz * float(self.__curScrollSense)
         distMinMax = self.__cfg['distRange']
         newDist = mathUtils.clamp(distMinMax.min, distMinMax.max, prevDist - distDelta)
         if abs(newDist - prevDist) > 0.001:
             self.__aimingSystem.distanceFromFocus = newDist
             self.__userCfg['startDist'] = newDist
             self.__inputInertia.glideFov(self.__calcRelativeDist())
             self.__aimingSystem.aimMatrix = self.__calcAimMatrix()
             distChanged = True
         changeControlMode = prevDist == newDist and mathUtils.almostZero(newDist - distMinMax.min)
         if changeControlMode and self.__onChangeControlMode is not None:
             self.__onChangeControlMode()
             return
     if rotateMode:
         self.__updateAngles(dx, dy)
     if ENABLE_INPUT_ROTATION_INERTIA and not distChanged:
         self.__aimingSystem.update(0.0)
     if ENABLE_INPUT_ROTATION_INERTIA or distChanged:
         worldDeltaPos = prevPos - self.__aimingSystem.matrix.translation
         matInv = Matrix(self.__aimingSystem.matrix)
         matInv.invert()
         self.__inputInertia.glide(matInv.applyVector(worldDeltaPos))
     return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:30,代码来源:arcadecamera.py

示例2: applyImpulse

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyVector [as 别名]
 def applyImpulse(self, position, impulse, reason = ImpulseReason.ME_HIT):
     adjustedImpulse, noiseMagnitude = self.__dynamicCfg.adjustImpulse(impulse, reason)
     camMatrix = Matrix(self.__cam.matrix)
     impulseLocal = camMatrix.applyVector(adjustedImpulse)
     impulseAsYPR = Vector3(impulseLocal.x, -impulseLocal.y + impulseLocal.z, 0)
     rollPart = self.__dynamicCfg['impulsePartToRoll']
     impulseAsYPR.z = -rollPart * impulseAsYPR.x
     impulseAsYPR.x *= 1 - rollPart
     self.__impulseOscillator.applyImpulse(impulseAsYPR)
     self.__applyNoiseImpulse(noiseMagnitude)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:12,代码来源:snipercamera.py

示例3: __calcCurOscillatorAcceleration

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyVector [as 别名]
 def __calcCurOscillatorAcceleration(self, deltaTime):
     vehicle = BigWorld.player().vehicle
     if vehicle is None:
         return Vector3(0, 0, 0)
     curVelocity = vehicle.filter.velocity
     relativeSpeed = curVelocity.length / vehicle.typeDescriptor.physics['speedLimits'][0]
     if relativeSpeed >= SniperCamera._MIN_REL_SPEED_ACC_SMOOTHING:
         self.__accelerationSmoother.maxAllowedAcceleration = self.__dynamicCfg['accelerationThreshold']
     else:
         self.__accelerationSmoother.maxAllowedAcceleration = self.__dynamicCfg['accelerationMax']
     acceleration = self.__accelerationSmoother.update(vehicle, deltaTime)
     camMat = Matrix(self.__cam.matrix)
     acceleration = camMat.applyVector(-acceleration)
     accelSensitivity = self.__dynamicCfg['accelerationSensitivity']
     acceleration.x *= accelSensitivity.x
     acceleration.y *= accelSensitivity.y
     acceleration.z *= accelSensitivity.z
     oscillatorAcceleration = Vector3(0, -acceleration.y + acceleration.z, -acceleration.x)
     return oscillatorAcceleration
开发者ID:kblw,项目名称:wot_client,代码行数:21,代码来源:snipercamera.py

示例4: checkTurretDetachment

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyVector [as 别名]
    def checkTurretDetachment(self, worldPos):
        if self.__vehicle is None:
            return
        if self.__vehicle.isTurretDetached and not self.__placement == _VehicleBounder.SELECT_DETACHED_TURRET:
            turretFound = None
            for turret in DetachedTurret.allTurrets:
                if turret.vehicleID == self.__vehicle.id and turret.model.visible:
                    turretFound = turret
                    break

            if turretFound is None:
                return
            turretToGoalShift = worldPos - turretFound.position
            toTurretMat = Matrix(turretFound.matrix)
            toTurretMat.invert()
            turretToGoalShift = toTurretMat.applyVector(turretToGoalShift)
            self.matrix = turretFound.matrix
            self.__lookAtProvider = None
            self.__placement = _VehicleBounder.SELECT_DETACHED_TURRET
            return turretToGoalShift
开发者ID:kblw,项目名称:wot_client,代码行数:22,代码来源:videocamera.py

示例5: update

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyVector [as 别名]
 def update(self, vehicle, deltaTime):
     curVelocity = vehicle.filter.velocity
     acceleration = vehicle.filter.acceleration
     acceleration = self.__accelerationFilter.add(acceleration)
     movementFlags = vehicle.engineMode[1]
     moveMask = 3
     self.__hasChangedDirection = movementFlags & moveMask ^ self.__prevMovementFlags & moveMask or curVelocity.dot(self.__prevVelocity) <= 0.01
     self.__prevMovementFlags = movementFlags
     self.__prevVelocity = curVelocity
     self.__timeLapsedSinceDirChange += deltaTime
     if self.__hasChangedDirection:
         self.__timeLapsedSinceDirChange = 0.0
     elif self.__timeLapsedSinceDirChange > self.__maxAccelerationDuration:
         invVehMat = Matrix(vehicle.matrix)
         invVehMat.invert()
         accelerationRelativeToVehicle = invVehMat.applyVector(acceleration)
         accelerationRelativeToVehicle.x = 0.0
         accelerationRelativeToVehicle.z = 0.0
         acceleration = Matrix(vehicle.matrix).applyVector(accelerationRelativeToVehicle)
     self.__acceleration = acceleration
     return acceleration
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:23,代码来源:__init__.py


注:本文中的Math.Matrix.applyVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。