Panda3D
Public Member Functions | Static Public Member Functions

TexGenAttrib Class Reference

Computes texture coordinates for geometry automatically based on vertex position and/or normal. More...

Inheritance diagram for TexGenAttrib:
RenderAttrib TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject

List of all members.

Public Member Functions

RenderAttrib const addStage (TextureStage stage, TexGenMode mode)
 Returns a new TexGenAttrib just like this one, with the indicated generation mode for the given stage.
RenderAttrib const addStage (TextureStage stage, TexGenMode mode, Point3 const constant_value)
 Returns a new TexGenAttrib just like this one, with the indicated generation mode for the given stage.
RenderAttrib const addStage (TextureStage stage, TexGenMode mode, string source_name, NodePath const light)
 Returns a new TexGenAttrib just like this one, with the indicated generation mode for the given stage.
Point3 const getConstantValue (TextureStage stage)
 Returns the constant value associated with the named texture stage.
int getGeomRendering (int geom_rendering)
 Returns the union of the Geom.GeomRendering bits that will be required once this TexGenAttrib is applied to a geom which includes the indicated geom_rendering bits.
NodePath getLight (TextureStage stage)
 Returns the Light associated with the named texture stage, or the empty NodePath if no light is associated with the indicated stage.
TexGenMode getMode (TextureStage stage)
 Returns the generation mode associated with the named texture stage, or M_off if nothing is associated with the indicated stage.
string getSourceName (TextureStage stage)
 Returns the source name associated with the named texture stage, or the empty string if no name is associated with the indicated stage.
bool hasGenTexcoordStage (TextureStage stage)
 Returns true if the indicated TextureStage will have texture coordinates generated for it automatically (and thus there is no need to upload the texture coordinates encoded in the vertices).
bool hasStage (TextureStage stage)
 Returns true if there is a mode associated with the indicated stage, or false otherwise (in which case get_transform(stage) will return M_off).
bool isEmpty ()
 Returns true if no stages are defined in the TexGenAttrib, false if at least one is.
RenderAttrib const removeStage (TextureStage stage)
 Returns a new TexGenAttrib just like this one, with the indicated stage removed.

Static Public Member Functions

static int getClassSlot ()
static TypeHandle getClassType ()
static RenderAttrib const make (TextureStage stage, TexGenMode mode)
 Constructs a TexGenAttrib that generates just the indicated stage.
static RenderAttrib const make ()
 Constructs a TexGenAttrib that generates no stages at all.
static RenderAttrib const makeDefault ()
 Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Detailed Description

Computes texture coordinates for geometry automatically based on vertex position and/or normal.

This can be used to implement reflection and/or refraction maps, for instance to make shiny surfaces, as well as other special effects such as projective texturing.


Member Function Documentation

RenderAttrib const addStage ( TextureStage  stage,
TexGenMode  mode 
)

Returns a new TexGenAttrib just like this one, with the indicated generation mode for the given stage.

If this stage already exists, its mode is replaced.

RenderAttrib const addStage ( TextureStage  stage,
TexGenMode  mode,
Point3 const  constant_value 
)

Returns a new TexGenAttrib just like this one, with the indicated generation mode for the given stage.

If this stage already exists, its mode is replaced.

This variant also accepts constant_value, which is only meaningful if mode is M_constant.

RenderAttrib const addStage ( TextureStage  stage,
TexGenMode  mode,
string  source_name,
NodePath const  light 
)

Returns a new TexGenAttrib just like this one, with the indicated generation mode for the given stage.

If this stage already exists, its mode is replaced.

This variant also accepts source_name and light, which are only meaningful if mode is M_light_vector.

static int getClassSlot ( ) [static]
static TypeHandle getClassType ( ) [static]

Reimplemented from RenderAttrib.

Point3 const getConstantValue ( TextureStage  stage)

Returns the constant value associated with the named texture stage.

This is only meaningful if the mode is M_constant.

int getGeomRendering ( int  geom_rendering)

Returns the union of the Geom.GeomRendering bits that will be required once this TexGenAttrib is applied to a geom which includes the indicated geom_rendering bits.

NodePath getLight ( TextureStage  stage)

Returns the Light associated with the named texture stage, or the empty NodePath if no light is associated with the indicated stage.

This is only meaningful if the mode is M_light_vector.

TexGenMode getMode ( TextureStage  stage)

Returns the generation mode associated with the named texture stage, or M_off if nothing is associated with the indicated stage.

string getSourceName ( TextureStage  stage)

Returns the source name associated with the named texture stage, or the empty string if no name is associated with the indicated stage.

This is only meaningful if the mode is M_light_vector, in which case it indicates the name of the source texture coordinate set from which the tangent and binormal are derived.

bool hasGenTexcoordStage ( TextureStage  stage)

Returns true if the indicated TextureStage will have texture coordinates generated for it automatically (and thus there is no need to upload the texture coordinates encoded in the vertices).

bool hasStage ( TextureStage  stage)

Returns true if there is a mode associated with the indicated stage, or false otherwise (in which case get_transform(stage) will return M_off).

bool isEmpty ( )

Returns true if no stages are defined in the TexGenAttrib, false if at least one is.

static RenderAttrib const make ( ) [static]

Constructs a TexGenAttrib that generates no stages at all.

static RenderAttrib const make ( TextureStage  stage,
TexGenMode  mode 
) [static]

Constructs a TexGenAttrib that generates just the indicated stage.

static RenderAttrib const makeDefault ( ) [static]

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

RenderAttrib const removeStage ( TextureStage  stage)

Returns a new TexGenAttrib just like this one, with the indicated stage removed.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties