Panda3D
|
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nodes. More...
#include "eggGroup.h"
Public Types | |
enum | BillboardType { BT_none = 0x00000000, BT_axis = 0x00000020, BT_point_camera_relative = 0x00000040, BT_point_world_relative = 0x00000080 } |
enum | BlendMode { BM_unspecified, BM_none, BM_add, BM_subtract, BM_inv_subtract, BM_min, BM_max } |
enum | BlendOperand { BO_unspecified, BO_zero, BO_one, BO_incoming_color, BO_one_minus_incoming_color, BO_fbuffer_color, BO_one_minus_fbuffer_color, BO_incoming_alpha, BO_one_minus_incoming_alpha, BO_fbuffer_alpha, BO_one_minus_fbuffer_alpha, BO_constant_color, BO_one_minus_constant_color, BO_constant_alpha, BO_one_minus_constant_alpha, BO_incoming_color_saturate, BO_color_scale, BO_one_minus_color_scale, BO_alpha_scale, BO_one_minus_alpha_scale } |
enum | CollideFlags { CF_none = 0x00000000, CF_descend = 0x00100000, CF_event = 0x00200000, CF_keep = 0x00400000, CF_solid = 0x00800000, CF_center = 0x01000000, CF_turnstile = 0x02000000, CF_level = 0x04000000, CF_intangible = 0x08000000 } |
enum | CollisionSolidType { CST_none = 0x00000000, CST_plane = 0x00010000, CST_polygon = 0x00020000, CST_polyset = 0x00030000, CST_sphere = 0x00040000, CST_tube = 0x00050000, CST_inv_sphere = 0x00060000, CST_floor_mesh = 0x00080000 } |
enum | DartType { DT_none = 0x00000000, DT_structured = 0x10000000, DT_sync = 0x20000000, DT_nosync = 0x30000000, DT_default = 0x40000000 } |
enum | DCSType { DC_unspecified = 0x00000000, DC_none = 0x00000010, DC_local = 0x00000020, DC_net = 0x00000030, DC_no_touch = 0x00000040, DC_default = 0x00000050 } |
enum | GroupType { GT_invalid = -1, GT_group = 0x00000000, GT_instance = 0x00000001, GT_joint = 0x00000002 } |
typedef pmap< string, string > | TagData |
typedef pmap< PT_EggVertex, double > | VertexRef |
Public Member Functions | |
EggGroup (const string &name="") | |
EggGroup (const EggGroup ©) | |
void | add_group_ref (EggGroup *group) |
Adds a new <Ref> entry to the group. | |
void | add_object_type (const string &object_type) |
virtual EggTransform * | as_transform () |
Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not. | |
void | clear_billboard_center () |
void | clear_blend_color () |
Removes the blend color specification. | |
void | clear_collide_mask () |
void | clear_collision_name () |
void | clear_default_pose () |
Removes the initial pose transform. | |
void | clear_from_collide_mask () |
void | clear_group_refs () |
Removes all of the <Ref> entries within this group. | |
void | clear_indexed_flag () |
void | clear_into_collide_mask () |
void | clear_lod () |
void | clear_object_types () |
void | clear_tag (const string &key) |
Removes the value defined for this key on this particular node. | |
virtual EggRenderMode * | determine_alpha_mode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has an alpha_mode other than AM_unspecified. | |
virtual EggRenderMode * | determine_bin () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a bin specified. | |
virtual bool | determine_decal () |
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set. | |
virtual EggRenderMode * | determine_depth_offset () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_offset specified. | |
virtual EggRenderMode * | determine_depth_test_mode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_test_mode other than DTM_unspecified. | |
virtual EggRenderMode * | determine_depth_write_mode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_write_mode other than DWM_unspecified. | |
virtual EggRenderMode * | determine_draw_order () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a draw_order specified. | |
virtual bool | determine_indexed () |
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set. | |
virtual EggRenderMode * | determine_visibility_mode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a visibility_mode other than VM_unspecified. | |
virtual TypeHandle | force_init_type () |
const LPoint3d & | get_billboard_center () const |
BillboardType | get_billboard_type () const |
const LColor & | get_blend_color () const |
Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not. | |
BlendMode | get_blend_mode () const |
BlendOperand | get_blend_operand_a () const |
BlendOperand | get_blend_operand_b () const |
CollideFlags | get_collide_flags () const |
CollideMask | get_collide_mask () const |
const string & | get_collision_name () const |
CollisionSolidType | get_cs_type () const |
DartType | get_dart_type () const |
DCSType | get_dcs_type () const |
bool | get_decal_flag () const |
const EggTransform & | get_default_pose () const |
Returns a read-only accessor to the initial pose transform. | |
bool | get_direct_flag () const |
CollideMask | get_from_collide_mask () const |
EggGroup * | get_group_ref (int n) const |
Returns the nth <Ref> entry within this group. | |
GroupType | get_group_type () const |
bool | get_indexed_flag () const |
CollideMask | get_into_collide_mask () const |
const EggSwitchCondition & | get_lod () const |
bool | get_model_flag () const |
bool | get_nofog_flag () const |
int | get_num_group_refs () const |
Returns the number of <Ref> entries within this group. | |
int | get_num_object_types () const |
string | get_object_type (int index) const |
bool | get_occluder_flag () const |
bool | get_polylight_flag () const |
bool | get_portal_flag () const |
double | get_scroll_r () const |
double | get_scroll_u () const |
double | get_scroll_v () const |
bool | get_switch_flag () const |
double | get_switch_fps () const |
string | get_tag (const string &key) const |
Retrieves the user-defined value that was previously set on this node for the particular key, if any. | |
bool | get_texlist_flag () const |
virtual TypeHandle | get_type () const |
double | get_vertex_membership (const EggVertex *vert) const |
Returns the amount of membership of the indicated vertex in this group. | |
bool | has_billboard_center () const |
bool | has_blend_color () const |
Returns true if the blend color has been specified, false otherwise. | |
bool | has_collide_mask () const |
bool | has_collision_name () const |
bool | has_dcs_type () const |
Returns true if the specified DCS type is not DC_none and not DC_unspecified. | |
bool | has_from_collide_mask () const |
bool | has_indexed_flag () const |
bool | has_into_collide_mask () const |
bool | has_lod () const |
bool | has_object_type (const string &object_type) const |
Returns true if the indicated object type has been added to the group, or false otherwise. | |
bool | has_scrolling_uvs () |
bool | has_tag (const string &key) const |
Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set. | |
bool | is_instance_type () const |
Returns true if this group is an instance type node; i.e. | |
virtual bool | is_joint () const |
Returns true if this particular node represents a <Joint> entry or not. | |
MAKE_SEQ (get_object_types, get_num_object_types, get_object_type) | |
MAKE_SEQ (get_group_refs, get_num_group_refs, get_group_ref) | |
EggTransform & | modify_default_pose () |
Returns a writable accessor to the initial pose transform. | |
EggGroup & | operator= (const EggGroup ©) |
void | ref_vertex (EggVertex *vert, double membership=1.0) |
Adds the vertex to the set of those referenced by the group, at the indicated membership level. | |
void | remove_group_ref (int n) |
Removes the nth <Ref> entry within this group. | |
bool | remove_object_type (const string &object_type) |
Removes the first instance of the indicated object type from the group if it is present. | |
void | set_billboard_center (const LPoint3d &billboard_center) |
Sets the point around which the billboard will rotate, if this node contains a billboard specification. | |
void | set_billboard_type (BillboardType type) |
void | set_blend_color (const LColor &blend_color) |
void | set_blend_mode (BlendMode blend_mode) |
void | set_blend_operand_a (BlendOperand blend_operand_a) |
void | set_blend_operand_b (BlendOperand blend_operand_b) |
void | set_collide_flags (int flags) |
void | set_collide_mask (CollideMask mask) |
void | set_collision_name (const string &collision_name) |
void | set_cs_type (CollisionSolidType type) |
void | set_dart_type (DartType type) |
void | set_dcs_type (DCSType type) |
void | set_decal_flag (bool flag) |
void | set_default_pose (const EggTransform &transform) |
Replaces the initial pose transform. | |
void | set_direct_flag (bool flag) |
void | set_from_collide_mask (CollideMask mask) |
void | set_group_type (GroupType type) |
void | set_indexed_flag (bool flag) |
If this flag is true, geometry at this node and below will be generated as indexed geometry. | |
void | set_into_collide_mask (CollideMask mask) |
void | set_lod (const EggSwitchCondition &lod) |
void | set_model_flag (bool flag) |
void | set_nofog_flag (bool flag) |
void | set_occluder_flag (bool flag) |
void | set_polylight_flag (bool flag) |
void | set_portal_flag (bool flag) |
void | set_scroll_r (const double r_speed) |
void | set_scroll_u (const double u_speed) |
void | set_scroll_v (const double v_speed) |
void | set_switch_flag (bool flag) |
void | set_switch_fps (double fps) |
void | set_tag (const string &key, const string &value) |
Associates a user-defined value with a user-defined key which is stored on the node. | |
void | set_texlist_flag (bool flag) |
void | set_vertex_membership (EggVertex *vert, double membership) |
Explicitly sets the net membership of the indicated vertex in this group to the given value. | |
void | steal_vrefs (EggGroup *other) |
Moves all of the vertex references from the indicated other group into this one. | |
TagData::const_iterator | tag_begin () const |
Returns an iterator that can, in conjunction with tag_end(), be used to traverse the entire set of tag keys. | |
TagData::const_iterator | tag_end () const |
Returns an iterator that can, in conjunction with tag_begin(), be used to traverse the entire set of tag keys. | |
TagData::size_type | tag_size () const |
Returns the number of elements between tag_begin() and tag_end(). | |
void | test_vref_integrity () const |
void | unref_all_vertices () |
Removes all vertices from the reference list. | |
void | unref_vertex (EggVertex *vert) |
Removes the vertex from the set of those referenced by the group. | |
VertexRef::const_iterator | vref_begin () const |
Returns an iterator that can, in conjunction with vref_end(), be used to traverse the entire set of referenced vertices. | |
VertexRef::const_iterator | vref_end () const |
Returns an iterator that can, in conjunction with vref_begin(), be used to traverse the entire set of referenced vertices. | |
VertexRef::size_type | vref_size () const |
Returns the number of elements between vref_begin() and vref_end(). | |
virtual void | write (ostream &out, int indent_level) const |
Writes the group and all of its children to the indicated output stream in Egg format. | |
void | write_billboard_flags (ostream &out, int indent_level) const |
Writes just the <Billboard> entry and related fields to the indicated ostream. | |
void | write_collide_flags (ostream &out, int indent_level) const |
Writes just the <Collide> entry and related fields to the indicated ostream. | |
void | write_decal_flags (ostream &out, int indent_level) const |
Writes the flags related to decaling, if any. | |
void | write_model_flags (ostream &out, int indent_level) const |
Writes the <Model> flag and related flags to the indicated ostream. | |
void | write_object_types (ostream &out, int indent_level) const |
Writes just the <ObjectTypes> entries, if any, to the indicated ostream. | |
void | write_render_mode (ostream &out, int indent_level) const |
Writes the flags inherited from EggRenderMode and similar flags that control obscure render effects. | |
void | write_switch_flags (ostream &out, int indent_level) const |
Writes the <Switch> flag and related flags to the indicated ostream. | |
void | write_tags (ostream &out, int indent_level) const |
Writes just the <Tag> entries, if any, to the indicated ostream. | |
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. | |
static BillboardType | string_billboard_type (const string &strval) |
Returns the BillboardType value associated with the given string representation, or BT_none if the string does not match any known BillboardType value. | |
static BlendMode | string_blend_mode (const string &strval) |
Returns the BlendMode value associated with the given string representation, or BM_none if the string does not match any known BlendMode. | |
static BlendOperand | string_blend_operand (const string &strval) |
Returns the BlendOperand value associated with the given string representation, or BO_none if the string does not match any known BlendOperand. | |
static CollideFlags | string_collide_flags (const string &strval) |
Returns the CollideFlags value associated with the given string representation, or CF_none if the string does not match any known CollideFlags value. | |
static CollisionSolidType | string_cs_type (const string &strval) |
Returns the CollisionSolidType value associated with the given string representation, or CST_none if the string does not match any known CollisionSolidType value. | |
static DartType | string_dart_type (const string &strval) |
Returns the DartType value associated with the given string representation, or DT_none if the string does not match any known DartType value. | |
static DCSType | string_dcs_type (const string &strval) |
Returns the DCSType value associated with the given string representation, or DC_unspecified if the string does not match any known DCSType value. | |
static GroupType | string_group_type (const string &strval) |
Returns the GroupType value associated with the given string representation, or GT_invalid if the string does not match any known GroupType value. | |
Protected Member Functions | |
virtual void | adjust_under () |
This is called within update_under() after all the various under settings have been inherited directly from the parent node. | |
virtual bool | egg_start_parse_body () |
This function is called within parse_egg(). | |
virtual void | r_flatten_transforms () |
The recursive implementation of flatten_transforms(). | |
virtual void | r_transform (const LMatrix4d &mat, const LMatrix4d &inv, CoordinateSystem to_cs) |
This is called from within the egg code by transform(). | |
virtual void | transform_changed () |
This virtual method is inherited by EggTransform3d; it is called whenever the transform is changed. | |
void | write_vertex_ref (ostream &out, int indent_level) const |
Writes out the vertex ref component of the group body only. |
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nodes.
Definition at line 36 of file eggGroup.h.
void EggGroup::add_group_ref | ( | EggGroup * | group | ) |
Adds a new <Ref> entry to the group.
This declares an internal reference to another node, and is used to implement scene-graph instancing; it is only valid if the group_type is GT_instance.
Definition at line 844 of file eggGroup.cxx.
void EggGroup::adjust_under | ( | ) | [protected, virtual] |
This is called within update_under() after all the various under settings have been inherited directly from the parent node.
It is responsible for adjusting these settings to reflect states local to the current node; for instance, an <Instance> node will force the UF_under_instance bit on.
Reimplemented from EggNode.
Definition at line 1232 of file eggGroup.cxx.
References EggNode::get_node_frame(), EggNode::get_node_frame_inv(), EggTransform::get_transform3d(), EggNode::get_vertex_frame(), EggNode::get_vertex_frame_inv(), EggTransform::has_transform(), LMatrix4d::invert_from(), and is_instance_type().
EggTransform * EggGroup::as_transform | ( | ) | [virtual] |
Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not.
Reimplemented from EggObject.
Definition at line 1133 of file eggGroup.cxx.
void EggGroup::clear_blend_color | ( | ) | [inline] |
Removes the blend color specification.
Definition at line 799 of file eggGroup.I.
References LVecBase4f::zero().
void EggGroup::clear_default_pose | ( | ) | [inline] |
Removes the initial pose transform.
See set_default_pose().
Definition at line 983 of file eggGroup.I.
References EggTransform::clear_transform().
void EggGroup::clear_group_refs | ( | ) |
Removes all of the <Ref> entries within this group.
See add_group_ref().
Definition at line 891 of file eggGroup.cxx.
void EggGroup::clear_tag | ( | const string & | key | ) | [inline] |
Removes the value defined for this key on this particular node.
After a call to clear_tag(), has_tag() will return false for the indicated key.
Definition at line 927 of file eggGroup.I.
EggRenderMode * EggGroup::determine_alpha_mode | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has an alpha_mode other than AM_unspecified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 515 of file eggGroup.cxx.
References EggRenderMode::get_alpha_mode().
EggRenderMode * EggGroup::determine_bin | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a bin specified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 617 of file eggGroup.cxx.
References EggRenderMode::has_bin().
bool EggGroup::determine_decal | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set.
Returns the value of the decal flag if it is found, or false if it is not.
In other words, returns true if the "decal" flag is in effect for the indicated node, false otherwise.
Reimplemented from EggNode.
Definition at line 655 of file eggGroup.cxx.
EggRenderMode * EggGroup::determine_depth_offset | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_offset specified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 583 of file eggGroup.cxx.
References EggRenderMode::has_depth_offset().
EggRenderMode * EggGroup::determine_depth_test_mode | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_test_mode other than DTM_unspecified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 549 of file eggGroup.cxx.
References EggRenderMode::get_depth_test_mode().
EggRenderMode * EggGroup::determine_depth_write_mode | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_write_mode other than DWM_unspecified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 532 of file eggGroup.cxx.
References EggRenderMode::get_depth_write_mode().
EggRenderMode * EggGroup::determine_draw_order | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a draw_order specified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 600 of file eggGroup.cxx.
References EggRenderMode::has_draw_order().
bool EggGroup::determine_indexed | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set.
Returns the value of the indexed scalar if it is found, or false if it is not.
In other words, returns true if the "indexed" flag is in effect for the indicated node, false otherwise.
Reimplemented from EggNode.
Definition at line 636 of file eggGroup.cxx.
EggRenderMode * EggGroup::determine_visibility_mode | ( | ) | [virtual] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a visibility_mode other than VM_unspecified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
Definition at line 566 of file eggGroup.cxx.
References EggRenderMode::get_visibility_mode().
bool EggGroup::egg_start_parse_body | ( | ) | [protected, virtual] |
This function is called within parse_egg().
It should call the appropriate function on the lexer to initialize the parser into the state associated with this object. If the object cannot be parsed into directly, it should return false.
Reimplemented from EggNode.
Definition at line 1216 of file eggGroup.cxx.
const LColor & EggGroup::get_blend_color | ( | ) | const [inline] |
Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not.
Definition at line 822 of file eggGroup.I.
Referenced by write().
const EggTransform & EggGroup::get_default_pose | ( | ) | const [inline] |
Returns a read-only accessor to the initial pose transform.
This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group's <Transform> entry, which defines the (eventual) space of the group's vertices.
Definition at line 942 of file eggGroup.I.
EggGroup * EggGroup::get_group_ref | ( | int | n | ) | const |
Returns the nth <Ref> entry within this group.
See add_group_ref().
Definition at line 867 of file eggGroup.cxx.
int EggGroup::get_num_group_refs | ( | ) | const |
Returns the number of <Ref> entries within this group.
See add_group_ref().
Definition at line 856 of file eggGroup.cxx.
string EggGroup::get_tag | ( | const string & | key | ) | const [inline] |
Retrieves the user-defined value that was previously set on this node for the particular key, if any.
If no value has been previously set, returns the empty string.
Definition at line 896 of file eggGroup.I.
double EggGroup::get_vertex_membership | ( | const EggVertex * | vert | ) | const |
Returns the amount of membership of the indicated vertex in this group.
If the vertex is not reffed by the group, returns 0.
Definition at line 749 of file eggGroup.cxx.
Referenced by EggVertex::copy_grefs_from().
bool EggGroup::has_blend_color | ( | ) | const [inline] |
Returns true if the blend color has been specified, false otherwise.
Definition at line 811 of file eggGroup.I.
Referenced by write().
bool EggGroup::has_dcs_type | ( | ) | const [inline] |
Returns true if the specified DCS type is not DC_none and not DC_unspecified.
Definition at line 244 of file eggGroup.I.
bool EggGroup::has_object_type | ( | const string & | object_type | ) | const |
Returns true if the indicated object type has been added to the group, or false otherwise.
Definition at line 155 of file eggGroup.cxx.
Referenced by MayaNodeTree::get_egg_group(), and MayaNodeDesc::has_object_type().
bool EggGroup::has_tag | ( | const string & | key | ) | const [inline] |
Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set.
Definition at line 913 of file eggGroup.I.
static void EggGroup::init_type | ( | ) | [inline, static] |
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 EggGroupNode.
Reimplemented in EggBin.
Definition at line 405 of file eggGroup.h.
References EggGroupNode::init_type().
Referenced by EggBin::init_type().
bool EggGroup::is_instance_type | ( | ) | const [inline] |
Returns true if this group is an instance type node; i.e.
it begins the root of a local coordinate space. This is not related to instancing (multiple copies of a node in a scene graph).
This also includes the case of the node including a billboard flag without an explicit center, which implicitly makes the node behave like an instance.
Definition at line 39 of file eggGroup.I.
Referenced by adjust_under().
bool EggGroup::is_joint | ( | ) | const [virtual] |
Returns true if this particular node represents a <Joint> entry or not.
This is a handy thing to know since Joints are sorted to the end of their sibling list when writing an egg file. See EggGroupNode::write().
Reimplemented from EggNode.
Definition at line 501 of file eggGroup.cxx.
EggTransform & EggGroup::modify_default_pose | ( | ) | [inline] |
Returns a writable accessor to the initial pose transform.
This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group's <Transform> entry, which defines the (eventual) space of the group's vertices.
Definition at line 957 of file eggGroup.I.
void EggGroup::r_flatten_transforms | ( | ) | [protected, virtual] |
The recursive implementation of flatten_transforms().
Reimplemented from EggGroupNode.
Definition at line 1343 of file eggGroup.cxx.
References EggNode::get_vertex_frame(), EggTransform::internal_clear_transform(), EggNode::is_local_coord(), and set_billboard_center().
void EggGroup::r_transform | ( | const LMatrix4d & | mat, |
const LMatrix4d & | inv, | ||
CoordinateSystem | to_cs | ||
) | [protected, virtual] |
This is called from within the egg code by transform().
It applies a transformation matrix to the current node in some sensible way, then continues down the tree.
The first matrix is the transformation to apply; the second is its inverse. The third parameter is the coordinate system we are changing to, or CS_default if we are not changing coordinate systems.
Reimplemented from EggGroupNode.
Definition at line 1295 of file eggGroup.cxx.
References EggTransform::add_matrix4(), EggTransform::clear_transform(), EggTransform::get_transform3d(), EggTransform::has_transform(), EggTransform::internal_set_transform(), and LMatrix4d::set_row().
void EggGroup::ref_vertex | ( | EggVertex * | vert, |
double | membership = 1.0 |
||
) |
Adds the vertex to the set of those referenced by the group, at the indicated membership level.
If the vertex is already being referenced, increases the membership amount by the indicated amount.
Definition at line 671 of file eggGroup.cxx.
References unref_vertex().
Referenced by EggVertex::copy_grefs_from(), XFileMesh::create_polygons(), and steal_vrefs().
void EggGroup::remove_group_ref | ( | int | n | ) |
Removes the nth <Ref> entry within this group.
See add_group_ref().
Definition at line 879 of file eggGroup.cxx.
bool EggGroup::remove_object_type | ( | const string & | object_type | ) |
Removes the first instance of the indicated object type from the group if it is present.
Returns true if the object type was found and removed, false otherwise.
Definition at line 174 of file eggGroup.cxx.
Referenced by MayaNodeTree::get_egg_group().
void EggGroup::set_billboard_center | ( | const LPoint3d & | billboard_center | ) | [inline] |
Sets the point around which the billboard will rotate, if this node contains a billboard specification.
If a billboard type is given but no billboard_center is specified, then the group node is treated as an <Instance>, and the billboard rotates around the origin. If, however, a billboard_center is specified, then the group node is *not* treated as an <Instance>, and the billboard rotates around the specified point.
The point is in the same coordinate system as the vertices of this node: usually global, but possibly local if there is an <Instance> somewhere above. Specifically, this is the coordinate system defined by get_vertex_frame().
Definition at line 91 of file eggGroup.I.
References EggGroupNode::update_under().
Referenced by r_flatten_transforms().
void EggGroup::set_default_pose | ( | const EggTransform & | transform | ) | [inline] |
Replaces the initial pose transform.
This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group's <Transform> entry, which defines the (eventual) space of the group's vertices.
Definition at line 972 of file eggGroup.I.
References EggNode::transform().
void EggGroup::set_indexed_flag | ( | bool | flag | ) | [inline] |
If this flag is true, geometry at this node and below will be generated as indexed geometry.
Definition at line 556 of file eggGroup.I.
void EggGroup::set_tag | ( | const string & | key, |
const string & | value | ||
) | [inline] |
Associates a user-defined value with a user-defined key which is stored on the node.
This value has no meaning to Panda; but it is stored indefinitely on the node until it is requested again. This value will be copied to the PandaNode that is created for this particular EggGroup if the egg file is loaded as a scene.
Each unique key stores a different string value. There is no effective limit on the number of different keys that may be stored or on the length of any one key's value.
Definition at line 883 of file eggGroup.I.
Referenced by MayaNodeTree::get_egg_group().
void EggGroup::set_vertex_membership | ( | EggVertex * | vert, |
double | membership | ||
) |
Explicitly sets the net membership of the indicated vertex in this group to the given value.
Definition at line 766 of file eggGroup.cxx.
References unref_vertex().
void EggGroup::steal_vrefs | ( | EggGroup * | other | ) |
Moves all of the vertex references from the indicated other group into this one.
If a given vertex was previously shared by both groups, the relative memberships will be summed.
Definition at line 800 of file eggGroup.cxx.
References ref_vertex(), unref_all_vertices(), vref_begin(), and vref_end().
EggGroup::BillboardType EggGroup::string_billboard_type | ( | const string & | strval | ) | [static] |
Returns the BillboardType value associated with the given string representation, or BT_none if the string does not match any known BillboardType value.
Definition at line 971 of file eggGroup.cxx.
EggGroup::BlendMode EggGroup::string_blend_mode | ( | const string & | strval | ) | [static] |
Returns the BlendMode value associated with the given string representation, or BM_none if the string does not match any known BlendMode.
Definition at line 1055 of file eggGroup.cxx.
EggGroup::BlendOperand EggGroup::string_blend_operand | ( | const string & | strval | ) | [static] |
Returns the BlendOperand value associated with the given string representation, or BO_none if the string does not match any known BlendOperand.
Definition at line 1081 of file eggGroup.cxx.
EggGroup::CollideFlags EggGroup::string_collide_flags | ( | const string & | strval | ) | [static] |
Returns the CollideFlags value associated with the given string representation, or CF_none if the string does not match any known CollideFlags value.
This only recognizes a single keyword; it does not attempt to parse a string of keywords.
Definition at line 1025 of file eggGroup.cxx.
EggGroup::CollisionSolidType EggGroup::string_cs_type | ( | const string & | strval | ) | [static] |
Returns the CollisionSolidType value associated with the given string representation, or CST_none if the string does not match any known CollisionSolidType value.
Definition at line 993 of file eggGroup.cxx.
EggGroup::DartType EggGroup::string_dart_type | ( | const string & | strval | ) | [static] |
Returns the DartType value associated with the given string representation, or DT_none if the string does not match any known DartType value.
Definition at line 925 of file eggGroup.cxx.
EggGroup::DCSType EggGroup::string_dcs_type | ( | const string & | strval | ) | [static] |
Returns the DCSType value associated with the given string representation, or DC_unspecified if the string does not match any known DCSType value.
Definition at line 947 of file eggGroup.cxx.
EggGroup::GroupType EggGroup::string_group_type | ( | const string & | strval | ) | [static] |
Returns the GroupType value associated with the given string representation, or GT_invalid if the string does not match any known GroupType value.
Definition at line 905 of file eggGroup.cxx.
EggGroup::TagData::const_iterator EggGroup::tag_begin | ( | ) | const [inline] |
Returns an iterator that can, in conjunction with tag_end(), be used to traverse the entire set of tag keys.
Each iterator returns a pair<string, string>.
This interface is not safe to use outside of PANDAEGG.DLL.
Definition at line 999 of file eggGroup.I.
EggGroup::TagData::const_iterator EggGroup::tag_end | ( | ) | const [inline] |
Returns an iterator that can, in conjunction with tag_begin(), be used to traverse the entire set of tag keys.
Each iterator returns a pair<string, string>.
This interface is not safe to use outside of PANDAEGG.DLL.
Definition at line 1015 of file eggGroup.I.
EggGroup::TagData::size_type EggGroup::tag_size | ( | ) | const [inline] |
Returns the number of elements between tag_begin() and tag_end().
This interface is not safe to use outside of PANDAEGG.DLL.
Definition at line 1029 of file eggGroup.I.
void EggGroup::transform_changed | ( | ) | [protected, virtual] |
This virtual method is inherited by EggTransform3d; it is called whenever the transform is changed.
Reimplemented from EggTransform.
Definition at line 1379 of file eggGroup.cxx.
References EggGroupNode::update_under().
void EggGroup::unref_all_vertices | ( | ) |
Removes all vertices from the reference list.
Definition at line 725 of file eggGroup.cxx.
Referenced by steal_vrefs().
void EggGroup::unref_vertex | ( | EggVertex * | vert | ) |
Removes the vertex from the set of those referenced by the group.
Does nothing if the vertex is not already reffed.
Definition at line 707 of file eggGroup.cxx.
Referenced by EggVertex::clear_grefs(), ref_vertex(), and set_vertex_membership().
EggGroup::VertexRef::const_iterator EggGroup::vref_begin | ( | ) | const [inline] |
Returns an iterator that can, in conjunction with vref_end(), be used to traverse the entire set of referenced vertices.
Each iterator returns a pair<PT(EggVertex), double>.
This interface is not safe to use outside of PANDAEGG.DLL.
Definition at line 1045 of file eggGroup.I.
Referenced by steal_vrefs().
EggGroup::VertexRef::const_iterator EggGroup::vref_end | ( | ) | const [inline] |
Returns an iterator that can, in conjunction with vref_begin(), be used to traverse the entire set of referenced vertices.
Each iterator returns a pair<PT(EggVertex), double>.
This interface is not safe to use outside of PANDAEGG.DLL.
Definition at line 1061 of file eggGroup.I.
Referenced by steal_vrefs().
EggGroup::VertexRef::size_type EggGroup::vref_size | ( | ) | const [inline] |
Returns the number of elements between vref_begin() and vref_end().
This interface is not safe to use outside of PANDAEGG.DLL.
Definition at line 1075 of file eggGroup.I.
void EggGroup::write | ( | ostream & | out, |
int | indent_level | ||
) | const [virtual] |
Writes the group and all of its children to the indicated output stream in Egg format.
Reimplemented from EggGroupNode.
Definition at line 192 of file eggGroup.cxx.
References get_blend_color(), has_blend_color(), EggTransform::has_transform(), TypedObject::is_of_type(), EggTransform::write(), write_billboard_flags(), write_collide_flags(), write_decal_flags(), EggNamedObject::write_header(), write_model_flags(), write_object_types(), write_render_mode(), write_switch_flags(), write_tags(), and write_vertex_ref().
Referenced by write_render_mode().
void EggGroup::write_billboard_flags | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes just the <Billboard> entry and related fields to the indicated ostream.
Definition at line 326 of file eggGroup.cxx.
Referenced by write().
void EggGroup::write_collide_flags | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes just the <Collide> entry and related fields to the indicated ostream.
Definition at line 345 of file eggGroup.cxx.
References BitMask< WType, nbits >::output_hex().
Referenced by write().
void EggGroup::write_decal_flags | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes the flags related to decaling, if any.
Definition at line 450 of file eggGroup.cxx.
Referenced by write().
void EggGroup::write_model_flags | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes the <Model> flag and related flags to the indicated ostream.
Definition at line 387 of file eggGroup.cxx.
Referenced by write().
void EggGroup::write_object_types | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes just the <ObjectTypes> entries, if any, to the indicated ostream.
Definition at line 435 of file eggGroup.cxx.
Referenced by write().
void EggGroup::write_render_mode | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes the flags inherited from EggRenderMode and similar flags that control obscure render effects.
Definition at line 483 of file eggGroup.cxx.
References write().
Referenced by write().
void EggGroup::write_switch_flags | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes the <Switch> flag and related flags to the indicated ostream.
Definition at line 418 of file eggGroup.cxx.
Referenced by write().
void EggGroup::write_tags | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes just the <Tag> entries, if any, to the indicated ostream.
Definition at line 463 of file eggGroup.cxx.
Referenced by write().
void EggGroup::write_vertex_ref | ( | ostream & | out, |
int | indent_level | ||
) | const [protected] |
Writes out the vertex ref component of the group body only.
This may consist of a number of <VertexRef> entries, each with its own membership value.
Definition at line 1146 of file eggGroup.cxx.
References EggVertex::get_index(), and EggVertex::get_pool().
Referenced by write().