Panda3D
Public Types | Public Member Functions | Static Public Member Functions | List of all members
EggTexture Class Reference

Defines a texture map that may be applied to geometry. More...

Inheritance diagram for EggTexture:
EggFilenameNode EggRenderMode EggTransform EggNode EggNamedObject EggObject Namable TypedReferenceCount MemoryBase TypedObject ReferenceCount MemoryBase MemoryBase

Public Types

enum  CombineChannel { CC_rgb = 0, CC_alpha = 1, CC_num_channels = 2 }
 
enum  CombineIndex { CI_num_indices = 3 }
 
enum  CombineMode {
  CM_unspecified = 0, CM_replace = 1, CM_modulate = 2, CM_add = 3,
  CM_add_signed = 4, CM_interpolate = 5, CM_subtract = 6, CM_dot3_rgb = 7,
  CM_dot3_rgba = 8
}
 
enum  CombineOperand {
  CO_unspecified = 0, CO_src_color = 1, CO_one_minus_src_color = 2, CO_src_alpha = 3,
  CO_one_minus_src_alpha = 4
}
 
enum  CombineSource {
  CS_unspecified = 0, CS_texture = 1, CS_constant = 2, CS_primary_color = 3,
  CS_previous = 4, CS_constant_color_scale = 5, CS_last_saved_result = 6
}
 
enum  CompressionMode {
  CM_default = 0, CM_off = 1, CM_on = 2, CM_fxt1 = 3,
  CM_dxt1 = 4, CM_dxt2 = 5, CM_dxt3 = 6, CM_dxt4 = 7,
  CM_dxt5 = 8
}
 
enum  EnvType {
  ET_unspecified = 0, ET_modulate = 1, ET_decal = 2, ET_blend = 3,
  ET_replace = 4, ET_add = 5, ET_blend_color_scale = 6, ET_modulate_glow = 7,
  ET_modulate_gloss = 8, ET_normal = 9, ET_normal_height = 10, ET_glow = 11,
  ET_gloss = 12, ET_height = 13, ET_selector = 14, ET_normal_gloss = 15
}
 
enum  Equivalence {
  E_basename = 1, E_extension = 2, E_dirname = 4, E_complete_filename = 7,
  E_transform = 8, E_attributes = 16, E_tref_name = 32
}
 
enum  FilterType {
  FT_unspecified = 0, FT_nearest = 1, FT_linear = 2, FT_nearest_mipmap_nearest = 3,
  FT_linear_mipmap_nearest = 4, FT_nearest_mipmap_linear = 5, FT_linear_mipmap_linear = 6
}
 
enum  Format {
  F_unspecified = 0, F_rgba = 1, F_rgbm = 2, F_rgba12 = 3,
  F_rgba8 = 4, F_rgba4 = 5, F_rgba5 = 6, F_rgb = 7,
  F_rgb12 = 8, F_rgb8 = 9, F_rgb5 = 10, F_rgb332 = 11,
  F_red = 12, F_green = 13, F_blue = 14, F_alpha = 15,
  F_luminance = 16, F_luminance_alpha = 17, F_luminance_alphamask = 18
}
 
enum  QualityLevel {
  QL_unspecified = 0, QL_default = 1, QL_fastest = 2, QL_normal = 3,
  QL_best = 4
}
 
enum  TexGen {
  TG_unspecified = 0, TG_eye_sphere_map = 1, TG_world_cube_map = 2, TG_eye_cube_map = 3,
  TG_world_normal = 4, TG_eye_normal = 5, TG_world_position = 6, TG_eye_position = 7,
  TG_point_sprite = 8
}
 
enum  TextureType {
  TT_unspecified = 0, TT_1d_texture = 1, TT_2d_texture = 2, TT_3d_texture = 3,
  TT_cube_map = 4
}
 
enum  WrapMode {
  WM_unspecified = 0, WM_clamp = 1, WM_repeat = 2, WM_mirror = 3,
  WM_mirror_once = 4, WM_border_color = 5
}
 
- Public Types inherited from EggRenderMode
enum  AlphaMode {
  AM_unspecified = 0, AM_off = 1, AM_on = 2, AM_blend = 3,
  AM_blend_no_occlude = 4, AM_ms = 5, AM_ms_mask = 6, AM_binary = 7,
  AM_dual = 8
}
 Specifies implementation of transparency. More...
 
enum  DepthTestMode { DTM_unspecified = 0, DTM_off = 1, DTM_on = 2 }
 
enum  DepthWriteMode { DWM_unspecified = 0, DWM_off = 1, DWM_on = 2 }
 
enum  VisibilityMode { VM_unspecified = 0, VM_hidden = 1, VM_normal = 2 }
 
- Public Types inherited from EggTransform
enum  ComponentType {
  CT_invalid = 0, CT_translate2d = 1, CT_translate3d = 2, CT_rotate2d = 3,
  CT_rotx = 4, CT_roty = 5, CT_rotz = 6, CT_rotate3d = 7,
  CT_scale2d = 8, CT_scale3d = 9, CT_uniform_scale = 10, CT_matrix3 = 11,
  CT_matrix4 = 12
}
 

Public Member Functions

 __init__ (const EggTexture copy)
 
 __init__ (str tref_name, const Filename filename)
 
bool affectsPolygonAlpha ()
 Returns true if this texture's environment type or combine mode allows the texture to have an effect on the polygon's alpha values, false otherwise. More...
 
 clearAlphaFileChannel ()
 Removes the specification of a particular channel to use from the alpha-file image. More...
 
 clearAlphaFilename ()
 
 clearAlphaScale ()
 Removes the alpha_scale from the texture and restores it to the default value of 1. More...
 
 clearAnisotropicDegree ()
 Removes the specification of anisotropic filtering from the texture. More...
 
 clearBorderColor ()
 
 clearColor ()
 
 clearMultitexture ()
 Resets the multitexture flags set by multitexture_over(). After this call, get_multitexture() will return false, and get_multitexture_sort() will return 0. More...
 
 clearNumViews ()
 Removes the specification of the number of views for a 3-D multiview texture. More...
 
 clearPriority ()
 Removes the specification of multitexture priority from the texture. The default priority value is 0. More...
 
 clearRgbScale ()
 Removes the rgb_scale from the texture and restores it to the default value of 1. More...
 
 clearStageName ()
 Removes the named TextureStage specification. More...
 
 clearUvName ()
 Removes the restriction to a particular named set of texture coordinates and restores the texture to using the default texture coordinates. More...
 
EggTexture::WrapMode determineWrapU ()
 Determines the appropriate wrap in the U direction. This is different from get_wrap_u() in that if the U wrap is unspecified, it returns the overall wrap value. More...
 
EggTexture::WrapMode determineWrapV ()
 Determines the appropriate wrap in the V direction. This is different from get_wrap_v() in that if the V wrap is unspecified, it returns the overall wrap value. More...
 
EggTexture::WrapMode determineWrapW ()
 Determines the appropriate wrap in the W direction. This is different from get_wrap_w() in that if the W wrap is unspecified, it returns the overall wrap value. More...
 
int getAlphaFileChannel ()
 Returns the particular channel that has been specified for the alpha-file image, or 0 if no channel has been specified. See set_alpha_file_channel(). More...
 
const Filename getAlphaFilename ()
 Returns the separate file assigned for the alpha channel. It is an error to call this unless has_alpha_filename() returns true. See set_alpha_filename(). More...
 
const Filename getAlphaFullpath ()
 Returns the full pathname to the alpha file, if it is known; otherwise, returns the same thing as get_alpha_filename(). More...
 
int getAlphaScale ()
 Returns the alpha_scale value that has been specified for the texture, or 1 if no alpha_scale value has been specified. More...
 
int getAnisotropicDegree ()
 Returns the anisotropic filtering degree that has been specified for this texture, or 0 if nothing has been specified. More...
 
const LColor getBorderColor ()
 Returns the border color if one has been specified, or (0, 0, 0, 1) otherwise. More...
 
const LColor getColor ()
 Returns the blend color if one has been specified, or (0, 0, 0, 1) otherwise. More...
 
EggTexture::CombineMode getCombineMode (EggTexture::CombineChannel channel)
 
EggTexture::CombineOperand getCombineOperand (EggTexture::CombineChannel channel, int n)
 
EggTexture::CombineSource getCombineSource (EggTexture::CombineChannel channel, int n)
 
EggTexture::CompressionMode getCompressionMode ()
 
EggTexture::EnvType getEnvType ()
 
EggTexture::Format getFormat ()
 
EggTexture::FilterType getMagfilter ()
 
EggTexture::FilterType getMinfilter ()
 
int getMultitextureSort ()
 Returns an integer that represents the depth to which this texture is layered on all other textures in the egg file. In general, if texture A is layered over texture B, then sort(A) > sort(B). If texture A is never layered over any other texture, then sort(A) == 0. More than that is difficult to guarantee. More...
 
bool getMultiview ()
 Returns the current setting of the multiview flag. See set_multiview(). More...
 
int getNumViews ()
 Returns the specified number of views specified for the 3-D multiview texture. See set_num_views(). More...
 
int getPriority ()
 Returns the multitexture importance value that has been specified for the texture, or 0 if no priority value has been specified. More...
 
EggTexture::QualityLevel getQualityLevel ()
 
bool getReadMipmaps ()
 Returns the current setting of the read_mipmaps flag. See set_read_mipmaps(). More...
 
int getRgbScale ()
 Returns the rgb_scale value that has been specified for the texture, or 1 if no rgb_scale value has been specified. More...
 
bool getSavedResult ()
 Returns the current setting of the saved_result flag. See set_saved_result(). More...
 
str getStageName ()
 Returns the stage name that has been specified for this texture, or the tref name if no texture stage has explicitly been specified. More...
 
EggTexture::TexGen getTexGen ()
 
EggTexture::TextureType getTextureType ()
 
str getUvName ()
 Returns the texcoord name that has been specified for this texture, or the empty string if no texcoord name has explicitly been specified. More...
 
EggTexture::WrapMode getWrapMode ()
 
EggTexture::WrapMode getWrapU ()
 Returns the amount specified for U wrap. This may be unspecified, even if there is an overall wrap value. More...
 
EggTexture::WrapMode getWrapV ()
 Returns the amount specified for V wrap. This may be unspecified, even if there is an overall wrap value. More...
 
EggTexture::WrapMode getWrapW ()
 Returns the amount specified for W wrap. This may be unspecified, even if there is an overall wrap value. More...
 
bool hasAlphaChannel (int num_components)
 Given the number of color components (channels) in the image file as actually read from the disk, return true if this texture seems to have an alpha channel or not. This depends on the EggTexture's format as well as the number of channels. More...
 
bool hasAlphaFileChannel ()
 Returns true if a particular channel has been specified for the alpha-file image, false otherwise. More...
 
bool hasAlphaFilename ()
 Returns true if a separate file for the alpha component has been applied, false otherwise. See set_alpha_filename(). More...
 
bool hasAlphaScale ()
 Returns true if an alpha_scale has been specified for the texture, false otherwise. More...
 
bool hasAnisotropicDegree ()
 Returns true if a value for the anisotropic filtering degree has been specified for this texture, false otherwise. More...
 
bool hasBorderColor ()
 Returns true if a border color has been specified for the texture. More...
 
bool hasColor ()
 Returns true if a blend color has been specified for the texture. More...
 
bool hasNumViews ()
 Returns true if the number of views has been specified for the 3-D multiview texture, false otherwise. More...
 
bool hasPriority ()
 Returns true if a priority value for multitexture importance has been specified for the texture, false otherwise. More...
 
bool hasRgbScale ()
 Returns true if an rgb_scale has been specified for the texture, false otherwise. More...
 
bool hasStageName ()
 Returns true if a stage name has been explicitly specified for this texture, false otherwise. More...
 
bool hasUvName ()
 Returns true if a texcoord name has been explicitly specified for this texture, false otherwise. More...
 
bool isEquivalentTo (const EggTexture other, int eq)
 Returns true if the two textures are equivalent in all relevant properties (according to eq), false otherwise. More...
 
bool multitextureOver (EggTexture other)
 Indicates that this texture should be layered on top of the other texture. This will guarantee that this->get_multitexture_sort() > other->get_multitexture_sort(), at least until clear_multitexture() is called on either one. More...
 
EggTexture operator= (const EggTexture copy)
 
 setAlphaFileChannel (int alpha_file_channel)
 If a separate alpha-file is specified, this indicates which channel number should be extracted from this file to derive the alpha channel for the final image. The default is 0, which means the grayscale combination of r, g, b. Otherwise, this should be the 1-based channel number, for instance 1, 2, or 3 for r, g, or b, respectively, or 4 for the alpha channel of a four-component image. More...
 
 setAlphaFilename (const Filename filename)
 Specifies a separate file that will be loaded in with the 1- or 3-component texture and applied as the alpha channel. This is useful when loading textures from file formats that do not support alpha, for instance jpg. More...
 
 setAlphaFullpath (const Filename fullpath)
 Records the full pathname to the file, for the benefit of get_alpha_fullpath(). More...
 
 setAlphaScale (int alpha_scale)
 Sets an additional factor that will scale the alpha component after the texture has been applied. This is used only when a combine mode is in effect. More...
 
 setAnisotropicDegree (int anisotropic_degree)
 Sets the degree of anisotropic filtering for this texture. 1 is off; higher levels indicate filtering in effect. More...
 
 setBorderColor (const LColor border_color)
 
 setColor (const LColor color)
 
 setCombineMode (EggTexture::CombineChannel channel, EggTexture::CombineMode cm)
 
 setCombineOperand (EggTexture::CombineChannel channel, int n, EggTexture::CombineOperand co)
 
 setCombineSource (EggTexture::CombineChannel channel, int n, EggTexture::CombineSource cs)
 
 setCompressionMode (EggTexture::CompressionMode mode)
 
 setEnvType (EggTexture::EnvType type)
 
 setFormat (EggTexture::Format format)
 
 setMagfilter (EggTexture::FilterType type)
 
 setMinfilter (EggTexture::FilterType type)
 
 setMultiview (bool multiview)
 Sets the multiview flag. More...
 
 setNumViews (int num_views)
 When loading a 3-D multiview texture, this parameter is necessary to specify how many views will be expected. The z size is determined implicitly from the number of images loaded. More...
 
 setPriority (int priority)
 Sets the importance of this texture with respect to other textures also applied on the same geometry. This is only meaningful in the presence of multitexturing. More...
 
 setQualityLevel (EggTexture::QualityLevel quality_level)
 
 setReadMipmaps (bool read_mipmaps)
 Sets the read_mipmaps flag. More...
 
 setRgbScale (int rgb_scale)
 Sets an additional factor that will scale all three r, g, b components after the texture has been applied. This is used only when a combine mode is in effect. More...
 
 setSavedResult (bool saved_result)
 Sets the saved_result flag. When this is true, the output of this stage is not part of the normal pipeline–that is, it will not be supplied as the "previous" source for the next texture stage–but it will instead be supplied as the "last_saved_result" source for any future stages, until the next TextureStage with a saved_result set true is encountered. More...
 
 setStageName (str stage_name)
 Specifies the particular TextureStage this texture will be rendered on by name. If this is omitted, the texture will be rendered on the default TextureStage, unless some other stage-specific property is specificied, in which case the texture will be rendered on a TextureStage with the same name as the tref. This is in support of multitexturing. More...
 
 setTexGen (EggTexture::TexGen tex_gen)
 
 setTextureType (EggTexture::TextureType texture_type)
 
 setUvName (str uv_name)
 Specifies the named set of texture coordinates that this texture will use when it is applied to geometry. Geometry may have multiple sets of texture coordinates defined, by name. More...
 
 setWrapMode (EggTexture::WrapMode mode)
 
 setWrapU (EggTexture::WrapMode mode)
 
 setWrapV (EggTexture::WrapMode mode)
 
 setWrapW (EggTexture::WrapMode mode)
 
bool sortsLessThan (const EggTexture other, int eq)
 An ordering operator to compare two textures for sorting order. This imposes an arbitrary ordering useful to identify unique textures, according to the indicated Equivalence factor. See is_equivalent_to(). More...
 
 write (Ostream out, int indent_level)
 Writes the texture definition to the indicated output stream in Egg format. More...
 
- Public Member Functions inherited from EggFilenameNode
str getDefaultExtension ()
 Returns the default extension for this filename type. More...
 
const Filename getFilename ()
 Returns a nonmodifiable reference to the filename. More...
 
const Filename getFullpath ()
 Returns the full pathname to the file, if it is known; otherwise, returns the same thing as get_filename(). More...
 
EggFilenameNode operator= (const EggFilenameNode copy)
 
 setFilename (const Filename filename)
 
 setFullpath (const Filename fullpath)
 Records the full pathname to the file, for the benefit of get_fullpath(). More...
 
- Public Member Functions inherited from EggNode
 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. More...
 
EggRenderMode determineAlphaMode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has an alpha_mode other than AM_unspecified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
EggRenderMode determineBin ()
 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 bin specified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
bool determineDecal ()
 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. More...
 
EggRenderMode determineDepthOffset ()
 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_offset specified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
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. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
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. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
EggRenderMode determineDrawOrder ()
 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 draw_order specified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
bool determineIndexed ()
 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. More...
 
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. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise. More...
 
 flattenTransforms ()
 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. More...
 
int getDepth ()
 Returns the number of nodes above this node in the egg hierarchy. More...
 
const LMatrix4d getNodeFrame ()
 Returns the coordinate frame of the node itself. This is simply the net product of all transformations up to the root. More...
 
const LMatrix4d getNodeFrameInv ()
 Returns the inverse of the matrix returned by get_node_frame(). See get_node_frame(). More...
 
const LMatrix4d getNodeFrameInvPtr ()
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix. More...
 
const LMatrix4d getNodeFramePtr ()
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix. More...
 
const LMatrix4d 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. This is the same thing as: More...
 
const LMatrix4d getNodeToVertexPtr ()
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix. More...
 
EggGroupNode getParent ()
 
const LMatrix4d getVertexFrame ()
 Returns the coordinate frame of the vertices referenced by primitives at or under this node. This is not the same as get_node_frame(). More...
 
const LMatrix4d getVertexFrameInv ()
 Returns the inverse of the matrix returned by get_vertex_frame(). See get_vertex_frame(). More...
 
const LMatrix4d getVertexFrameInvPtr ()
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix. More...
 
const LMatrix4d getVertexFramePtr ()
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix. More...
 
const LMatrix4d getVertexToNode ()
 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: More...
 
const LMatrix4d getVertexToNodePtr ()
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix. More...
 
bool isAnimMatrix ()
 Returns true if this node represents a table of animation transformation data, false otherwise. More...
 
bool isJoint ()
 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(). More...
 
bool isLocalCoord ()
 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. More...
 
bool isUnderInstance ()
 Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise. More...
 
bool isUnderTransform ()
 Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, false otherwise. More...
 
EggNode operator= (const EggNode copy)
 
bool parseEgg (str 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. Updates the object accordingly. Returns true if successful, false if there was some parse error or if the object does not support this functionality. More...
 
int renameNode (VectorString strip_prefix)
 Rename by stripping out the prefix. More...
 
 testUnderIntegrity ()
 
 transform (const LMatrix4d mat)
 Applies the indicated transformation to the node and all of its descendants. More...
 
 transformVerticesOnly (const LMatrix4d mat)
 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. More...
 
 write (Ostream out, int indent_level)
 
- Public Member Functions inherited from EggNamedObject
 __init__ (const EggNamedObject copy)
 
 __init__ (str name)
 
EggNamedObject operator= (const EggNamedObject copy)
 
 output (Ostream out)
 
- Public Member Functions inherited from EggObject
 __init__ ()
 
 __init__ (const EggObject copy)
 
 clearUserData ()
 Removes all user data pointers from the node. More...
 
 clearUserData (TypeHandle type)
 Removes the user data pointer of the indicated type. More...
 
EggUserData getUserData ()
 Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored. More...
 
EggUserData getUserData (TypeHandle type)
 Returns the user data pointer of the indicated type, if it exists, or NULL if it does not. More...
 
bool hasUserData ()
 Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise. More...
 
bool hasUserData (TypeHandle type)
 Returns true if the user data pointer of the indicated type has been set, false otherwise. More...
 
EggObject operator= (const EggObject copy)
 
 setUserData (EggUserData user_data)
 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. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 Derived classes should override this function to return get_class_type(). More...
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise. More...
 
bool unref ()
 Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete(). More...
 
- Public Member Functions inherited from Namable
 __init__ (const Namable copy)
 
 __init__ (str initial_name)
 
 clearName ()
 Resets the Namable's name to empty. More...
 
str getName ()
 
bool hasName ()
 Returns true if the Namable has a nonempty name set, false if the name is empty. More...
 
Namable operator= (const Namable other)
 
 output (Ostream out)
 Outputs the Namable. This function simply writes the name to the output stream; most Namable derivatives will probably redefine this. More...
 
 setName (str name)
 
- Public Member Functions inherited from EggRenderMode
 __init__ ()
 
 __init__ (const EggRenderMode copy)
 
 clearBin ()
 Removes the bin name that was set for this particular object. See set_bin(). More...
 
 clearDepthOffset ()
 Removes the depth-offset flag from this particular object. See set_depth_offset(). More...
 
 clearDrawOrder ()
 Removes the draw-order flag from this particular object. See set_draw_order(). More...
 
EggRenderMode::AlphaMode getAlphaMode ()
 Returns the alpha mode that was set, or AM_unspecified if nothing was set. See set_alpha_mode(). More...
 
str getBin ()
 Returns the bin name that has been set for this particular object, if any. See set_bin(). More...
 
int getDepthOffset ()
 Returns the "depth-offset" flag as set for this particular object. See set_depth_offset(). More...
 
EggRenderMode::DepthTestMode getDepthTestMode ()
 Returns the depth_test mode that was set, or DTM_unspecified if nothing was set. See set_depth_test_mode(). More...
 
EggRenderMode::DepthWriteMode getDepthWriteMode ()
 Returns the depth_write mode that was set, or DWM_unspecified if nothing was set. See set_depth_write_mode(). More...
 
int getDrawOrder ()
 Returns the "draw-order" flag as set for this particular object. See set_draw_order(). More...
 
EggRenderMode::VisibilityMode getVisibilityMode ()
 Returns the visibility mode that was set, or VM_unspecified if nothing was set. See set_visibility_mode(). More...
 
bool hasBin ()
 Returns true if a bin name has been set for this particular object. See set_bin(). More...
 
bool hasDepthOffset ()
 Returns true if the depth-offset flag has been set for this particular object. See set_depth_offset(). More...
 
bool hasDrawOrder ()
 Returns true if the draw-order flag has been set for this particular object. See set_draw_order(). More...
 
bool operator!= (const EggRenderMode other)
 
bool operator< (const EggRenderMode other)
 
EggRenderMode operator= (const EggRenderMode copy)
 
bool operator== (const EggRenderMode other)
 Comparison operators are handy. More...
 
 setAlphaMode (EggRenderMode::AlphaMode mode)
 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. More...
 
 setBin (str bin)
 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(). More...
 
 setDepthOffset (int bias)
 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(). More...
 
 setDepthTestMode (EggRenderMode::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). Note that this is different, and independent from, the depth_write mode. More...
 
 setDepthWriteMode (EggRenderMode::DepthWriteMode mode)
 Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry. More...
 
 setDrawOrder (int order)
 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(). More...
 
 setVisibilityMode (EggRenderMode::VisibilityMode mode)
 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. More...
 
 write (Ostream out, int indent_level)
 Writes the attributes to the indicated output stream in Egg format. More...
 
- Public Member Functions inherited from EggTransform
 __init__ ()
 
 __init__ (const EggTransform copy)
 
 addMatrix3 (const LMatrix3d mat)
 Appends an arbitrary 3x3 matrix to the current transform. More...
 
 addMatrix4 (const LMatrix4d mat)
 Appends an arbitrary 4x4 matrix to the current transform. More...
 
 addRotate2d (double angle)
 Appends a 2-d rotation to the current transform. The rotation angle is specified in degrees counterclockwise about the origin. More...
 
 addRotate3d (const LQuaterniond quat)
 Appends an arbitrary 3-d rotation to the current transform, expressed as a quaternion. This is converted to axis-angle notation for the egg file. More...
 
 addRotate3d (double angle, const LVector3d axis)
 Appends a 3-d rotation about an arbitrary axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. More...
 
 addRotx (double angle)
 Appends a rotation about the X axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. More...
 
 addRoty (double angle)
 Appends a rotation about the Y axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. More...
 
 addRotz (double angle)
 Appends a rotation about the Z axis to the current transform. The rotation angle is specified in degrees counterclockwise about the axis. More...
 
 addScale2d (const LVecBase2d scale)
 Appends a possibly non-uniform scale to the current transform. More...
 
 addScale3d (const LVecBase3d scale)
 Appends a possibly non-uniform scale to the current transform. More...
 
 addTranslate2d (const LVector2d translate)
 Appends a 2-d translation operation to the current transform. More...
 
 addTranslate3d (const LVector3d translate)
 Appends a 3-d translation operation to the current transform. More...
 
 addUniformScale (double scale)
 Appends a uniform scale to the current transform. More...
 
 clearTransform ()
 Resets the transform to empty, identity. More...
 
const LMatrix3d getComponentMat3 (int n)
 Returns the 3x3 matrix associated with the nth component. It is an error to call this if the component type is not CT_matrix3. More...
 
const LMatrix4d getComponentMat4 (int n)
 Returns the 4x4 matrix associated with the nth component. It is an error to call this if the component type is not CT_matrix4. More...
 
double getComponentNumber (int n)
 Returns the solitary number associated with the nth component. In the case of a rotation, this is the angle in degrees to rotate; in the case of uniform scale, this is the amount of the scale. Other types do not use this property. More...
 
EggTransform::ComponentType getComponentType (int n)
 Returns the type of the nth component. More...
 
const LVecBase2d getComponentVec2 (int n)
 Returns the 2-component vector associated with the nth component. This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a 2-d vector property. More...
 
const LVecBase3d getComponentVec3 (int n)
 Returns the 3-component vector associated with the nth component. This may be the translate vector, rotate axis, or non-uniform scale. It is an error to call this if the component type does not use a 3-d vector property. More...
 
int getNumComponents ()
 Returns the number of components that make up the transform. More...
 
LMatrix3d getTransform2d ()
 Returns the overall transform as a 3x3 matrix. It is an error to call this if has_transform3d() is true. More...
 
const LMatrix4d getTransform3d ()
 Returns the overall transform as a 4x4 matrix. It is valid to call this even if has_transform2d() is true; in this case, the 3x3 transform will be expanded to a 4x4 matrix. More...
 
bool hasTransform ()
 Returns true if the transform is nonempty, false if it is empty (no transform components have been added). This is true for either a 2-d or a 3-d transform. More...
 
bool hasTransform2d ()
 Returns true if the transform is specified as a 2-d transform, e.g. with a 3x3 matrix, or false if it is specified as a 3-d transform (with a 4x4 matrix), or not specified at all. More...
 
bool hasTransform3d ()
 Returns true if the transform is specified as a 3-d transform, e.g. with a 4x4 matrix, or false if it is specified as a 2-d transform (with a 2x2 matrix), or not specified at all. More...
 
EggTransform operator= (const EggTransform copy)
 
 setTransform2d (const LMatrix3d mat)
 Sets the overall transform as a 3x3 matrix. This completely replaces whatever componentwise transform may have been defined. More...
 
 setTransform3d (const LMatrix4d mat)
 Sets the overall transform as a 4x4 matrix. This completely replaces whatever componentwise transform may have been defined. More...
 
bool transformIsIdentity ()
 Returns true if the described transform is identity, false otherwise. More...
 
 write (Ostream out, int indent_level, str label)
 Writes the transform to the indicated stream in Egg format. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
static EggTexture::CombineMode stringCombineMode (str string)
 Returns the CombineMode value associated with the given string representation, or CM_unspecified if the string does not match any known CombineMode value. More...
 
static EggTexture::CombineOperand stringCombineOperand (str string)
 Returns the CombineOperand value associated with the given string representation, or CO_unspecified if the string does not match any known CombineOperand value. More...
 
static EggTexture::CombineSource stringCombineSource (str string)
 Returns the CombineSource value associated with the given string representation, or CS_unspecified if the string does not match any known CombineSource value. More...
 
static EggTexture::CompressionMode stringCompressionMode (str string)
 Returns the CompressionMode value associated with the given string representation, or CM_default if the string does not match any known CompressionMode value. More...
 
static EggTexture::EnvType stringEnvType (str string)
 Returns the EnvType value associated with the given string representation, or ET_unspecified if the string does not match any known EnvType value. More...
 
static EggTexture::FilterType stringFilterType (str string)
 Returns the FilterType value associated with the given string representation, or FT_unspecified if the string does not match any known FilterType value. More...
 
static EggTexture::Format stringFormat (str string)
 Returns the Format value associated with the given string representation, or F_unspecified if the string does not match any known Format value. More...
 
static EggTexture::QualityLevel stringQualityLevel (str string)
 Returns the TexGen value associated with the given string representation, or ET_unspecified if the string does not match any known TexGen value. More...
 
static EggTexture::TexGen stringTexGen (str string)
 Returns the TexGen value associated with the given string representation, or ET_unspecified if the string does not match any known TexGen value. More...
 
static EggTexture::TextureType stringTextureType (str string)
 Returns the Texture_ype value associated with the given string representation, or TT_unspecified if the string does not match any known TextureType value. More...
 
static EggTexture::WrapMode stringWrapMode (str string)
 Returns the WrapMode value associated with the given string representation, or WM_unspecified if the string does not match any known WrapMode value. More...
 
- Static Public Member Functions inherited from EggFilenameNode
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from EggNode
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from EggNamedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from EggObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from Namable
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from EggRenderMode
static TypeHandle getClassType ()
 
static EggRenderMode::AlphaMode stringAlphaMode (str string)
 Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value. More...
 
static EggRenderMode::DepthTestMode stringDepthTestMode (str string)
 Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value. More...
 
static EggRenderMode::DepthWriteMode stringDepthWriteMode (str string)
 Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value. More...
 
static EggRenderMode::VisibilityMode stringVisibilityMode (str string)
 Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value. More...
 

Detailed Description

Defines a texture map that may be applied to geometry.

Member Enumeration Documentation

◆ CombineChannel

Enumerator
CC_rgb 
CC_alpha 
CC_num_channels 

◆ CombineIndex

Enumerator
CI_num_indices 

◆ CombineMode

Enumerator
CM_unspecified 
CM_replace 
CM_modulate 
CM_add 
CM_add_signed 
CM_interpolate 
CM_subtract 
CM_dot3_rgb 
CM_dot3_rgba 

◆ CombineOperand

Enumerator
CO_unspecified 
CO_src_color 
CO_one_minus_src_color 
CO_src_alpha 
CO_one_minus_src_alpha 

◆ CombineSource

Enumerator
CS_unspecified 
CS_texture 
CS_constant 
CS_primary_color 
CS_previous 
CS_constant_color_scale 
CS_last_saved_result 

◆ CompressionMode

Enumerator
CM_default 
CM_off 
CM_on 
CM_fxt1 
CM_dxt1 
CM_dxt2 
CM_dxt3 
CM_dxt4 
CM_dxt5 

◆ EnvType

enum EnvType
Enumerator
ET_unspecified 
ET_modulate 
ET_decal 
ET_blend 
ET_replace 
ET_add 
ET_blend_color_scale 
ET_modulate_glow 
ET_modulate_gloss 
ET_normal 
ET_normal_height 
ET_glow 
ET_gloss 
ET_height 
ET_selector 
ET_normal_gloss 

◆ Equivalence

Enumerator
E_basename 
E_extension 
E_dirname 
E_complete_filename 
E_transform 
E_attributes 
E_tref_name 

◆ FilterType

enum FilterType
Enumerator
FT_unspecified 

Note that these type values match up, name-for-name, with a similar enumerated type in Panda's Texture object. However, they do not match up numerically. You must convert between them using a switch statement.

FT_nearest 

Mag Filter and Min Filter.

FT_linear 
FT_nearest_mipmap_nearest 

"mipmap point"

FT_linear_mipmap_nearest 

"mipmap linear"

FT_nearest_mipmap_linear 

"mipmap bilinear"

FT_linear_mipmap_linear 

"mipmap trilinear"

◆ Format

enum Format
Enumerator
F_unspecified 
F_rgba 
F_rgbm 
F_rgba12 
F_rgba8 
F_rgba4 
F_rgba5 
F_rgb 
F_rgb12 
F_rgb8 
F_rgb5 
F_rgb332 
F_red 
F_green 
F_blue 
F_alpha 
F_luminance 
F_luminance_alpha 
F_luminance_alphamask 

◆ QualityLevel

Enumerator
QL_unspecified 
QL_default 
QL_fastest 
QL_normal 
QL_best 

◆ TexGen

enum TexGen
Enumerator
TG_unspecified 
TG_eye_sphere_map 
TG_world_cube_map 
TG_eye_cube_map 
TG_world_normal 
TG_eye_normal 
TG_world_position 
TG_eye_position 
TG_point_sprite 

◆ TextureType

Enumerator
TT_unspecified 
TT_1d_texture 
TT_2d_texture 
TT_3d_texture 
TT_cube_map 

◆ WrapMode

enum WrapMode
Enumerator
WM_unspecified 
WM_clamp 
WM_repeat 
WM_mirror 
WM_mirror_once 
WM_border_color 

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const EggTexture  copy)

◆ __init__() [2/2]

__init__ ( str  tref_name,
const Filename  filename 
)

◆ affectsPolygonAlpha()

bool affectsPolygonAlpha ( )

Returns true if this texture's environment type or combine mode allows the texture to have an effect on the polygon's alpha values, false otherwise.

◆ clearAlphaFileChannel()

clearAlphaFileChannel ( )

Removes the specification of a particular channel to use from the alpha-file image.

◆ clearAlphaFilename()

clearAlphaFilename ( )

◆ clearAlphaScale()

clearAlphaScale ( )

Removes the alpha_scale from the texture and restores it to the default value of 1.

◆ clearAnisotropicDegree()

clearAnisotropicDegree ( )

Removes the specification of anisotropic filtering from the texture.

◆ clearBorderColor()

clearBorderColor ( )

◆ clearColor()

clearColor ( )

◆ clearMultitexture()

clearMultitexture ( )

Resets the multitexture flags set by multitexture_over(). After this call, get_multitexture() will return false, and get_multitexture_sort() will return 0.

◆ clearNumViews()

clearNumViews ( )

Removes the specification of the number of views for a 3-D multiview texture.

◆ clearPriority()

clearPriority ( )

Removes the specification of multitexture priority from the texture. The default priority value is 0.

◆ clearRgbScale()

clearRgbScale ( )

Removes the rgb_scale from the texture and restores it to the default value of 1.

◆ clearStageName()

clearStageName ( )

Removes the named TextureStage specification.

◆ clearUvName()

clearUvName ( )

Removes the restriction to a particular named set of texture coordinates and restores the texture to using the default texture coordinates.

◆ determineWrapU()

EggTexture::WrapMode determineWrapU ( )

Determines the appropriate wrap in the U direction. This is different from get_wrap_u() in that if the U wrap is unspecified, it returns the overall wrap value.

◆ determineWrapV()

EggTexture::WrapMode determineWrapV ( )

Determines the appropriate wrap in the V direction. This is different from get_wrap_v() in that if the V wrap is unspecified, it returns the overall wrap value.

◆ determineWrapW()

EggTexture::WrapMode determineWrapW ( )

Determines the appropriate wrap in the W direction. This is different from get_wrap_w() in that if the W wrap is unspecified, it returns the overall wrap value.

◆ getAlphaFileChannel()

int getAlphaFileChannel ( )

Returns the particular channel that has been specified for the alpha-file image, or 0 if no channel has been specified. See set_alpha_file_channel().

◆ getAlphaFilename()

const Filename getAlphaFilename ( )

Returns the separate file assigned for the alpha channel. It is an error to call this unless has_alpha_filename() returns true. See set_alpha_filename().

◆ getAlphaFullpath()

const Filename getAlphaFullpath ( )

Returns the full pathname to the alpha file, if it is known; otherwise, returns the same thing as get_alpha_filename().

This function simply returns whatever was set by the last call to set_alpha_fullpath(). This string is not written to the egg file; its main purpose is to record the full path to the alpha filename if it is known, for egg structures that are generated in-memory and then immediately converted to a scene graph.

◆ getAlphaScale()

int getAlphaScale ( )

Returns the alpha_scale value that has been specified for the texture, or 1 if no alpha_scale value has been specified.

◆ getAnisotropicDegree()

int getAnisotropicDegree ( )

Returns the anisotropic filtering degree that has been specified for this texture, or 0 if nothing has been specified.

◆ getBorderColor()

const LColor getBorderColor ( )

Returns the border color if one has been specified, or (0, 0, 0, 1) otherwise.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getColor()

const LColor getColor ( )

Returns the blend color if one has been specified, or (0, 0, 0, 1) otherwise.

◆ getCombineMode()

◆ getCombineOperand()

EggTexture::CombineOperand getCombineOperand ( EggTexture::CombineChannel  channel,
int  n 
)

◆ getCombineSource()

EggTexture::CombineSource getCombineSource ( EggTexture::CombineChannel  channel,
int  n 
)

◆ getCompressionMode()

EggTexture::CompressionMode getCompressionMode ( )

◆ getEnvType()

EggTexture::EnvType getEnvType ( )

◆ getFormat()

EggTexture::Format getFormat ( )

◆ getMagfilter()

EggTexture::FilterType getMagfilter ( )

◆ getMinfilter()

EggTexture::FilterType getMinfilter ( )

◆ getMultitextureSort()

int getMultitextureSort ( )

Returns an integer that represents the depth to which this texture is layered on all other textures in the egg file. In general, if texture A is layered over texture B, then sort(A) > sort(B). If texture A is never layered over any other texture, then sort(A) == 0. More than that is difficult to guarantee.

◆ getMultiview()

bool getMultiview ( )

Returns the current setting of the multiview flag. See set_multiview().

◆ getNumViews()

int getNumViews ( )

Returns the specified number of views specified for the 3-D multiview texture. See set_num_views().

◆ getPriority()

int getPriority ( )

Returns the multitexture importance value that has been specified for the texture, or 0 if no priority value has been specified.

◆ getQualityLevel()

EggTexture::QualityLevel getQualityLevel ( )

◆ getReadMipmaps()

bool getReadMipmaps ( )

Returns the current setting of the read_mipmaps flag. See set_read_mipmaps().

◆ getRgbScale()

int getRgbScale ( )

Returns the rgb_scale value that has been specified for the texture, or 1 if no rgb_scale value has been specified.

◆ getSavedResult()

bool getSavedResult ( )

Returns the current setting of the saved_result flag. See set_saved_result().

◆ getStageName()

str getStageName ( )

Returns the stage name that has been specified for this texture, or the tref name if no texture stage has explicitly been specified.

◆ getTexGen()

EggTexture::TexGen getTexGen ( )

◆ getTextureType()

EggTexture::TextureType getTextureType ( )

◆ getUvName()

str getUvName ( )

Returns the texcoord name that has been specified for this texture, or the empty string if no texcoord name has explicitly been specified.

◆ getWrapMode()

EggTexture::WrapMode getWrapMode ( )

◆ getWrapU()

EggTexture::WrapMode getWrapU ( )

Returns the amount specified for U wrap. This may be unspecified, even if there is an overall wrap value.

◆ getWrapV()

EggTexture::WrapMode getWrapV ( )

Returns the amount specified for V wrap. This may be unspecified, even if there is an overall wrap value.

◆ getWrapW()

EggTexture::WrapMode getWrapW ( )

Returns the amount specified for W wrap. This may be unspecified, even if there is an overall wrap value.

◆ hasAlphaChannel()

bool hasAlphaChannel ( int  num_components)

Given the number of color components (channels) in the image file as actually read from the disk, return true if this texture seems to have an alpha channel or not. This depends on the EggTexture's format as well as the number of channels.

◆ hasAlphaFileChannel()

bool hasAlphaFileChannel ( )

Returns true if a particular channel has been specified for the alpha-file image, false otherwise.

◆ hasAlphaFilename()

bool hasAlphaFilename ( )

Returns true if a separate file for the alpha component has been applied, false otherwise. See set_alpha_filename().

◆ hasAlphaScale()

bool hasAlphaScale ( )

Returns true if an alpha_scale has been specified for the texture, false otherwise.

◆ hasAnisotropicDegree()

bool hasAnisotropicDegree ( )

Returns true if a value for the anisotropic filtering degree has been specified for this texture, false otherwise.

◆ hasBorderColor()

bool hasBorderColor ( )

Returns true if a border color has been specified for the texture.

◆ hasColor()

bool hasColor ( )

Returns true if a blend color has been specified for the texture.

◆ hasNumViews()

bool hasNumViews ( )

Returns true if the number of views has been specified for the 3-D multiview texture, false otherwise.

◆ hasPriority()

bool hasPriority ( )

Returns true if a priority value for multitexture importance has been specified for the texture, false otherwise.

◆ hasRgbScale()

bool hasRgbScale ( )

Returns true if an rgb_scale has been specified for the texture, false otherwise.

◆ hasStageName()

bool hasStageName ( )

Returns true if a stage name has been explicitly specified for this texture, false otherwise.

◆ hasUvName()

bool hasUvName ( )

Returns true if a texcoord name has been explicitly specified for this texture, false otherwise.

◆ isEquivalentTo()

bool isEquivalentTo ( const EggTexture  other,
int  eq 
)

Returns true if the two textures are equivalent in all relevant properties (according to eq), false otherwise.

The Equivalence parameter, eq, should be set to the bitwise OR of the following properties, according to what you consider relevant:

EggTexture::E_basename: The basename part of the texture filename, without the directory prefix or the filename extension.

EggTexture::E_extension: The extension part of the texture filename.

EggTexture::E_dirname: The directory prefix of the texture filename.

EggTexture::E_complete_filename: The union of the above three; that is, the complete filename, with directory, basename, and extension.

EggTexture::E_transform: The texture matrix.

EggTexture::E_attributes: All remaining texture attributes (mode, mipmap, etc.) except TRef name.

EggTexture::E_tref_name: The TRef name.

◆ multitextureOver()

bool multitextureOver ( EggTexture  other)

Indicates that this texture should be layered on top of the other texture. This will guarantee that this->get_multitexture_sort() > other->get_multitexture_sort(), at least until clear_multitexture() is called on either one.

The return value is true if successful, or false if there is a failure because the other texture was already layered on top of this one (or there is a three- or more-way cycle).

◆ operator=()

EggTexture operator= ( const EggTexture  copy)

◆ setAlphaFileChannel()

setAlphaFileChannel ( int  alpha_file_channel)

If a separate alpha-file is specified, this indicates which channel number should be extracted from this file to derive the alpha channel for the final image. The default is 0, which means the grayscale combination of r, g, b. Otherwise, this should be the 1-based channel number, for instance 1, 2, or 3 for r, g, or b, respectively, or 4 for the alpha channel of a four-component image.

◆ setAlphaFilename()

setAlphaFilename ( const Filename  filename)

Specifies a separate file that will be loaded in with the 1- or 3-component texture and applied as the alpha channel. This is useful when loading textures from file formats that do not support alpha, for instance jpg.

◆ setAlphaFullpath()

setAlphaFullpath ( const Filename  fullpath)

Records the full pathname to the file, for the benefit of get_alpha_fullpath().

◆ setAlphaScale()

setAlphaScale ( int  alpha_scale)

Sets an additional factor that will scale the alpha component after the texture has been applied. This is used only when a combine mode is in effect.

The only legal values are 1, 2, or 4.

◆ setAnisotropicDegree()

setAnisotropicDegree ( int  anisotropic_degree)

Sets the degree of anisotropic filtering for this texture. 1 is off; higher levels indicate filtering in effect.

◆ setBorderColor()

setBorderColor ( const LColor  border_color)

◆ setColor()

setColor ( const LColor  color)

◆ setCombineMode()

setCombineMode ( EggTexture::CombineChannel  channel,
EggTexture::CombineMode  cm 
)

◆ setCombineOperand()

setCombineOperand ( EggTexture::CombineChannel  channel,
int  n,
EggTexture::CombineOperand  co 
)

◆ setCombineSource()

setCombineSource ( EggTexture::CombineChannel  channel,
int  n,
EggTexture::CombineSource  cs 
)

◆ setCompressionMode()

setCompressionMode ( EggTexture::CompressionMode  mode)

◆ setEnvType()

setEnvType ( EggTexture::EnvType  type)

◆ setFormat()

setFormat ( EggTexture::Format  format)

◆ setMagfilter()

setMagfilter ( EggTexture::FilterType  type)

◆ setMinfilter()

setMinfilter ( EggTexture::FilterType  type)

◆ setMultiview()

setMultiview ( bool  multiview)

Sets the multiview flag.

If multiview is true, the filename should contain a hash mark ('#'), which will be filled in with the view number; and a multiview texture will be defined with a series of images, one for each view.

A multiview texture is most often used for stereo textures, but other uses are also possible, such as for texture animation.

◆ setNumViews()

setNumViews ( int  num_views)

When loading a 3-D multiview texture, this parameter is necessary to specify how many views will be expected. The z size is determined implicitly from the number of images loaded.

◆ setPriority()

setPriority ( int  priority)

Sets the importance of this texture with respect to other textures also applied on the same geometry. This is only meaningful in the presence of multitexturing.

◆ setQualityLevel()

setQualityLevel ( EggTexture::QualityLevel  quality_level)

◆ setReadMipmaps()

setReadMipmaps ( bool  read_mipmaps)

Sets the read_mipmaps flag.

If read_mipmaps is true, the filename should contain a hash mark ('#'), which will be filled in with the mipmap level number; and the texture will be defined with a series of images, one for each mipmap level.

If the filename is of a type that already requires a hash mark, such as a cube map or a 3-d texture, then the filename should now require two hash marks, and the first one indicates the mipmap level number, while the second indicates the face number or 3-d level number.

◆ setRgbScale()

setRgbScale ( int  rgb_scale)

Sets an additional factor that will scale all three r, g, b components after the texture has been applied. This is used only when a combine mode is in effect.

The only legal values are 1, 2, or 4.

◆ setSavedResult()

setSavedResult ( bool  saved_result)

Sets the saved_result flag. When this is true, the output of this stage is not part of the normal pipeline–that is, it will not be supplied as the "previous" source for the next texture stage–but it will instead be supplied as the "last_saved_result" source for any future stages, until the next TextureStage with a saved_result set true is encountered.

This can be used to reuse the results of this texture stage as input to more than one stage later in the pipeline.

The last texture in the pipeline (the one with the highest sort value) should not have this flag set.

◆ setStageName()

setStageName ( str  stage_name)

Specifies the particular TextureStage this texture will be rendered on by name. If this is omitted, the texture will be rendered on the default TextureStage, unless some other stage-specific property is specificied, in which case the texture will be rendered on a TextureStage with the same name as the tref. This is in support of multitexturing.

Each different TextureStage in the world must be uniquely named.

◆ setTexGen()

setTexGen ( EggTexture::TexGen  tex_gen)

◆ setTextureType()

setTextureType ( EggTexture::TextureType  texture_type)

◆ setUvName()

setUvName ( str  uv_name)

Specifies the named set of texture coordinates that this texture will use when it is applied to geometry. Geometry may have multiple sets of texture coordinates defined, by name.

If this is not specified for a particular texture, the default set of texture coordinates will be used.

◆ setWrapMode()

setWrapMode ( EggTexture::WrapMode  mode)

◆ setWrapU()

setWrapU ( EggTexture::WrapMode  mode)

◆ setWrapV()

setWrapV ( EggTexture::WrapMode  mode)

◆ setWrapW()

setWrapW ( EggTexture::WrapMode  mode)

◆ sortsLessThan()

bool sortsLessThan ( const EggTexture  other,
int  eq 
)

An ordering operator to compare two textures for sorting order. This imposes an arbitrary ordering useful to identify unique textures, according to the indicated Equivalence factor. See is_equivalent_to().

◆ stringCombineMode()

static EggTexture::CombineMode stringCombineMode ( str  string)
static

Returns the CombineMode value associated with the given string representation, or CM_unspecified if the string does not match any known CombineMode value.

◆ stringCombineOperand()

static EggTexture::CombineOperand stringCombineOperand ( str  string)
static

Returns the CombineOperand value associated with the given string representation, or CO_unspecified if the string does not match any known CombineOperand value.

◆ stringCombineSource()

static EggTexture::CombineSource stringCombineSource ( str  string)
static

Returns the CombineSource value associated with the given string representation, or CS_unspecified if the string does not match any known CombineSource value.

◆ stringCompressionMode()

static EggTexture::CompressionMode stringCompressionMode ( str  string)
static

Returns the CompressionMode value associated with the given string representation, or CM_default if the string does not match any known CompressionMode value.

◆ stringEnvType()

static EggTexture::EnvType stringEnvType ( str  string)
static

Returns the EnvType value associated with the given string representation, or ET_unspecified if the string does not match any known EnvType value.

◆ stringFilterType()

static EggTexture::FilterType stringFilterType ( str  string)
static

Returns the FilterType value associated with the given string representation, or FT_unspecified if the string does not match any known FilterType value.

◆ stringFormat()

static EggTexture::Format stringFormat ( str  string)
static

Returns the Format value associated with the given string representation, or F_unspecified if the string does not match any known Format value.

◆ stringQualityLevel()

static EggTexture::QualityLevel stringQualityLevel ( str  string)
static

Returns the TexGen value associated with the given string representation, or ET_unspecified if the string does not match any known TexGen value.

◆ stringTexGen()

static EggTexture::TexGen stringTexGen ( str  string)
static

Returns the TexGen value associated with the given string representation, or ET_unspecified if the string does not match any known TexGen value.

◆ stringTextureType()

static EggTexture::TextureType stringTextureType ( str  string)
static

Returns the Texture_ype value associated with the given string representation, or TT_unspecified if the string does not match any known TextureType value.

◆ stringWrapMode()

static EggTexture::WrapMode stringWrapMode ( str  string)
static

Returns the WrapMode value associated with the given string representation, or WM_unspecified if the string does not match any known WrapMode value.

◆ write()

write ( Ostream  out,
int  indent_level 
)

Writes the texture definition to the indicated output stream in Egg format.