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
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
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
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
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