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


Python Matrix.applyPoint方法代码示例

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


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

示例1: worldHitTest

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyPoint [as 别名]
    def worldHitTest(self, start, stop, worldMatrix):
        worldToLocal = Matrix(worldMatrix)
        worldToLocal.invert()
        testRes = self.__bspModel.collideSegment(worldToLocal.applyPoint(start), worldToLocal.applyPoint(stop))
        if testRes is None:
            return
        res = []
        for dist, normal, hitAngleCos, matKind in testRes:
            res.append((dist,
             worldMatrix.applyVector(normal),
             hitAngleCos,
             matKind))

        return res
开发者ID:wotmods,项目名称:WOTDecompiled,代码行数:16,代码来源:modelhittester.py

示例2: __pickVehicle

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyPoint [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

示例3: bind

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyPoint [as 别名]
 def bind(self, vehicle, bindWorldPos = None):
     self.__vehicle = vehicle
     if vehicle is None:
         self.matrix = mathUtils.createIdentityMatrix()
         self.__lookAtProvider = None
         return
     toLocalMat = Matrix(vehicle.matrix)
     toLocalMat.invert()
     self.__boundLocalPos = None if bindWorldPos is None else toLocalMat.applyPoint(bindWorldPos)
     self.selectPlacement(_VehicleBounder.SELECT_CHASSIS)
开发者ID:kblw,项目名称:wot_client,代码行数:12,代码来源:videocamera.py

示例4: collideSegment

# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import applyPoint [as 别名]
    def collideSegment(self, startPoint, endPoint, skipGun = False):
        res = None
        filterMethod = getattr(self.filter, 'segmentMayHitEntity', lambda : True)
        if not filterMethod(startPoint, endPoint, 0):
            return res
        modelsToCheck = (self.model,) if skipGun else (self.model, self.__gunModel)
        for model, desc in zip(modelsToCheck, self.__componentsDesc):
            toModel = Matrix(model.matrix)
            toModel.invert()
            collisions = desc['hitTester'].localHitTest(toModel.applyPoint(startPoint), toModel.applyPoint(endPoint))
            if collisions is None:
                continue
            for dist, _, hitAngleCos, matKind in collisions:
                if res is None or res.dist >= dist:
                    matInfo = desc['materials'].get(matKind)
                    res = SegmentCollisionResult(dist, hitAngleCos, matInfo.armor if matInfo is not None else 0)

        return res
开发者ID:kblw,项目名称:wot_client,代码行数:20,代码来源:detachedturret.py


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