Panda3D
Public Types | Public Member Functions | Public Attributes | List of all members
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"

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. More...
 
bool check_material ()
 Checks whether the surface demands a material or not. More...
 
bool check_texture ()
 Checks whether the surface demands a texture or not. More...
 
 CPT (LwoSurface) _surface
 
const std::string & get_name () const
 Returns the name of the surface. More...
 
const std::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. More...
 
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). More...
 

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 39 of file cLwoSurface.h.

Member Function Documentation

◆ apply_properties()

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 162 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().

◆ check_material()

bool CLwoSurface::check_material ( )

Checks whether the surface demands a material or not.

Returns true if so, false otherwise.

Definition at line 282 of file cLwoSurface.cxx.

References get_name().

Referenced by apply_properties().

◆ check_texture()

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 205 of file cLwoSurface.cxx.

References LwoToEggConverter::get_clip().

Referenced by apply_properties().

◆ get_name()

const std::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 19 of file cLwoSurface.I.

Referenced by check_material().

◆ get_uv_name()

const std::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 40 of file cLwoSurface.I.

◆ has_named_uvs()

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 30 of file cLwoSurface.I.


The documentation for this class was generated from the following files: