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


Python Matrix.translation方法代码示例

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


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

示例1: __pickVehicle

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
 def __pickVehicle(self):
     if self.__boundVehicleMProv is not None:
         return
     else:
         x, y = GUI.mcursor().position
         from AvatarInputHandler import cameras
         dir, start = cameras.getWorldRayAndPoint(x, y)
         end = start + dir.scale(100000.0)
         pos, colldata = collideDynamicAndStatic(start, end, (), 0)
         vehicle = None
         if colldata is not None:
             entity = colldata[0]
             from Vehicle import Vehicle
             if isinstance(entity, Vehicle):
                 vehMatProv = entity.matrix
                 vehMatInv = Matrix(vehMatProv)
                 vehMatInv.invert()
                 localPos = vehMatInv.applyPoint(pos)
                 result = Math.MatrixProduct()
                 localTransMat = Matrix()
                 localTransMat.translation = localPos
                 result.a = localTransMat
                 result.b = vehMatProv
                 return result
         return
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:27,代码来源:videocamera.py

示例2: createSRTMatrix

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
def createSRTMatrix(scale, rotation, translation):
    scaleMatrix = Matrix()
    scaleMatrix.setScale(scale)
    result = Matrix()
    result.setRotateYPR(rotation)
    result.translation = translation
    result.preMultiply(scaleMatrix)
    return result
开发者ID:Infernux,项目名称:Projects,代码行数:10,代码来源:mathutils.py

示例3: assembleCompoundModel

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
def assembleCompoundModel(models, position, vehicleDesc):
    tank = BigWorld.createCompoundTank()
    chassis = BigWorld.ModelLite(models[0])
    hull = BigWorld.ModelLite(models[1])
    turret = BigWorld.ModelLite(models[2])
    gun = BigWorld.ModelLite(models[3])
    matrix = Matrix()
    matrix.translation = position
    tank.attachPart(0, chassis, '', matrix)
    tank.attachPart(1, hull, 'V')
    tank.attachPart(2, turret, 'HP_turretJoint')
    tank.attachPart(3, gun, 'HP_gunJoint')
    BigWorld.addModel(tank)
    return tank
开发者ID:aevitas,项目名称:wotsdk,代码行数:16,代码来源:clientbenchmark.py

示例4: __update

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
 def __update(self):
     self.__updateCallbackId = None
     self.__updateCallbackId = BigWorld.callback(0.0, self.__update)
     curTime = BigWorld.time()
     dt = curTime - self.__prevTime
     self.__prevTime = curTime
     self.__currentAngle += self.__angularVelocity * dt
     if self.__currentAngle > 2 * math.pi:
         self.__currentAngle -= 2 * math.pi
     elif self.__currentAngle < -2 * math.pi:
         self.__currentAngle += 2 * math.pi
     radialPosition = Vector3(self.radius * math.sin(self.__currentAngle), 0, self.radius * math.cos(self.__currentAngle))
     modelYaw = self.__currentAngle
     if self.rotateClockwise:
         modelYaw += math.pi / 2
     else:
         modelYaw -= math.pi / 2
     localMatrix = Matrix()
     localMatrix.setRotateY(modelYaw)
     localMatrix.translation = radialPosition
     self.__modelMatrix.setRotateYPR((self.yaw, self.pitch, self.roll))
     self.__modelMatrix.translation = self.position
     self.__modelMatrix.preMultiply(localMatrix)
开发者ID:kblw,项目名称:wot_client,代码行数:25,代码来源:circularflyer.py

示例5: createRTMatrix

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
def createRTMatrix(rotation, translation):
    result = Matrix()
    result.setRotateYPR(rotation)
    result.translation = translation
    return result
开发者ID:Infernux,项目名称:Projects,代码行数:7,代码来源:mathutils.py

示例6: _createMarker

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
 def _createMarker(self, pos, symbol, active = True):
     mProv = Matrix()
     mProv.translation = pos
     return self._parentObj.createMarker(mProv, symbol, active)
开发者ID:aevitas,项目名称:wotsdk,代码行数:6,代码来源:markers2dplugins.py

示例7: createStaticMarker

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
 def createStaticMarker(self, pos, symbol):
     mProv = Matrix()
     mProv.translation = pos
     handle = self.__ownUI.addMarker(mProv, symbol)
     return (mProv, handle)
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:7,代码来源:markers.py

示例8: createStaticMarker

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import translation [as 别名]
 def createStaticMarker(self, pos, symbol):
     mProv = Matrix()
     mProv.translation = pos
     handle = self.__battleApp.markersManager.createMarker(mProv, symbol)
     return (mProv, handle)
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:7,代码来源:proxy.py


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