Panda3D
Public Member Functions | List of all members
CharacterMaker Class Reference

Converts an EggGroup hierarchy, beginning with a group with <Dart> set, to a character node with joints. More...

#include "characterMaker.h"

Public Member Functions

 CharacterMaker (EggGroup *root, EggLoader &loader, bool structured=false)
 
int create_slider (const string &name)
 Creates a new morph slider of the given name, and returns its index. More...
 
int egg_to_index (EggNode *egg_node) const
 Returns the index number associated with the PartGroup node for the given egg node, or -1. More...
 
PartGroupegg_to_part (EggNode *egg_node) const
 Returns the PartGroup node associated with the given egg node. More...
 
VertexSlideregg_to_slider (const string &name)
 Returns the VertexSlider corresponding to the indicated egg slider name. More...
 
VertexTransformegg_to_transform (EggNode *egg_node)
 Returns a JointVertexTransform suitable for applying the animation associated with the given egg node (which should be a joint). More...
 
string get_name () const
 Returns the name of the character. More...
 
Charactermake_node ()
 
PandaNodepart_to_node (PartGroup *part, const string &name) const
 Returns the scene graph node associated with the given PartGroup node, if there is one. More...
 

Detailed Description

Converts an EggGroup hierarchy, beginning with a group with <Dart> set, to a character node with joints.

Definition at line 48 of file characterMaker.h.

Member Function Documentation

◆ create_slider()

int CharacterMaker::create_slider ( const string &  name)

Creates a new morph slider of the given name, and returns its index.

Definition at line 193 of file characterMaker.cxx.

References egg_to_slider().

Referenced by part_to_node().

◆ egg_to_index()

int CharacterMaker::egg_to_index ( EggNode egg_node) const

Returns the index number associated with the PartGroup node for the given egg node, or -1.

Definition at line 139 of file characterMaker.cxx.

References part_to_node().

Referenced by egg_to_transform().

◆ egg_to_part()

PartGroup * CharacterMaker::egg_to_part ( EggNode egg_node) const

Returns the PartGroup node associated with the given egg node.

If the egg node is not a node in the character's hierarchy, returns the top of the character's hierarchy.

Definition at line 89 of file characterMaker.cxx.

References egg_to_transform().

Referenced by get_name().

◆ egg_to_slider()

VertexSlider * CharacterMaker::egg_to_slider ( const string &  name)

◆ egg_to_transform()

VertexTransform * CharacterMaker::egg_to_transform ( EggNode egg_node)

Returns a JointVertexTransform suitable for applying the animation associated with the given egg node (which should be a joint).

Returns an identity transform if the egg node is not a joint in the character's hierarchy.

Definition at line 110 of file characterMaker.cxx.

References egg_to_index().

Referenced by egg_to_part(), and EggLoader::make_polyset().

◆ get_name()

string CharacterMaker::get_name ( ) const

Returns the name of the character.

Definition at line 76 of file characterMaker.cxx.

References egg_to_part().

Referenced by EggLoader::make_polyset().

◆ part_to_node()

PandaNode * CharacterMaker::part_to_node ( PartGroup part,
const string &  name 
) const

Returns the scene graph node associated with the given PartGroup node, if there is one.

If the PartGroup does not have an associated node, returns the character's top node.

Definition at line 156 of file characterMaker.cxx.

References create_slider(), PandaNode::get_child(), PandaNode::get_num_children(), PandaNode::is_geom_node(), and TypedObject::is_of_type().

Referenced by egg_to_index().


The documentation for this class was generated from the following files: