Panda3D

Loading...
Searching...
No Matches
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.
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 std::string & | get_name () const
| Returns the name of the surface.
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.
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 39 of file cLwoSurface.h.

## Member Enumeration Documentation

## ◆ Flags

enum CLwoSurface::Flags

Definition at line 56 of file cLwoSurface.h.

## Constructor & Destructor Documentation

## ◆ CLwoSurface()

CLwoSurface::CLwoSurface | ( | LwoToEggConverter * | converter,
|  | const LwoSurface * | surface )

Definition at line 33 of file cLwoSurface.cxx.

## ◆ ~CLwoSurface()

CLwoSurface::~CLwoSurface | ( |  | ) |

Definition at line 147 of file cLwoSurface.cxx.

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

References apply_properties(), check_material(), check_texture(), 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 281 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 204 of file cLwoSurface.cxx.

References CLwoClip::is_still_image().

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 18 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 39 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 29 of file cLwoSurface.I.

## Member Data Documentation

## ◆ _backface

bool CLwoSurface::_backface

Definition at line 79 of file cLwoSurface.h.

## ◆ _block

CLwoSurfaceBlock* CLwoSurface::_block

Definition at line 93 of file cLwoSurface.h.

## ◆ _checked_material

bool CLwoSurface::_checked_material

Definition at line 87 of file cLwoSurface.h.

## ◆ _checked_texture

bool CLwoSurface::_checked_texture

Definition at line 90 of file cLwoSurface.h.

## ◆ _color

LColor CLwoSurface::_color

Definition at line 81 of file cLwoSurface.h.

## ◆ _converter

LwoToEggConverter* CLwoSurface::_converter

Definition at line 84 of file cLwoSurface.h.

## ◆ _diffuse

PN_stdfloat CLwoSurface::_diffuse

Definition at line 71 of file cLwoSurface.h.

## ◆ _diffuse_color

LColor CLwoSurface::_diffuse_color

Definition at line 82 of file cLwoSurface.h.

## ◆ _egg_material

PT_EggMaterial CLwoSurface::_egg_material

Definition at line 88 of file cLwoSurface.h.

## ◆ _egg_texture

PT_EggTexture CLwoSurface::_egg_texture

Definition at line 91 of file cLwoSurface.h.

## ◆ _flags

int CLwoSurface::_flags

Definition at line 69 of file cLwoSurface.h.

## ◆ _gloss

PN_stdfloat CLwoSurface::_gloss

Definition at line 76 of file cLwoSurface.h.

## ◆ _luminosity

PN_stdfloat CLwoSurface::_luminosity

Definition at line 72 of file cLwoSurface.h.

## ◆ _reflection

PN_stdfloat CLwoSurface::_reflection

Definition at line 74 of file cLwoSurface.h.

## ◆ _rgb

LRGBColor CLwoSurface::_rgb

Definition at line 70 of file cLwoSurface.h.

## ◆ _smooth_angle

PN_stdfloat CLwoSurface::_smooth_angle

Definition at line 78 of file cLwoSurface.h.

## ◆ _specular

PN_stdfloat CLwoSurface::_specular

Definition at line 73 of file cLwoSurface.h.

## ◆ _translucency

PN_stdfloat CLwoSurface::_translucency

Definition at line 77 of file cLwoSurface.h.

## ◆ _transparency

PN_stdfloat CLwoSurface::_transparency

Definition at line 75 of file cLwoSurface.h.

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

- pandatool/src/lwoegg/cLwoSurface.h
- pandatool/src/lwoegg/cLwoSurface.cxx
- pandatool/src/lwoegg/cLwoSurface.I