Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes

EggVertexUV Class Reference

The set of UV's that may or may not be assigned to a vertex. More...

#include "eggVertexUV.h"

Inheritance diagram for EggVertexUV:
EggNamedObject EggObject Namable TypedReferenceCount MemoryBase TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

 EggVertexUV (const string &name, const LTexCoordd &uv)
 EggVertexUV (const string &name, const LTexCoord3d &uvw)
 EggVertexUV (const EggVertexUV &copy)
void clear_binormal ()
void clear_tangent ()
int compare_to (const EggVertexUV &other) const
 An ordering operator to compare two vertices for sorting order.
virtual TypeHandle force_init_type ()
const LNormaldget_binormal () const
int get_num_dimensions () const
 Returns the number of components of the texture coordinate set.
const LNormaldget_tangent () const
virtual TypeHandle get_type () const
LTexCoordd get_uv () const
 Returns the texture coordinate pair, if get_num_dimensions() is 2.
const LTexCoord3dget_uvw () const
 Returns the texture coordinate triple, if get_num_dimensions() is 3.
bool has_binormal () const
bool has_tangent () const
bool has_w () const
 Returns true if the texture coordinate has a third, w component, false if it is just a normal 2-d texture coordinate.
EggVertexUVoperator= (const EggVertexUV &copy)
void set_binormal (const LNormald &binormal)
void set_name (const string &name)
void set_tangent (const LNormald &tangent)
void set_uv (const LTexCoordd &texCoord)
 Sets the texture coordinate pair.
void set_uvw (const LTexCoord3d &texCoord)
 Sets the texture coordinate triple.
void transform (const LMatrix4d &mat)
 Applies the indicated transformation matrix to the UV's tangent and/or binormal.
void write (ostream &out, int indent_level) const

Static Public Member Functions

static string filter_name (const string &name)
 Returns the actual name that should be set for a given name string.
static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Public Attributes

EggMorphTexCoordList _duvs

Detailed Description

The set of UV's that may or may not be assigned to a vertex.

To support multitexturing, there may be multiple sets of UV's on a particular vertex, each with its own name.

Definition at line 32 of file eggVertexUV.h.


Member Function Documentation

int EggVertexUV::compare_to ( const EggVertexUV other) const

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Definition at line 163 of file eggVertexUV.cxx.

References LVecBase3d::compare_to().

string EggVertexUV::filter_name ( const string &  name) [inline, static]

Returns the actual name that should be set for a given name string.

Usually this is the same string that is input, but for historical reasons the texture coordinate name "default" is mapped to the empty string.

Definition at line 26 of file eggVertexUV.I.

Referenced by EggVertex::clear_uv(), EggVertex::get_uv(), EggVertex::get_uv_obj(), EggVertex::get_uvw(), EggVertex::has_uv(), EggVertex::has_uvw(), EggVertex::modify_uv_obj(), EggVertex::set_uv(), and EggVertex::set_uvw().

int EggVertexUV::get_num_dimensions ( ) const [inline]

Returns the number of components of the texture coordinate set.

This is either 2 (the normal case) or 3 (for a 3-d texture coordinate).

Definition at line 51 of file eggVertexUV.I.

References has_w().

LTexCoordd EggVertexUV::get_uv ( ) const [inline]

Returns the texture coordinate pair, if get_num_dimensions() is 2.

Definition at line 74 of file eggVertexUV.I.

References has_w(), and LPoint2d::zero().

const LTexCoord3d & EggVertexUV::get_uvw ( ) const [inline]

Returns the texture coordinate triple, if get_num_dimensions() is 3.

This is also legal to call if get_num_dimensions() is 2 (but the last dimension will be zero).

Definition at line 88 of file eggVertexUV.I.

Referenced by EggPrimitive::r_apply_texmats().

bool EggVertexUV::has_w ( ) const [inline]

Returns true if the texture coordinate has a third, w component, false if it is just a normal 2-d texture coordinate.

Definition at line 63 of file eggVertexUV.I.

Referenced by get_num_dimensions(), get_uv(), EggVertexPool::get_uv_names(), EggVertex::has_uv(), EggVertex::has_uvw(), and EggPrimitive::r_apply_texmats().

static void EggVertexUV::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from EggNamedObject.

Definition at line 83 of file eggVertexUV.h.

References EggNamedObject::init_type().

void EggVertexUV::set_uv ( const LTexCoordd uv) [inline]

Sets the texture coordinate pair.

This makes the texture coordinate a 2-d texture coordinate, which is the usual case.

Definition at line 100 of file eggVertexUV.I.

void EggVertexUV::set_uvw ( const LTexCoord3d uvw) [inline]

Sets the texture coordinate triple.

This makes the texture coordinate a 3-d texture coordinate.

Definition at line 112 of file eggVertexUV.I.

void EggVertexUV::transform ( const LMatrix4d mat)

Applies the indicated transformation matrix to the UV's tangent and/or binormal.

This does nothing if there is no tangent or binormal.

Definition at line 104 of file eggVertexUV.cxx.

References LVecBase3d::normalize().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations