Panda3D
|
A connected strip of triangles. More...
Public Types | |
enum | AlphaMode { AMUnspecified = 0, AMOff = 1, AMOn = 2, AMBlend = 3, AMBlendNoOcclude = 4, AMMs = 5, AMMsMask = 6, AMBinary = 7, AMDual = 8 } |
enum | DepthTestMode { DTMUnspecified = 0, DTMOff = 1, DTMOn = 2 } |
enum | DepthWriteMode { DWMUnspecified = 0, DWMOff = 1, DWMOn = 2 } |
enum | Shading { SUnknown = 0, SOverall = 1, SPerFace = 2, SPerVertex = 3 } |
enum | VisibilityMode { VMUnspecified = 0, VMHidden = 1, VMNormal = 2 } |
Public Member Functions | |
EggTriangleStrip (EggTriangleStrip const copy) | |
EggTriangleStrip (string name) | |
EggTriangleStrip () | |
addTexture (EggTexture texture) | |
Applies the indicated texture to the primitive. | |
EggVertex | addVertex (EggVertex vertex) |
Adds the indicated vertex to the end of the primitive's list of vertices, and returns it. | |
applyFirstAttribute () | |
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded. | |
applyLastAttribute () | |
Sets the last vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded. | |
applyTexmats () | |
Applies the texture matrices to the UV's of the vertices that reference them, and then removes the texture matrices from the textures themselves. | |
bool | cleanup () |
Cleans up modeling errors in whatever context this makes sense. | |
clear () | |
Removes all of the vertices from the primitive. | |
clearBin () | |
Removes the bin name that was set for this particular object. | |
clearColor () | |
clearConnectedShading () | |
Resets the connected_shading member in this primitive, so that get_connected_shading() will recompute a new value. | |
clearDepthOffset () | |
Removes the depth-offset flag from this particular object. | |
clearDrawOrder () | |
Removes the draw-order flag from this particular object. | |
clearMaterial () | |
Removes any material from the primitive. | |
clearNormal () | |
clearTexture () | |
Removes any texturing from the primitive. | |
clearUserData () | |
Removes *all* user data pointers from the node. | |
clearUserData (TypeHandle type) | |
Removes the user data pointer of the indicated type. | |
int | compareTo (EggAttributes const other) |
An ordering operator to compare two vertices for sorting order. | |
copyAttributes (EggAttributes const other) | |
Copies the rendering attributes from the indicated primitive. | |
copyAttributes (EggPrimitive const other) | |
Copies the rendering attributes from the indicated primitive. | |
copyColor (EggAttributes const other) | |
Sets this color to be the same as the other's, include morphs. | |
copyNormal (EggAttributes const other) | |
Sets this normal to be the same as the other's, include morphs. | |
copyVertices (EggPrimitive const other) | |
Replaces the current primitive's list of vertices with a copy of the list of vertices on the other primitive. | |
EggRenderMode | determineAlphaMode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has an alpha_mode other than AM_unspecified. | |
EggRenderMode | determineBin () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a bin specified. | |
bool | determineDecal () |
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set. | |
EggRenderMode | determineDepthOffset () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a depth_offset specified. | |
EggRenderMode | determineDepthTestMode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_test_mode other than DTM_unspecified. | |
EggRenderMode | determineDepthWriteMode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_write_mode other than DWM_unspecified. | |
EggRenderMode | determineDrawOrder () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a draw_order specified. | |
bool | determineIndexed () |
Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set. | |
EggRenderMode | determineVisibilityMode () |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a visibility_mode other than VM_unspecified. | |
flattenTransforms () | |
Removes any transform and instance records from this node in the scene graph and below. | |
AlphaMode | getAlphaMode () |
Returns the alpha mode that was set, or AM_unspecified if nothing was set. | |
bool | getBfaceFlag () |
Retrieves the backfacing flag of the polygon. | |
string | getBin () |
Returns the bin name that has been set for this particular object, if any. | |
VBase4 | getColor () |
Returns the color set on this particular attribute. | |
EggAttributes | getComponent (int i) |
Returns the attributes for the nth component triangle. | |
EggAttributes const | getComponent (int i) |
Returns the attributes for the nth component triangle. | |
list | getComponents () |
Shading | getConnectedShading () |
Determines what sort of shading properties this primitive's connected neighbors have. | |
int | getDepth () |
Returns the number of nodes above this node in the egg hierarchy. | |
int | getDepthOffset () |
Returns the "depth-offset" flag as set for this particular object. | |
DepthTestMode | getDepthTestMode () |
Returns the depth_test mode that was set, or DTM_unspecified if nothing was set. | |
DepthWriteMode | getDepthWriteMode () |
Returns the depth_write mode that was set, or DWM_unspecified if nothing was set. | |
int | getDrawOrder () |
Returns the "draw-order" flag as set for this particular object. | |
EggMaterial | getMaterial () |
Returns a pointer to the applied material, or NULL if there is no material applied. | |
Mat4D const | getNodeFrame () |
Returns the coordinate frame of the node itself. | |
Mat4D const | getNodeFrameInv () |
Returns the inverse of the matrix returned by get_node_frame(). | |
Mat4D const | getNodeFrameInvPtr () |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix. | |
Mat4D const | getNodeFramePtr () |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix. | |
Mat4D const | getNodeToVertex () |
Returns the transformation matrix suitable for converting vertices in the coordinate space of the node to the appropriate coordinate space for storing in the egg file. | |
Mat4D const | getNodeToVertexPtr () |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix. | |
Vec3D const | getNormal () |
int | getNumComponents () |
Returns the number of individual component triangles within the composite. | |
int | getNumTextures () |
Returns the number of textures applied to the primitive. | |
int | getNumVertices () |
EggGroupNode | getParent () |
EggVertexPool | getPool () |
Returns the vertex pool associated with the vertices of the primitive, or NULL if the primitive has no vertices. | |
Shading | getShading () |
Returns the shading properties apparent on this particular primitive. | |
string | getSortName () |
Returns the name of the primitive for the purposes of sorting primitives into different groups, if there is one. | |
EggTexture | getTexture () |
Returns the first texture on the primitive, if any, or NULL if there are no textures on the primitive. | |
EggTexture | getTexture (int n) |
Returns the nth texture that has been applied to the primitive. | |
list | getTextures () |
EggUserData | getUserData () |
Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored. | |
EggUserData | getUserData (TypeHandle type) |
Returns the user data pointer of the indicated type, if it exists, or NULL if it does not. | |
EggVertex | getVertex (int index) |
Returns a particular index based on its index number. | |
Mat4D const | getVertexFrame () |
Returns the coordinate frame of the vertices referenced by primitives at or under this node. | |
Mat4D const | getVertexFrameInv () |
Returns the inverse of the matrix returned by get_vertex_frame(). | |
Mat4D const | getVertexFrameInvPtr () |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix. | |
Mat4D const | getVertexFramePtr () |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix. | |
Mat4D const | getVertexToNode () |
Returns the transformation matrix suitable for converting the vertices as read from the egg file into the coordinate space of the node. | |
Mat4D const | getVertexToNodePtr () |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix. | |
list | getVertices () |
VisibilityMode | getVisibilityMode () |
Returns the visibility mode that was set, or VM_unspecified if nothing was set. | |
bool | hasBin () |
Returns true if a bin name has been set for this particular object. | |
bool | hasColor () |
bool | hasDepthOffset () |
Returns true if the depth-offset flag has been set for this particular object. | |
bool | hasDrawOrder () |
Returns true if the draw-order flag has been set for this particular object. | |
bool | hasMaterial () |
Returns true if the primitive is materiald (and get_material() will return a real pointer), false otherwise (and get_material() will return NULL). | |
bool | hasNormal () |
bool | hasNormals () |
Returns true if any of the primitives (e.g. | |
bool | hasPrimitives () |
Returns true if there are any primitives (e.g. | |
bool | hasTexture () |
Returns true if the primitive has any textures specified, false otherwise. | |
bool | hasTexture (EggTexture texture) |
Returns true if the primitive has the particular indicated texture, false otherwise. | |
bool | hasUserData () |
Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise. | |
bool | hasUserData (TypeHandle type) |
Returns true if the user data pointer of the indicated type has been set, false otherwise. | |
bool | hasVertexColor () |
Returns true if any vertex on the primitive has a specific color set, false otherwise. | |
bool | hasVertexNormal () |
Returns true if any vertex on the primitive has a specific normal set, false otherwise. | |
bool | isAnimMatrix () |
Returns true if this node represents a table of animation transformation data, false otherwise. | |
bool | isJoint () |
Returns true if this particular node represents a <Joint> entry or not. | |
bool | isLocalCoord () |
Returns true if this node's vertices are not in the global coordinate space. | |
bool | isUnderInstance () |
Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise. | |
bool | isUnderTransform () |
Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, false otherwise. | |
bool | jointHasPrimitives () |
Returns true if there are any primitives (e.g. | |
bool | matchesColor (EggAttributes const other) |
Returns true if this color matches that of the other EggAttributes object, include the morph list. | |
bool | matchesNormal (EggAttributes const other) |
Returns true if this normal matches that of the other EggAttributes object, include the morph list. | |
bool | operator!= (EggRenderMode const other) |
bool | operator< (EggRenderMode const other) |
EggTriangleStrip | operator= (EggTriangleStrip const copy) |
bool | operator== (EggRenderMode const other) |
output (ostream out) | |
bool | parseEgg (string egg_syntax) |
Parses the egg syntax given in the indicate string as if it had been read from the egg file within this object's definition. | |
postApplyFlatAttribute () | |
Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices of the primitive, if they don't already have an attribute set, just so they end up with *something*. | |
removeDoubledVerts (bool closed) | |
Certain kinds of primitives, particularly polygons, don't like to have the same vertex repeated consecutively. | |
removeNonuniqueVerts () | |
Removes any multiple appearances of the same vertex from the primitive. | |
EggVertex | removeVertex (EggVertex vertex) |
Removes the indicated vertex from the primitive and returns it. | |
int | renameNode (vectorbasic_stringchar strip_prefix) |
Rename by stripping out the prefix. | |
reverseVertexOrdering () | |
Reverses the ordering of the vertices in this primitive, if appropriate, in order to change the direction the polygon appears to be facing. | |
setAlphaMode (AlphaMode mode) | |
Specifies precisely how the transparency for this geometry should be achieved, or if it should be used. | |
setBfaceFlag (bool flag) | |
Sets the backfacing flag of the polygon. | |
setBin (string bin) | |
Sets the "bin" string for this particular object. | |
setColor (VBase4 const Color) | |
setComponent (int i, EggAttributes const attrib) | |
Changes the attributes for the nth component triangle. | |
setDepthOffset (int bias) | |
Sets the "depth-offset" flag associated with this object. | |
setDepthTestMode (DepthTestMode mode) | |
Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer). | |
setDepthWriteMode (DepthWriteMode mode) | |
Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry. | |
setDrawOrder (int order) | |
Sets the "draw-order" flag associated with this object. | |
setMaterial (EggMaterial material) | |
Applies the indicated material to the primitive. | |
setNormal (Vec3D const normal) | |
setTexture (EggTexture texture) | |
Replaces the current list of textures with the indicated texture. | |
setUserData (EggUserData user_data) | |
Sets the user data associated with this object. | |
setVertex (int index, EggVertex vertex) | |
Replaces a particular vertex based on its index number in the list of vertices. | |
setVisibilityMode (VisibilityMode mode) | |
Specifies whether this geometry is to be considered normally visible, or hidden. | |
bool | sortsLessThan (EggAttributes const other) |
An ordering operator to compare two vertices for sorting order. | |
testUnderIntegrity () | |
Recursively checks the integrity of the _under_flags, _parent, and _depth members of this node and all of its ancestors. | |
testVrefIntegrity () | |
Verifies that each vertex in the primitive exists and that it knows it is referenced by the primitive. | |
transform (Mat4D const mat) | |
Applies the indicated transformation matrix to the attributes. | |
transform (Mat4D const mat) | |
Applies the indicated transformation to the node and all of its descendants. | |
transformVerticesOnly (Mat4D const mat) | |
Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below. | |
EggCompositePrimitive | triangulateInPlace () |
Subdivides the composite primitive into triangles and adds those triangles to the parent group node in place of the original primitive. | |
bool | triangulateInto (EggGroupNode container) |
Subdivides the composite primitive into triangles and adds those triangles to the indicated container. | |
unifyAttributes (Shading shading) | |
If the shading property is S_per_vertex, ensures that all vertices have a normal and a color, and the overall primitive does not. | |
write (ostream out, int indent_level) | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static AlphaMode | stringAlphaMode (string string) |
Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value. | |
static DepthTestMode | stringDepthTestMode (string string) |
Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value. | |
static DepthWriteMode | stringDepthWriteMode (string string) |
Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value. | |
static VisibilityMode | stringVisibilityMode (string string) |
Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value. |
A connected strip of triangles.
This does not normally appear in an egg file; it is typically generated as a result of meshing.
enum AlphaMode [inherited] |
enum DepthTestMode [inherited] |
enum DepthWriteMode [inherited] |
enum Shading [inherited] |
enum VisibilityMode [inherited] |
EggTriangleStrip | ( | EggTriangleStrip const | copy | ) |
EggTriangleStrip | ( | string | name | ) |
EggTriangleStrip | ( | ) |
addTexture | ( | EggTexture | texture | ) | [inherited] |
Applies the indicated texture to the primitive.
Note that, in the case of multiple textures being applied to a single primitive, the order in which the textures are applied does not affect the rendering order; use EggTexture.set_sort() to specify that.
Adds the indicated vertex to the end of the primitive's list of vertices, and returns it.
applyFirstAttribute | ( | ) | [inherited] |
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
This reflects the DirectX convention of storing flat-shaded properties on the first vertex, although it is not usually a convention in Egg.
This may introduce redundant vertices to the vertex pool.
applyLastAttribute | ( | ) | [inherited] |
Sets the last vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
This reflects the OpenGL convention of storing flat-shaded properties on the last vertex, although it is not usually a convention in Egg.
This may introduce redundant vertices to the vertex pool.
applyTexmats | ( | ) | [inherited] |
Applies the texture matrices to the UV's of the vertices that reference them, and then removes the texture matrices from the textures themselves.
bool cleanup | ( | ) | [inherited] |
Cleans up modeling errors in whatever context this makes sense.
For instance, for a polygon, this calls remove_doubled_verts(true). For a point, it calls remove_nonunique_verts(). Returns true if the primitive is valid, or false if it is degenerate.
clear | ( | ) | [inherited] |
Removes all of the vertices from the primitive.
clearBin | ( | ) | [inherited] |
Removes the bin name that was set for this particular object.
See set_bin().
clearColor | ( | ) | [inherited] |
clearConnectedShading | ( | ) | [inherited] |
Resets the connected_shading member in this primitive, so that get_connected_shading() will recompute a new value.
clearDepthOffset | ( | ) | [inherited] |
Removes the depth-offset flag from this particular object.
See set_depth_offset().
clearDrawOrder | ( | ) | [inherited] |
Removes the draw-order flag from this particular object.
See set_draw_order().
clearMaterial | ( | ) | [inherited] |
Removes any material from the primitive.
clearNormal | ( | ) | [inherited] |
clearTexture | ( | ) | [inherited] |
Removes any texturing from the primitive.
clearUserData | ( | ) | [inherited] |
Removes *all* user data pointers from the node.
clearUserData | ( | TypeHandle | type | ) | [inherited] |
Removes the user data pointer of the indicated type.
int compareTo | ( | EggAttributes const | other | ) | [inherited] |
An ordering operator to compare two vertices for sorting order.
This imposes an arbitrary ordering useful to identify unique vertices.
copyAttributes | ( | EggPrimitive const | other | ) | [inherited] |
Copies the rendering attributes from the indicated primitive.
copyAttributes | ( | EggAttributes const | other | ) | [inherited] |
Copies the rendering attributes from the indicated primitive.
copyColor | ( | EggAttributes const | other | ) | [inherited] |
Sets this color to be the same as the other's, include morphs.
If the other has no color, this clears the color.
copyNormal | ( | EggAttributes const | other | ) | [inherited] |
Sets this normal to be the same as the other's, include morphs.
If the other has no normal, this clears the normal.
copyVertices | ( | EggPrimitive const | other | ) | [inherited] |
Replaces the current primitive's list of vertices with a copy of the list of vertices on the other primitive.
EggRenderMode determineAlphaMode | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has an alpha_mode other than AM_unspecified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
EggRenderMode determineBin | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a bin specified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
bool determineDecal | ( | ) | [inherited] |
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 in EggGroup.
EggRenderMode determineDepthOffset | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a depth_offset specified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
EggRenderMode determineDepthTestMode | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node 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.
EggRenderMode determineDepthWriteMode | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node 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.
EggRenderMode determineDrawOrder | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a draw_order specified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
bool determineIndexed | ( | ) | [inherited] |
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 in EggGroup.
EggRenderMode determineVisibilityMode | ( | ) | [inherited] |
Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a visibility_mode other than VM_unspecified.
Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.
Reimplemented from EggNode.
flattenTransforms | ( | ) | [inherited] |
Removes any transform and instance records from this node in the scene graph and below.
If an instance node is encountered, removes the instance and applies the transform to its vertices, duplicating vertices if necessary.
Since this function may result in duplicated vertices, it may be a good idea to call remove_unused_vertices() after calling this.
AlphaMode getAlphaMode | ( | ) | [inherited] |
Returns the alpha mode that was set, or AM_unspecified if nothing was set.
See set_alpha_mode().
bool getBfaceFlag | ( | ) | [inherited] |
Retrieves the backfacing flag of the polygon.
See set_bface_flag().
string getBin | ( | ) | [inherited] |
Returns the bin name that has been set for this particular object, if any.
See set_bin().
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from EggCompositePrimitive.
VBase4 getColor | ( | ) | [inherited] |
Returns the color set on this particular attribute.
If there is no color set, returns white.
EggAttributes const getComponent | ( | int | i | ) | [inherited] |
Returns the attributes for the nth component triangle.
EggAttributes getComponent | ( | int | i | ) | [inherited] |
Returns the attributes for the nth component triangle.
list getComponents | ( | ) | [inherited] |
Shading getConnectedShading | ( | ) | [inherited] |
Determines what sort of shading properties this primitive's connected neighbors have.
To get the most accurate results, you should first call clear_connected_shading() on all connected primitives (or on all primitives in the egg file). It might also be a good idea to call remove_unused_vertices() to ensure proper connectivity.
You may find it easiest to call these other methods on the EggData root node (they are defined on EggGroupNode).
int getDepth | ( | ) | [inherited] |
Returns the number of nodes above this node in the egg hierarchy.
int getDepthOffset | ( | ) | [inherited] |
Returns the "depth-offset" flag as set for this particular object.
See set_depth_offset().
DepthTestMode getDepthTestMode | ( | ) | [inherited] |
Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.
See set_depth_test_mode().
DepthWriteMode getDepthWriteMode | ( | ) | [inherited] |
Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.
See set_depth_write_mode().
int getDrawOrder | ( | ) | [inherited] |
Returns the "draw-order" flag as set for this particular object.
See set_draw_order().
EggMaterial getMaterial | ( | ) | [inherited] |
Returns a pointer to the applied material, or NULL if there is no material applied.
Mat4D const getNodeFrame | ( | ) | [inherited] |
Returns the coordinate frame of the node itself.
This is simply the net product of all transformations up to the root.
Mat4D const getNodeFrameInv | ( | ) | [inherited] |
Returns the inverse of the matrix returned by get_node_frame().
See get_node_frame().
Mat4D const getNodeFrameInvPtr | ( | ) | [inherited] |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix.
Mat4D const getNodeFramePtr | ( | ) | [inherited] |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix.
Mat4D const getNodeToVertex | ( | ) | [inherited] |
Returns the transformation matrix suitable for converting vertices in the coordinate space of the node to the appropriate coordinate space for storing in the egg file.
This is the same thing as:
get_node_frame() * get_vertex_frame_inv()
Mat4D const getNodeToVertexPtr | ( | ) | [inherited] |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix.
Vec3D const getNormal | ( | ) | [inherited] |
int getNumComponents | ( | ) | [inherited] |
Returns the number of individual component triangles within the composite.
Each one of these might have a different set of attributes.
int getNumTextures | ( | ) | [inherited] |
Returns the number of textures applied to the primitive.
int getNumVertices | ( | ) | [inherited] |
EggGroupNode getParent | ( | ) | [inherited] |
EggVertexPool getPool | ( | ) | [inherited] |
Returns the vertex pool associated with the vertices of the primitive, or NULL if the primitive has no vertices.
Shading getShading | ( | ) | [inherited] |
Returns the shading properties apparent on this particular primitive.
This returns S_per_vertex if the vertices have colors or normals (and they are not all the same values), or for a simple primitive, S_overall otherwise. A composite primitive may also return S_per_face if the individual component primitives have colors or normals that are not all the same values.
To get the most accurate results, you should call clear_shading() on all connected primitives (or on all primitives in the egg file), followed by get_shading() on each primitive. You may find it easiest to call these methods on the EggData root node (they are defined on EggGroupNode).
string getSortName | ( | ) | [inherited] |
Returns the name of the primitive for the purposes of sorting primitives into different groups, if there is one.
Presently, this is defined as the primitive name itself, unless it begins with a digit.
EggTexture getTexture | ( | int | n | ) | [inherited] |
Returns the nth texture that has been applied to the primitive.
EggTexture getTexture | ( | ) | [inherited] |
Returns the first texture on the primitive, if any, or NULL if there are no textures on the primitive.
This method is deprecated and is used in support of single-texturing only. New code should be written to use the multitexture variants instead.
list getTextures | ( | ) | [inherited] |
EggUserData getUserData | ( | ) | [inherited] |
Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.
EggUserData getUserData | ( | TypeHandle | type | ) | [inherited] |
Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.
EggVertex getVertex | ( | int | index | ) | [inherited] |
Returns a particular index based on its index number.
Mat4D const getVertexFrame | ( | ) | [inherited] |
Returns the coordinate frame of the vertices referenced by primitives at or under this node.
This is not the same as get_node_frame().
Generally, vertices in an egg file are stored in the global coordinate space, regardless of the transforms defined at each node. Thus, get_vertex_frame() will usually return the identity transform (global coordinate space). However, primitives under an <Instance> entry reference their vertices in the coordinate system under effect at the time of the <Instance>. Thus, nodes under an <Instance> entry may return this non-identity matrix.
Specifically, this may return a non-identity matrix only if is_local_coord() is true.
Mat4D const getVertexFrameInv | ( | ) | [inherited] |
Returns the inverse of the matrix returned by get_vertex_frame().
See get_vertex_frame().
Mat4D const getVertexFrameInvPtr | ( | ) | [inherited] |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix.
Mat4D const getVertexFramePtr | ( | ) | [inherited] |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix.
Mat4D const getVertexToNode | ( | ) | [inherited] |
Returns the transformation matrix suitable for converting the vertices as read from the egg file into the coordinate space of the node.
This is the same thing as:
get_vertex_frame() * get_node_frame_inv()
Mat4D const getVertexToNodePtr | ( | ) | [inherited] |
Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix.
list getVertices | ( | ) | [inherited] |
VisibilityMode getVisibilityMode | ( | ) | [inherited] |
Returns the visibility mode that was set, or VM_unspecified if nothing was set.
See set_visibility_mode().
bool hasBin | ( | ) | [inherited] |
Returns true if a bin name has been set for this particular object.
See set_bin().
bool hasColor | ( | ) | [inherited] |
bool hasDepthOffset | ( | ) | [inherited] |
Returns true if the depth-offset flag has been set for this particular object.
See set_depth_offset().
bool hasDrawOrder | ( | ) | [inherited] |
Returns true if the draw-order flag has been set for this particular object.
See set_draw_order().
bool hasMaterial | ( | ) | [inherited] |
Returns true if the primitive is materiald (and get_material() will return a real pointer), false otherwise (and get_material() will return NULL).
bool hasNormal | ( | ) | [inherited] |
bool hasNormals | ( | ) | [inherited] |
Returns true if any of the primitives (e.g.
polygons) defined within this group or below have either face or vertex normals defined, false otherwise.
bool hasPrimitives | ( | ) | [inherited] |
Returns true if there are any primitives (e.g.
polygons) defined within this group or below, false otherwise.
bool hasTexture | ( | ) | [inherited] |
Returns true if the primitive has any textures specified, false otherwise.
This method is deprecated and is used in support of single-texturing only. New code should be written to use the multitexture variants instead.
bool hasTexture | ( | EggTexture | texture | ) | [inherited] |
Returns true if the primitive has the particular indicated texture, false otherwise.
bool hasUserData | ( | TypeHandle | type | ) | [inherited] |
Returns true if the user data pointer of the indicated type has been set, false otherwise.
bool hasUserData | ( | ) | [inherited] |
Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.
bool hasVertexColor | ( | ) | [inherited] |
Returns true if any vertex on the primitive has a specific color set, false otherwise.
If you call unify_attributes() first, this will also return false even if all the vertices were set to the same value (since unify_attributes() removes redundant vertex properties).
bool hasVertexNormal | ( | ) | [inherited] |
Returns true if any vertex on the primitive has a specific normal set, false otherwise.
If you call unify_attributes() first, this will also return false even if all the vertices were set to the same value (since unify_attributes() removes redundant vertex properties).
bool isAnimMatrix | ( | ) | [inherited] |
Returns true if this node represents a table of animation transformation data, false otherwise.
bool isJoint | ( | ) | [inherited] |
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 in EggGroup.
bool isLocalCoord | ( | ) | [inherited] |
Returns true if this node's vertices are not in the global coordinate space.
This will be the case if there was an <Instance> node under a transform at or above this node.
bool isUnderInstance | ( | ) | [inherited] |
Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise.
bool isUnderTransform | ( | ) | [inherited] |
Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, false otherwise.
bool jointHasPrimitives | ( | ) | [inherited] |
Returns true if there are any primitives (e.g.
polygons) defined within this group or below, but the search does not include nested joints.
bool matchesColor | ( | EggAttributes const | other | ) | [inherited] |
Returns true if this color matches that of the other EggAttributes object, include the morph list.
bool matchesNormal | ( | EggAttributes const | other | ) | [inherited] |
Returns true if this normal matches that of the other EggAttributes object, include the morph list.
bool operator!= | ( | EggRenderMode const | other | ) | [inherited] |
bool operator< | ( | EggRenderMode const | other | ) | [inherited] |
EggTriangleStrip operator= | ( | EggTriangleStrip const | copy | ) |
bool operator== | ( | EggRenderMode const | other | ) | [inherited] |
output | ( | ostream | out | ) | [inherited] |
bool parseEgg | ( | string | egg_syntax | ) | [inherited] |
Parses the egg syntax given in the indicate string as if it had been read from the egg file within this object's definition.
Updates the object accordingly. Returns true if successful, false if there was some parse error or if the object does not support this functionality.
postApplyFlatAttribute | ( | ) | [inherited] |
Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices of the primitive, if they don't already have an attribute set, just so they end up with *something*.
removeDoubledVerts | ( | bool | closed | ) | [inherited] |
Certain kinds of primitives, particularly polygons, don't like to have the same vertex repeated consecutively.
Unfortunately, some modeling programs (like MultiGen) make this an easy mistake to make.
It's handy to have a function to remove these redundant vertices. If closed is true, it also checks that the first and last vertices are not the same.
This function identifies repeated vertices by position only; it does not consider any other properties, such as color or UV, significant in differentiating vertices.
removeNonuniqueVerts | ( | ) | [inherited] |
Removes any multiple appearances of the same vertex from the primitive.
This primarily makes sense for a point primitive, which is really a collection of points and which doesn't make sense to include the same point twice, in any order.
Removes the indicated vertex from the primitive and returns it.
If the vertex was not already in the primitive, does nothing and returns NULL.
int renameNode | ( | vectorbasic_stringchar | strip_prefix | ) | [inherited] |
Rename by stripping out the prefix.
reverseVertexOrdering | ( | ) | [inherited] |
Reverses the ordering of the vertices in this primitive, if appropriate, in order to change the direction the polygon appears to be facing.
Does not adjust the surface normal, if any.
setAlphaMode | ( | AlphaMode | mode | ) | [inherited] |
Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.
The default, AM_unspecified, is to use transparency if the geometry has a color whose alpha value is non-1, or if it has a four-channel texture applied; otherwise, AM_on forces transparency on, and AM_off forces it off. The other flavors of transparency are specific ways to turn on transparency, which may or may not be supported by a particular rendering backend.
setBfaceFlag | ( | bool | flag | ) | [inherited] |
Sets the backfacing flag of the polygon.
If this is true, the polygon will be rendered so that both faces are visible; if it is false, only the front face of the polygon will be visible.
setBin | ( | string | bin | ) | [inherited] |
Sets the "bin" string for this particular object.
This names a particular bin in which the object should be rendered. The exact meaning of a bin is implementation defined, but generally a GeomBin matching each bin name must also be specifically added to the rendering engine (e.g. the CullTraverser) in use for this to work. See also set_draw_order().
setColor | ( | VBase4 const | Color | ) | [inherited] |
setComponent | ( | int | i, |
EggAttributes const | attrib | ||
) | [inherited] |
Changes the attributes for the nth component triangle.
setDepthOffset | ( | int | bias | ) | [inherited] |
Sets the "depth-offset" flag associated with this object.
This adds or subtracts an offset bias into the depth buffer. See also DepthOffsetAttrib and NodePath.set_depth_offset().
setDepthTestMode | ( | DepthTestMode | mode | ) | [inherited] |
Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).
Note that this is different, and independent from, the depth_write mode.
setDepthWriteMode | ( | DepthWriteMode | mode | ) | [inherited] |
Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.
setDrawOrder | ( | int | order | ) | [inherited] |
Sets the "draw-order" flag associated with this object.
This specifies a particular order in which objects of this type should be drawn, within the specified bin. If a bin is not explicitly specified, "fixed" is used. See also set_bin().
setMaterial | ( | EggMaterial | material | ) | [inherited] |
Applies the indicated material to the primitive.
setNormal | ( | Vec3D const | normal | ) | [inherited] |
setTexture | ( | EggTexture | texture | ) | [inherited] |
Replaces the current list of textures with the indicated texture.
This method is deprecated and is used in support of single-texturing only. Please use the multitexture variant add_texture instead.
setUserData | ( | EggUserData | user_data | ) | [inherited] |
Sets the user data associated with this object.
This may be any EggUserData-derived object. The egg library will do nothing with this pointer, except to hold its reference count and return the pointer on request.
The EggObject maintains multiple different EggUserData pointers, one for each unique type (as reported by get_type()). If you know that only one type of EggUserData object will be added in your application, you may use the query functions that accept no parameters, but it is recommended that in general you pass in the type of your particular user data, to allow multiple applications to coexist in the same egg data.
This pointer is also copied by the copy assignment operator and copy constructor.
setVertex | ( | int | index, |
EggVertex | vertex | ||
) | [inherited] |
Replaces a particular vertex based on its index number in the list of vertices.
This is just a convenience function for people who don't want to mess with the iterators.
setVisibilityMode | ( | VisibilityMode | mode | ) | [inherited] |
Specifies whether this geometry is to be considered normally visible, or hidden.
If it is hidden, it is either not loaded into the scene graph at all, or loaded as a "stashed" node, according to the setting of egg-suppress-hidden.
bool sortsLessThan | ( | EggAttributes const | other | ) | [inherited] |
An ordering operator to compare two vertices for sorting order.
This imposes an arbitrary ordering useful to identify unique vertices.
Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.
static DepthTestMode stringDepthTestMode | ( | string | string | ) | [static, inherited] |
Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value.
static DepthWriteMode stringDepthWriteMode | ( | string | string | ) | [static, inherited] |
Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.
static VisibilityMode stringVisibilityMode | ( | string | string | ) | [static, inherited] |
Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value.
testUnderIntegrity | ( | ) | [inherited] |
Recursively checks the integrity of the _under_flags, _parent, and _depth members of this node and all of its ancestors.
testVrefIntegrity | ( | ) | [inherited] |
Verifies that each vertex in the primitive exists and that it knows it is referenced by the primitive.
transform | ( | Mat4D const | mat | ) | [inherited] |
Applies the indicated transformation matrix to the attributes.
Reimplemented in EggVertex.
transform | ( | Mat4D const | mat | ) | [inherited] |
Applies the indicated transformation to the node and all of its descendants.
Reimplemented in EggVertexPool.
transformVerticesOnly | ( | Mat4D const | mat | ) | [inherited] |
Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below.
Joints and other transforms are not affected, nor are local vertices.
EggCompositePrimitive triangulateInPlace | ( | ) | [inherited] |
Subdivides the composite primitive into triangles and adds those triangles to the parent group node in place of the original primitive.
Returns a pointer to the original primitive, which is likely about to be destructed.
If convex_also is true, both concave and convex polygons will be subdivided into triangles; otherwise, only concave polygons will be subdivided, and convex polygons will be copied unchanged into the container.
bool triangulateInto | ( | EggGroupNode | container | ) | [inherited] |
Subdivides the composite primitive into triangles and adds those triangles to the indicated container.
Does not remove the primitive from its existing parent or modify it in any way.
Returns true if the triangulation is successful, or false if there was some error (in which case the container may contain some partial triangulation).
unifyAttributes | ( | Shading | shading | ) | [inherited] |
If the shading property is S_per_vertex, ensures that all vertices have a normal and a color, and the overall primitive does not.
If the shading property is S_per_face, and this is a composite primitive, ensures that all components have a normal and a color, and the vertices and overall primitive do not. (If this is a simple primitive, S_per_face works the same as S_overall, below).
If the shading property is S_overall, ensures that no vertices or components have a normal or a color, and the overall primitive does (if any exists at all).
After this call, either the primitive will have normals or its vertices will, but not both. Ditto for colors.
This may create redundant vertices in the vertex pool.
write | ( | ostream | out, |
int | indent_level | ||
) | [inherited] |
Reimplemented from EggNode.