コード例 #1
0
ファイル: rigid_body.py プロジェクト: JonFountain/imusim
    def __init__(self, parent, name=None, offset=None):
        """
        Construct a point.

        @param parent: Parent L{Joint}, or None for a point in the global
            co-ordinate frame.
        @param name: Name of this point.
        @param offset: Offset of this point in the co-ordinate frame of its
            parent, as a 3x1 L{np.ndarray}. Default is zero offset.
        """
        TreeNode.__init__(self, parent)
        assert isinstance(self, Joint) or isinstance(parent, Joint)
        self.positionOffset = np.zeros((3,1)) if offset is None else offset
        self.name = name
コード例 #2
0
    def __init__(self, parent, name=None, offset=None):
        """
        Construct a point.

        @param parent: Parent L{Joint}, or None for a point in the global
            co-ordinate frame.
        @param name: Name of this point.
        @param offset: Offset of this point in the co-ordinate frame of its
            parent, as a 3x1 L{np.ndarray}. Default is zero offset.
        """
        TreeNode.__init__(self, parent)
        assert isinstance(self, Joint) or isinstance(parent, Joint)
        self.positionOffset = np.zeros((3, 1)) if offset is None else offset
        self.name = name
コード例 #3
0
ファイル: asf_amc.py プロジェクト: JonFountain/imusim
    def __init__(self, rootdata):
        """
        Construct a new ASFRoot.

        @param rootdata: The L{ParseResults} object representing the root
            segment data from the ASF file.
        """
        TreeNode.__init__(self, None)
        self.name = 'root'
        self.childoffset = vector(0,0,0)
        self.isDummy = False
        axis = vector(*rootdata.axis)[::-1]
        rotOrder = rootdata.axisRotationOrder[::-1]
        self.rotationOffset = Quaternion.fromEuler(axis, rotOrder).conjugate
        self.channels = rootdata.channels
コード例 #4
0
    def __init__(self, rootdata):
        """
        Construct a new ASFRoot.

        @param rootdata: The L{ParseResults} object representing the root
            segment data from the ASF file.
        """
        TreeNode.__init__(self, None)
        self.name = 'root'
        self.childoffset = vector(0, 0, 0)
        self.isDummy = False
        axis = vector(*rootdata.axis)[::-1]
        rotOrder = rootdata.axisRotationOrder[::-1]
        self.rotationOffset = Quaternion.fromEuler(axis, rotOrder).conjugate
        self.channels = rootdata.channels
コード例 #5
0
ファイル: asf_amc.py プロジェクト: JonFountain/imusim
    def __init__(self, parent, bonedata, scale):
        """
        Consruct a new ASFBone.

        @param parent: The parent bone of this bone.
        @param bonedata: The L{ParseResults} object representing the bone
            data from the ASF file.
        """
        TreeNode.__init__(self, parent)
        self.name = bonedata.name
        axis = vector(*bonedata.axis)[::-1]
        rotOrder = bonedata.axisRotationOrder[::-1]
        self.rotationOffset = Quaternion.fromEuler(axis, rotOrder).conjugate
        self.childoffset = self.rotationOffset.rotateVector(
                vector(*bonedata.direction) * bonedata.length * scale)
        self.isDummy = bonedata.channels is ''
        self.channels = bonedata.channels
コード例 #6
0
    def __init__(self, parent, bonedata, scale):
        """
        Consruct a new ASFBone.

        @param parent: The parent bone of this bone.
        @param bonedata: The L{ParseResults} object representing the bone
            data from the ASF file.
        """
        TreeNode.__init__(self, parent)
        self.name = bonedata.name
        axis = vector(*bonedata.axis)[::-1]
        rotOrder = bonedata.axisRotationOrder[::-1]
        self.rotationOffset = Quaternion.fromEuler(axis, rotOrder).conjugate
        self.childoffset = self.rotationOffset.rotateVector(
            vector(*bonedata.direction) * bonedata.length * scale)
        self.isDummy = bonedata.channels is ''
        self.channels = bonedata.channels