evertClass.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:game_engine_evertims 作者: EVERTims 项目源码 文件源码
def _areDifferent_Mat44(self, mat1, mat2, thresholdLoc = 1.0, thresholdRot = 1.0):
        """
        Check if 2 input matrices are different above a certain threshold.

        :param mat1: input Matrix
        :param mat2: input Matrix
        :param thresholdLoc: threshold above which delta translation between the 2 matrix has to be for them to be qualified as different
        :param thresholdRot: threshold above which delta rotation between the 2 matrix has to be for them to be qualified as different
        :type mat1: mathutils.Matrix
        :type mat2: mathutils.Matrix
        :type thresholdLoc: Float
        :type thresholdRot: Float
        :return: a boolean stating wheter the two matrices are different
        :rtype: Boolean
        """
        areDifferent = False
        jnd_vect = mathutils.Vector((thresholdLoc,thresholdLoc,thresholdRot))
        t1, t2 = mat1.to_translation(), mat2.to_translation()
        r1, r2 = mat1.to_euler(), mat2.to_euler()
        for n in range(3):
            if (abs(t1[n]-t2[n]) > thresholdLoc) or (abs(math.degrees(r1[n]-r2[n])) > thresholdRot): areDifferent = True
        return areDifferent
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号