Panda3D
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
panda
src
egg2pg
eggRenderState.h
1
// Filename: eggRenderState.h
2
// Created by: drose (12Mar05)
3
//
4
////////////////////////////////////////////////////////////////////
5
//
6
// PANDA 3D SOFTWARE
7
// Copyright (c) Carnegie Mellon University. All rights reserved.
8
//
9
// All use of this software is subject to the terms of the revised BSD
10
// license. You should have received a copy of this license along
11
// with this source code in a file named "LICENSE."
12
//
13
////////////////////////////////////////////////////////////////////
14
15
#ifndef EGGRENDERSTATE_H
16
#define EGGRENDERSTATE_H
17
18
#include "pandabase.h"
19
20
#include "eggUserData.h"
21
#include "eggLoader.h"
22
#include "renderState.h"
23
#include "renderAttrib.h"
24
#include "internalName.h"
25
#include "geomPrimitive.h"
26
#include "luse.h"
27
#include "pointerTo.h"
28
#include "pvector.h"
29
#include "pmap.h"
30
31
class
EggPrimitive
;
32
class
EggTexture
;
33
class
EggMaterial
;
34
35
////////////////////////////////////////////////////////////////////
36
// Class : EggRenderState
37
// Description : This class is used within this package only to record
38
// the render state that should be assigned to each
39
// primitive. It is assigned to EggPrimitive objects
40
// via the EggBinner.
41
////////////////////////////////////////////////////////////////////
42
class
EggRenderState
:
public
EggUserData
{
43
public
:
44
INLINE
EggRenderState
(
EggLoader
&loader);
45
INLINE
void
add_attrib
(
const
RenderAttrib
*attrib);
46
47
void
fill_state
(
EggPrimitive
*egg_prim);
48
49
int
compare_to
(
const
EggRenderState &other)
const
;
50
51
private
:
52
CPT(
RenderAttrib
) get_material_attrib(
const
EggMaterial
*egg_mat,
53
bool
bface);
54
static
TexGenAttrib::Mode get_tex_gen(
const
EggTexture
*egg_tex);
55
56
CPT(
RenderAttrib
)
57
apply_tex_mat(CPT(
RenderAttrib
) tex_mat_attrib,
58
TextureStage
*stage,
const
EggTexture
*egg_tex);
59
60
public
:
61
CPT(
RenderState
) _state;
62
bool
_hidden;
63
bool
_flat_shaded;
64
Geom::PrimitiveType _primitive_type;
65
66
typedef
EggLoader::BakeInUVs
BakeInUVs
;
67
typedef
EggLoader::TextureDef TextureDef;
68
typedef
EggLoader::Materials
Materials
;
69
70
BakeInUVs
_bake_in_uvs;
71
72
private
:
73
EggLoader
&_loader;
74
75
typedef
pvector<const TextureDef *>
TexMatTextures
;
76
typedef
pmap<LMatrix4d, TexMatTextures>
TexMatTransforms
;
77
typedef
pmap<CPT(InternalName), TexMatTransforms>
TexMats
;
78
};
79
80
#include "eggRenderState.I"
81
82
#endif
83
EggPrimitive
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
Definition:
eggPrimitive.h:51
pmap< CPT(InternalName), const EggTexture * >
RenderAttrib
This is the base class for a number of render attributes (other than transform) that may be set on sc...
Definition:
renderAttrib.h:60
EggTexture
Defines a texture map that may be applied to geometry.
Definition:
eggTexture.h:33
EggRenderState::fill_state
void fill_state(EggPrimitive *egg_prim)
Sets up the state as appropriate for the indicated primitive.
Definition:
eggRenderState.cxx:49
pvector
This is our own Panda specialization on the default STL vector.
Definition:
pvector.h:39
EggRenderState
This class is used within this package only to record the render state that should be assigned to eac...
Definition:
eggRenderState.h:42
EggMaterial
Definition:
eggMaterial.h:28
EggRenderState::add_attrib
void add_attrib(const RenderAttrib *attrib)
A convenience function to add the indicated render attribute to the aggregate state.
Definition:
eggRenderState.I:38
RenderState
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition:
renderState.h:53
EggRenderState::compare_to
int compare_to(const EggRenderState &other) const
Provides a unique ordering for different EggRenderState objects, so that primitives of similar state ...
Definition:
eggRenderState.cxx:436
TextureStage
Defines the properties of a named stage of the multitexture pipeline.
Definition:
textureStage.h:38
EggUserData
This is a base class for a user-defined data type to extend egg structures in processing code...
Definition:
eggUserData.h:34
EggLoader
Converts an egg data structure, possibly read from an egg file but not necessarily, into a scene graph suitable for rendering.
Definition:
eggLoader.h:70
Generated on Mon Feb 1 2016 13:44:23 for Panda3D by
1.8.5