|
|
|
This is one node of a hierarchy of EggJointData nodes, each of which represents a single joint of the character hierarchy across all loaded files: the various models, the LOD's of each model, and the various animation channel files.
More...
#include "eggJointData.h"
List of all members.
Public Member Functions |
|
| EggJointData (EggCharacterCollection *collection, EggCharacterData *char_data) |
| virtual void | add_back_pointer (int model_index, EggObject *egg_object) |
| | Adds the indicated model joint or anim table to the data.
|
| void | apply_default_pose (int source_model, int frame) |
| | Applies the pose from the indicated frame of the indicated source model_index as the initial pose for this joint, and does this recursively on all joints below.
|
| bool | do_rebuild_all (EggCharacterDb &db) |
| | Calls do_rebuild() on all models, and recursively on all joints at this node and below.
|
| void | expose (EggGroup::DCSType dcs_type=EggGroup::DC_default) |
| | Calls expose() on all models for this joint, but does not recurse downwards.
|
| EggJointData * | find_joint (const string &name) |
| | Returns the first descendent joint found with the indicated name, or NULL if no joint has that name.
|
|
virtual TypeHandle | force_init_type () |
| void | force_initial_rest_frame () |
| | Forces all of the joints to have the same rest frame value as the first joint read in.
|
|
EggJointData * | get_child (int n) const |
| LMatrix4d | get_frame (int model_index, int n) const |
| | Returns the local transform matrix corresponding to this joint position in the nth frame in the indicated model.
|
| LMatrix4d | get_net_frame (int model_index, int n, EggCharacterDb &db) const |
| | Returns the complete transform from the root corresponding to this joint position in the nth frame in the indicated model.
|
| LMatrix4d | get_net_frame_inv (int model_index, int n, EggCharacterDb &db) const |
| | Returns the inverse of get_net_frame().
|
|
int | get_num_children () const |
|
EggJointData * | get_parent () const |
| const LMatrix4d & | get_rest_frame () const |
| | Returns the rest frame of the joint.
|
|
virtual TypeHandle | get_type () const |
| bool | has_rest_frame () const |
| | Returns true if the joint knows its rest frame, false otherwise.
|
| void | move_vertices_to (EggJointData *new_owner) |
| | Moves the vertices assigned to this joint into the indicated joint, without changing their weight assignments.
|
| void | optimize () |
| | Calls optimize() on all models, and recursively on all joints at this node and below.
|
| void | quantize_channels (const string &components, double quantum) |
| | Calls quantize_channels() on all models for this joint, and then recurses downwards to all joints below.
|
| void | reparent_to (EggJointData *new_parent) |
| | Indicates an intention to change the parent of this joint to the indicated joint, or NULL to remove it from the hierarchy.
|
| bool | rest_frames_differ () const |
| | Returns true if the rest frames for different models differ in their initial value.
|
| int | score_reparent_to (EggJointData *new_parent, EggCharacterDb &db) |
| | Computes a score >= 0 reflecting the similarity of the current joint's animation (in world space) to that of the indicated potential parent joint (in world space).
|
|
virtual void | write (ostream &out, int indent_level=0) const |
| void | zero_channels (const string &components) |
| | Calls zero_channels() on all models for this joint, but does not recurse downwards.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
Protected Types |
|
typedef pvector< EggJointData * > | Children |
Protected Member Functions |
| bool | calc_new_parent_depth (pset< EggJointData * > &chain) |
| | Calculates the number of joints above this joint in its intended position, as specified by a recent call to reparent_to(), and also checks for a cycle in the new parent chain.
|
| void | do_begin_compute_reparent () |
| | Eliminates any cached values before beginning a walk through all the joints for do_compute_reparent(), for a given model/frame.
|
| void | do_begin_reparent () |
| | Clears out the _children vector in preparation for refilling it from the _new_parent information.
|
| bool | do_compute_reparent (int model_index, int n, EggCharacterDb &db) |
| | Prepares the reparent operation by computing a new transform for each frame of each model, designed to keep the net transform the same when the joint is moved to its new parent.
|
| void | do_finish_reparent () |
| | Performs the actual reparenting operation by removing all of the old children and replacing them with the set of new children.
|
| bool | do_joint_rebuild (int model_index, EggCharacterDb &db) |
| | Calls do_rebuild() on the joint for the indicated model index.
|
Protected Attributes |
|
Children | _children |
|
bool | _got_new_parent_depth |
|
EggJointData * | _new_parent |
|
int | _new_parent_depth |
|
EggJointData * | _parent |
Friends |
|
class | EggCharacterCollection |
|
class | EggCharacterData |
|
class | OrderJointsByNewDepth |
Detailed Description
This is one node of a hierarchy of EggJointData nodes, each of which represents a single joint of the character hierarchy across all loaded files: the various models, the LOD's of each model, and the various animation channel files.
Definition at line 34 of file eggJointData.h.
Member Function Documentation
Returns the complete transform from the root corresponding to this joint position in the nth frame in the indicated model.
Definition at line 73 of file eggJointData.cxx.
References get_frame(), EggCharacterDb::get_matrix(), EggComponentData::get_model(), get_net_frame(), LMatrix4d::ident_mat(), and EggCharacterDb::set_matrix().
Referenced by do_compute_reparent(), get_net_frame(), get_net_frame_inv(), score_reparent_to(), EggTopstrip::strip_anim(), and EggTopstrip::strip_anim_vertices().
Returns true if the joint knows its rest frame, false otherwise.
In general, this will be true as long as the joint is included in at least one model file, or false if it appears only in animation files.
Definition at line 72 of file eggJointData.I.
Referenced by force_initial_rest_frame(), and get_rest_frame().
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from EggComponentData.
Definition at line 109 of file eggJointData.h.
Indicates an intention to change the parent of this joint to the indicated joint, or NULL to remove it from the hierarchy.
The joint is not reparented immediately, but rather all of the joints are reparented at once when do_reparent() is called.
Definition at line 112 of file eggJointData.I.
Referenced by EggCharacterData::choose_optimal_hierarchy().
Computes a score >= 0 reflecting the similarity of the current joint's animation (in world space) to that of the indicated potential parent joint (in world space).
The lower the number, the more similar the motion, and the more suitable is the proposed parent-child relationship. Returns -1 if there is an error.
Definition at line 191 of file eggJointData.cxx.
References Datagram::get_data(), Datagram::get_length(), EggComponentData::get_model(), get_net_frame(), get_net_frame_inv(), EggComponentData::get_num_frames(), EggComponentData::get_num_models(), LMatrix4d::ident_mat(), FFTCompressor::is_compression_available(), FFTCompressor::write_hprs(), and FFTCompressor::write_reals().
Referenced by EggCharacterData::choose_optimal_hierarchy().
The documentation for this class was generated from the following files:
| | |