Panda3D
|
This class is a wrapper around LwoPolygons and stores additional information useful during the conversion-to-egg process. More...
#include "cLwoPolygons.h"
Public Types | |
typedef pmap< IffId, const LwoPolygonTags * > | PTags |
typedef pmap< string, const LwoDiscontinuousVertexMap * > | VMad |
Public Member Functions | |
CLwoPolygons (LwoToEggConverter *converter, const LwoPolygons *polygons, CLwoPoints *points) | |
void | add_ptags (const LwoPolygonTags *lwo_ptags, const LwoTags *tags) |
Associates the indicated PolygonTags and Tags with the polygons in this chunk. More... | |
void | add_vmad (const LwoDiscontinuousVertexMap *lwo_vmad) |
Associates the indicated DiscontinousVertexMap with the polygons. More... | |
void | connect_egg () |
Connects all the egg structures together. More... | |
CPT (LwoPolygons) _polygons | |
CLwoSurface * | get_surface (int polygon_index) const |
Returns the surface associated with the given polygon, or NULL if no surface is associated. More... | |
bool | get_uv (const string &uv_name, int pi, int vi, LPoint2 &uv) const |
Returns true if there is a UV of the indicated name associated with the given vertex of the indicated polygon, false otherwise. More... | |
void | make_egg () |
Creates the egg structures associated with this Lightwave object. More... | |
PT (EggGroup) _egg_group | |
Public Attributes | |
LwoToEggConverter * | _converter |
CLwoPoints * | _points |
PTags | _ptags |
const LwoPolygonTags * | _surf_ptags |
const LwoTags * | _tags |
VMad | _txuv |
This class is a wrapper around LwoPolygons and stores additional information useful during the conversion-to-egg process.
Definition at line 39 of file cLwoPolygons.h.
void CLwoPolygons::add_ptags | ( | const LwoPolygonTags * | lwo_ptags, |
const LwoTags * | tags | ||
) |
Associates the indicated PolygonTags and Tags with the polygons in this chunk.
This may define features such as per-polygon surfaces, parts, and smoothing groups.
Definition at line 38 of file cLwoPolygons.cxx.
References add_vmad().
Referenced by LwoToEggConverter::get_surface().
void CLwoPolygons::add_vmad | ( | const LwoDiscontinuousVertexMap * | lwo_vmad | ) |
Associates the indicated DiscontinousVertexMap with the polygons.
This can be used in conjunction with (or in place of) the VertexMap associated with the points set, to define per-polygon UV's etc.
Definition at line 67 of file cLwoPolygons.cxx.
References get_surface().
Referenced by add_ptags(), and LwoToEggConverter::get_surface().
void CLwoPolygons::connect_egg | ( | ) |
Connects all the egg structures together.
Definition at line 203 of file cLwoPolygons.cxx.
References CLwoSurface::apply_properties(), EggVertexPool::create_unique_vertex(), EggData::get_coordinate_system(), SomethingToEggConverter::get_egg_data(), LwoPoints::get_num_points(), LwoPoints::get_point(), get_surface(), CLwoPoints::get_uv(), get_uv(), CLwoSurface::get_uv_name(), and CLwoSurface::has_named_uvs().
Referenced by LwoToEggConverter::get_surface(), and make_egg().
CLwoSurface * CLwoPolygons::get_surface | ( | int | polygon_index | ) | const |
Returns the surface associated with the given polygon, or NULL if no surface is associated.
Definition at line 93 of file cLwoPolygons.cxx.
References LwoTags::get_num_tags(), LwoToEggConverter::get_surface(), LwoPolygonTags::get_tag(), LwoTags::get_tag(), get_uv(), and LwoPolygonTags::has_tag().
Referenced by add_vmad(), and connect_egg().
bool CLwoPolygons::get_uv | ( | const string & | uv_name, |
int | pi, | ||
int | vi, | ||
LPoint2 & | uv | ||
) | const |
Returns true if there is a UV of the indicated name associated with the given vertex of the indicated polygon, false otherwise.
If true, fills in uv with the value.
This performs a lookup in the optional "discontinuous" vertex mapping, which provides the ability to map different UV's per each polygon for the same vertex. If the UV is not defined here, it may also be defined in the standard vertex map, which is associated with the points themselves.
Definition at line 140 of file cLwoPolygons.cxx.
References LwoDiscontinuousVertexMap::get_value(), LwoDiscontinuousVertexMap::has_value(), and make_egg().
Referenced by connect_egg(), and get_surface().
void CLwoPolygons::make_egg | ( | ) |
Creates the egg structures associated with this Lightwave object.
Definition at line 170 of file cLwoPolygons.cxx.
References connect_egg().
Referenced by LwoToEggConverter::get_surface(), and get_uv().