QuaternionDeltaAccumulatorNode.py 文件源码

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

项目:InSituImmersiveAuthoring 作者: sat-metalab 项目源码 文件源码
def run(self):
        reset = self.getInputValue("Reset")
        if reset:
            self.lastValue = Quaternion((1.0, 0.0, 0.0, 0.0))
            self.outputs["Quaternion"].default_value = Quaternion((1.0, 0.0, 0.0, 0.0))

        accumulate = self.getInputValue("Accumulate")
        if accumulate and not self.accumulate:
            self.lastValue = self.getInputValue("Quaternion").inverted()
            self.outputs["Accumulating"].default_value = True
            self.accumulate = True

        elif not accumulate and self.accumulate:
            self.outputs["Accumulating"].default_value = False
            self.accumulate = False

        elif accumulate:
            value = self.getInputValue("Quaternion") # No need to copy we're not using directly

            self.outputs["Quaternion"].default_value *= self.lastValue * value
            self.lastValue = value.inverted()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号