EggXfmSAnim
from panda3d.egg import EggXfmSAnim
- class EggXfmSAnim
Bases:
EggGroupNode
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that specify the nine components of a transformation. It’s implemented as a group that can contain any number of EggSAnimData children.
Inheritance diagram
- __init__(*args, **kwargs)
- addComponentData()
C++ Interface: add_component_data(const EggXfmSAnim self, str component_name, double value) add_component_data(const EggXfmSAnim self, int component, double value)
- addData()
C++ Interface: add_data(const EggXfmSAnim self, const LMatrix4d mat)
- /**
Adds a new matrix to the table, by adding a new row to each of the
subtables.
This is a convenience function that treats the table of tables as if it
were a single table of matrices. It is an error to call this if any
SAnimData children of this node have an improper name (e.g. not a single
letter, or not one of “ijkabchprxyz”).
This function has the further requirement that all nine of the subtables
must exist and be of the same length. Furthermore, the order string must
be the standard order string, which matches the system compose_matrix() and
decompose_matrix() functions.
Thus, you probably cannot take an existing EggXfmSAnim object and start
adding matrices to the end; you must clear out the original data first.
(As a special exception, if no tables exist, they will be created.) The
method normalize() will do this for you on an existing EggXfmSAnim.
This function may fail silently if the matrix cannot be decomposed into
scale, shear, rotate, and translate. In this case, the closest
approximation is added to the table, and false is returned.
*/
- add_component_data()
C++ Interface: add_component_data(const EggXfmSAnim self, str component_name, double value) add_component_data(const EggXfmSAnim self, int component, double value)
- add_data()
C++ Interface: add_data(const EggXfmSAnim self, const LMatrix4d mat)
- /**
Adds a new matrix to the table, by adding a new row to each of the
subtables.
This is a convenience function that treats the table of tables as if it
were a single table of matrices. It is an error to call this if any
SAnimData children of this node have an improper name (e.g. not a single
letter, or not one of “ijkabchprxyz”).
This function has the further requirement that all nine of the subtables
must exist and be of the same length. Furthermore, the order string must
be the standard order string, which matches the system compose_matrix() and
decompose_matrix() functions.
Thus, you probably cannot take an existing EggXfmSAnim object and start
adding matrices to the end; you must clear out the original data first.
(As a special exception, if no tables exist, they will be created.) The
method normalize() will do this for you on an existing EggXfmSAnim.
This function may fail silently if the matrix cannot be decomposed into
scale, shear, rotate, and translate. In this case, the closest
approximation is added to the table, and false is returned.
*/
- clearData()
C++ Interface: clear_data(const EggXfmSAnim self)
- /**
Removes all data from the table. It does this by removing all of its
children.
*/
- clear_data()
C++ Interface: clear_data(const EggXfmSAnim self)
- /**
Removes all data from the table. It does this by removing all of its
children.
*/
- composeWithOrder()
C++ Interface: compose_with_order(LMatrix4d mat, const LVecBase3d scale, const LVecBase3d shear, const LVecBase3d hpr, const LVecBase3d trans, str order, int cs)
- /**
Composes a matrix out of the nine individual components, respecting the
order string. The components will be applied in the order indicated by the
string.
*/
- compose_with_order()
C++ Interface: compose_with_order(LMatrix4d mat, const LVecBase3d scale, const LVecBase3d shear, const LVecBase3d hpr, const LVecBase3d trans, str order, int cs)
- /**
Composes a matrix out of the nine individual components, respecting the
order string. The components will be applied in the order indicated by the
string.
*/
- getClassType()
C++ Interface: get_class_type()
- getCoordinateSystem()
C++ Interface: get_coordinate_system(EggXfmSAnim self)
- /**
Returns the coordinate system this table believes it is defined within.
This should always match the coordinate system of the EggData structure
that owns it. It is necessary to store it here because the meaning of the
h, p, and r columns depends on the coordinate system.
*/
- getFps()
C++ Interface: get_fps(EggXfmSAnim self)
- /**
This is only valid if has_fps() returns true.
*/
- getNumRows()
C++ Interface: get_num_rows(EggXfmSAnim self)
- /**
Returns the effective number of rows in the table. This is actually the
number of rows of the smallest subtable larger than one row. This is a
convenience function that treats the table of tables as if it were a single
table of matrices.
*/
- getStandardOrder()
C++ Interface: get_standard_order()
- /**
Returns the standard order of matrix component composition. This is what
the order string must be set to in order to use set_value() or add_data()
successfully.
*/
- getValue()
C++ Interface: get_value(EggXfmSAnim self, int row, LMatrix4d mat)
- /**
Returns the value of the aggregate row of the table as a matrix. This is a
convenience function that treats the table of tables as if it were a single
table of matrices. It is an error to call this if any SAnimData children
of this node have an improper name (e.g. not a single letter, or not one
of “ijkabchprxyz”).
*/
- get_class_type()
C++ Interface: get_class_type()
- get_coordinate_system()
C++ Interface: get_coordinate_system(EggXfmSAnim self)
- /**
Returns the coordinate system this table believes it is defined within.
This should always match the coordinate system of the EggData structure
that owns it. It is necessary to store it here because the meaning of the
h, p, and r columns depends on the coordinate system.
*/
- get_fps()
C++ Interface: get_fps(EggXfmSAnim self)
- /**
This is only valid if has_fps() returns true.
*/
- get_num_rows()
C++ Interface: get_num_rows(EggXfmSAnim self)
- /**
Returns the effective number of rows in the table. This is actually the
number of rows of the smallest subtable larger than one row. This is a
convenience function that treats the table of tables as if it were a single
table of matrices.
*/
- get_standard_order()
C++ Interface: get_standard_order()
- /**
Returns the standard order of matrix component composition. This is what
the order string must be set to in order to use set_value() or add_data()
successfully.
*/
- get_value()
C++ Interface: get_value(EggXfmSAnim self, int row, LMatrix4d mat)
- /**
Returns the value of the aggregate row of the table as a matrix. This is a
convenience function that treats the table of tables as if it were a single
table of matrices. It is an error to call this if any SAnimData children
of this node have an improper name (e.g. not a single letter, or not one
of “ijkabchprxyz”).
*/
- normalize()
C++ Interface: normalize(const EggXfmSAnim self)
- /**
The inverse operation of optimize(), this ensures that all the sub-tables
have the same length by duplicating rows as necessary. This is needed
before doing operations like add_data() or set_value() on an existing
table.
*/
- optimize()
C++ Interface: optimize(const EggXfmSAnim self)
- /**
Optimizes the table by collapsing redundant sub-tables.
*/
- optimizeToStandardOrder()
C++ Interface: optimize_to_standard_order(const EggXfmSAnim self)
- /**
Optimizes the table by collapsing redundant sub-tables, and simultaneously
ensures that the order string is the standard order (which is the same as
that supported by compose_matrix() and decompose_matrix()).
*/
- optimize_to_standard_order()
C++ Interface: optimize_to_standard_order(const EggXfmSAnim self)
- /**
Optimizes the table by collapsing redundant sub-tables, and simultaneously
ensures that the order string is the standard order (which is the same as
that supported by compose_matrix() and decompose_matrix()).
*/
- setValue()
C++ Interface: set_value(const EggXfmSAnim self, int row, const LMatrix4d mat)
- /**
Replaces the indicated row of the table with the given matrix.
This function can only be called if all the constraints of add_data(),
below, are met. Call normalize() first if you are not sure.
The return value is true if the matrix can be decomposed and stored as
scale, shear, rotate, and translate, or false otherwise. The data is set
in either case.
*/
- set_value()
C++ Interface: set_value(const EggXfmSAnim self, int row, const LMatrix4d mat)
- /**
Replaces the indicated row of the table with the given matrix.
This function can only be called if all the constraints of add_data(),
below, are met. Call normalize() first if you are not sure.
The return value is true if the matrix can be decomposed and stored as
scale, shear, rotate, and translate, or false otherwise. The data is set
in either case.
*/