Panda3D
Public Types | Public Member Functions | Public Attributes

CLwoSurface Class Reference

This class is a wrapper around LwoSurface and stores additional information useful during the conversion-to-egg process. More...

#include "cLwoSurface.h"

List of all members.

Public Types

enum  Flags {
  F_rgb = 0x0001, F_diffuse = 0x0002, F_luminosity = 0x0004, F_specular = 0x0008,
  F_reflection = 0x0010, F_transparency = 0x0020, F_gloss = 0x0040, F_translucency = 0x0080,
  F_smooth_angle = 0x0100, F_backface = 0x0200
}

Public Member Functions

 CLwoSurface (LwoToEggConverter *converter, const LwoSurface *surface)
void apply_properties (EggPrimitive *egg_prim, vector_PT_EggVertex &egg_vertices, PN_stdfloat &smooth_angle)
 Applies the color, texture, etc.
bool check_material ()
 Checks whether the surface demands a material or not.
bool check_texture ()
 Checks whether the surface demands a texture or not.
 CPT (LwoSurface) _surface
const string & get_name () const
 Returns the name of the surface.
const string & get_uv_name () const
 Returns the name of the set of UV's that are associated with this surface, if has_named_uvs() is true.
bool has_named_uvs () const
 Returns true if the surface is set up to reference UV's stored on the vertices, by name (as opposed to generated UV's, which is the more common Lightwave case).

Public Attributes

bool _backface
CLwoSurfaceBlock_block
bool _checked_material
bool _checked_texture
LColor _color
LwoToEggConverter_converter
PN_stdfloat _diffuse
LColor _diffuse_color
PT_EggMaterial _egg_material
PT_EggTexture _egg_texture
int _flags
PN_stdfloat _gloss
PN_stdfloat _luminosity
PN_stdfloat _reflection
LRGBColor _rgb
PN_stdfloat _smooth_angle
PN_stdfloat _specular
PN_stdfloat _translucency
PN_stdfloat _transparency

Detailed Description

This class is a wrapper around LwoSurface and stores additional information useful during the conversion-to-egg process.

Definition at line 42 of file cLwoSurface.h.


Member Function Documentation

void CLwoSurface::apply_properties ( EggPrimitive egg_prim,
vector_PT_EggVertex &  egg_vertices,
PN_stdfloat &  smooth_angle 
)

Applies the color, texture, etc.

described by the surface to the indicated egg primitive.

If the surface defines a smoothing angle, smooth_angle may be updated to reflect it if the angle is greater than that specified.

Definition at line 170 of file cLwoSurface.cxx.

References apply_properties(), check_material(), check_texture(), LwoToEggConverter::get_surface(), EggPrimitive::set_bface_flag(), EggPrimitive::set_material(), and EggPrimitive::set_texture().

Referenced by apply_properties().

bool CLwoSurface::check_material ( )

Checks whether the surface demands a material or not.

Returns true if so, false otherwise.

Definition at line 297 of file cLwoSurface.cxx.

References get_name().

Referenced by apply_properties().

bool CLwoSurface::check_texture ( )

Checks whether the surface demands a texture or not.

Returns true if so, false otherwise.

If the surface demands a texture, this also sets up _egg_texture and _compute_uvs as appropriate for the texture.

Definition at line 217 of file cLwoSurface.cxx.

References SomethingToEggConverter::convert_model_path(), LwoToEggConverter::get_clip(), and CLwoClip::is_still_image().

Referenced by apply_properties().

const string & CLwoSurface::get_name ( ) const [inline]

Returns the name of the surface.

Each surface in a given Lightwave file should have a unique name.

Definition at line 23 of file cLwoSurface.I.

Referenced by check_material().

const string & CLwoSurface::get_uv_name ( ) const [inline]

Returns the name of the set of UV's that are associated with this surface, if has_named_uvs() is true.

Definition at line 50 of file cLwoSurface.I.

bool CLwoSurface::has_named_uvs ( ) const [inline]

Returns true if the surface is set up to reference UV's stored on the vertices, by name (as opposed to generated UV's, which is the more common Lightwave case).

In this case, get_uv_name() can be called to return the name of the UV's.

Definition at line 37 of file cLwoSurface.I.


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