# EggTransform

from pandac.PandaModules import EggTransform

Class : EggTransform
Description : This represents the <Transform> entry of a group or texture node: a list of component transform operations, applied in order, that describe a net transform matrix.
This may be either a 3-d transform, and therefore described by a 4x4 matrix, or a 2-d transform, described by a 3x3 matrix.

## Inheritance:

EggTransform:

## Methods of EggTransform:

addMatrix3
addMatrix4
addRotate2d
addRotate3d
addRotx
addRoty
addRotz
addScale2d
addScale3d
addTranslate2d
addTranslate3d
addUniformScale
clearTransform
getComponentMat3
getComponentMat4
getComponentNumber
getComponentType
getComponentVec2
getComponentVec3
getNumComponents
getTransform2d
getTransform3d
hasTransform
hasTransform2d
hasTransform3d
operator =
setTransform2d
setTransform3d
transformIsIdentity
write

## Constants in EggTransform:

CTInvalid | (ComponentType)
CTTranslate2d | (ComponentType)
CTTranslate3d | (ComponentType)
CTRotate2d | (ComponentType)
CTRotx | (ComponentType)
CTRoty | (ComponentType)
CTRotz | (ComponentType)
CTRotate3d | (ComponentType)
CTScale2d | (ComponentType)
CTScale3d | (ComponentType)
CTUniformScale | (ComponentType)
CTMatrix3 | (ComponentType)
CTMatrix4 | (ComponentType)

addMatrix3 void EggTransform::add_matrix3(LMatrix3d const &mat); Description: Appends an arbitrary 3x3 matrix to the current transform.

addMatrix4 void EggTransform::add_matrix4(LMatrix4d const &mat); Description: Appends an arbitrary 4x4 matrix to the current transform.

addRotate2d void EggTransform::add_rotate2d(double angle); Description: Appends a 2-d rotation to the current transform. The rotation angle is specified in degrees counterclockwise about the origin.

addRotate3d void EggTransform::add_rotate3d(double angle, LVector3d const &axis); Description: Appends a 3-d rotation about an arbitrary axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. Description: Appends an arbitrary 3-d rotation to the current transform, expressed as a quaternion. This is converted to axis-angle notation for the egg file.

addRotx void EggTransform::add_rotx(double angle); Description: Appends a rotation about the X axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis.

addRoty void EggTransform::add_roty(double angle); Description: Appends a rotation about the Y axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis.

addRotz void EggTransform::add_rotz(double angle); Description: Appends a rotation about the Z axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis.

addScale2d void EggTransform::add_scale2d(LVecBase2d const &scale); Description: Appends a possibly non-uniform scale to the current transform.

addScale3d void EggTransform::add_scale3d(LVecBase3d const &scale); Description: Appends a possibly non-uniform scale to the current transform.

addTranslate2d void EggTransform::add_translate2d(LVector2d const &translate); Description: Appends a 2-d translation operation to the current transform.

addTranslate3d void EggTransform::add_translate3d(LVector3d const &translate); Description: Appends a 3-d translation operation to the current transform.

addUniformScale void EggTransform::add_uniform_scale(double scale); Description: Appends a uniform scale to the current transform.

clearTransform void EggTransform::clear_transform(void); Description: Resets the transform to empty, identity.

getComponentMat3 LMatrix3d const &EggTransform::get_component_mat3(int n) const; Description: Returns the 3x3 matrix associated with the nth component. It is an error to call this if the component type is not CT_matrix3.

getComponentMat4 LMatrix4d const &EggTransform::get_component_mat4(int n) const; Description: Returns the 4x4 matrix associated with the nth component. It is an error to call this if the component type is not CT_matrix4.

getComponentNumber double EggTransform::get_component_number(int n) const; Description: Returns the solitary number associated with the nth component. In the case of a rotation, this is the angle in degrees to rotate; in the case of uniform scale, this is the amount of the scale. Other types do not use this property.

getComponentType EggTransform::ComponentType EggTransform::get_component_type(int n) const; Description: Returns the type of the nth component.

getComponentVec2 LVecBase2d const &EggTransform::get_component_vec2(int n) const; Description: Returns the 2-component vector associated with the nth component. This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a 2-d vector property.

getComponentVec3 LVecBase3d const &EggTransform::get_component_vec3(int n) const; Description: Returns the 3-component vector associated with the nth component. This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a 3-d vector property.

getNumComponents int EggTransform::get_num_components(void) const; Description: Returns the number of components that make up the transform.

getTransform2d LMatrix3d EggTransform::get_transform2d(void) const; Description: Returns the overall transform as a 3x3 matrix. It is an error to call this if has_transform3d() is true.

getTransform3d LMatrix4d const &EggTransform::get_transform3d(void) const; Description: Returns the overall transform as a 4x4 matrix. It is valid to call this even if has_transform2d() is true; in this case, the 3x3 transform will be expanded to a 4x4 matrix.

hasTransform bool EggTransform::has_transform(void) const; Description: Returns true if the transform is nonempty, false if it is empty (no transform components have been added). This is true for either a 2-d or a 3-d transform.

hasTransform2d bool EggTransform::has_transform2d(void) const; Description: Returns true if the transform is specified as a 2-d transform, e.g. with a 3x3 matrix, or false if it is specified as a 3-d transform (with a 4x4 matrix), or not specified at all. Normally, EggTextures have a 2-d matrix (but occasionally they use a 3-d matrix), and EggGroups always have a 3-d matrix.

hasTransform3d bool EggTransform::has_transform3d(void) const; Description: Returns true if the transform is specified as a 3-d transform, e.g. with a 4x4 matrix, or false if it is specified as a 2-d transform (with a 2x2 matrix), or not specified at all. Normally, EggTextures have a 3-d matrix (but occasionally they use a 3-d matrix), and EggGroups always have a 3-d matrix.

operator = EggTransform &EggTransform::operator =(EggTransform const &copy); Description:

setTransform2d void EggTransform::set_transform2d(LMatrix3d const &mat); Description: Sets the overall transform as a 3x3 matrix. This completely replaces whatever componentwise transform may have been defined.

setTransform3d void EggTransform::set_transform3d(LMatrix4d const &mat); Description: Sets the overall transform as a 4x4 matrix. This completely replaces whatever componentwise transform may have been defined.

transformIsIdentity bool EggTransform::transform_is_identity(void) const; Description: Returns true if the described transform is identity, false otherwise.

write void EggTransform::write(ostream &out, int indent_level) const; Description: Writes the transform to the indicated stream in Egg format.