Blender V2.61 - r43446
|
#include <RAS_IPolygonMaterial.h>
Public Types | |
enum | MaterialFlags { BILLBOARD_SCREENALIGNED = 512, BILLBOARD_AXISALIGNED = 1024, SHADOW = 2048 } |
typedef void * | TCachingInfo |
Public Member Functions | |
RAS_IPolyMaterial () | |
RAS_IPolyMaterial (const STR_String &texname, const STR_String &matname, int materialindex, int tile, int tilexrep, int tileyrep, int transp, bool alpha, bool zsort) | |
void | Initialize (const STR_String &texname, const STR_String &matname, int materialindex, int tile, int tilexrep, int tileyrep, int transp, bool alpha, bool zsort, bool light, bool image, struct GameSettings *game) |
virtual | ~RAS_IPolyMaterial () |
virtual TCachingInfo | GetCachingInfo (void) const |
virtual bool | Activate (RAS_IRasterizer *rasty, TCachingInfo &cachingInfo) const |
virtual void | ActivateMeshSlot (const class RAS_MeshSlot &ms, RAS_IRasterizer *rasty) const |
virtual bool | Equals (const RAS_IPolyMaterial &lhs) const |
bool | Less (const RAS_IPolyMaterial &rhs) const |
bool | IsAlpha () const |
bool | IsZSort () const |
unsigned int | hash () const |
int | GetDrawingMode () const |
const STR_String & | GetMaterialName () const |
dword | GetMaterialNameHash () const |
const STR_String & | GetTextureName () const |
unsigned int | GetFlag () const |
int | GetMaterialIndex () const |
virtual Material * | GetBlenderMaterial () const |
virtual Image * | GetBlenderImage () const |
virtual Scene * | GetBlenderScene () const |
virtual void | ReleaseMaterial () |
virtual void | GetMaterialRGBAColor (unsigned char *rgba) const |
virtual bool | UsesLighting (RAS_IRasterizer *rasty) const |
virtual bool | UsesObjectColor () const |
virtual bool | CastsShadows () const |
virtual void | Replace_IScene (SCA_IScene *val) |
int | ConvertFaceMode (struct GameSettings *game, bool image) const |
virtual void | OnConstruction (int layer) |
Public Attributes | |
MT_Vector3 | m_diffuse |
float | m_shininess |
MT_Vector3 | m_specular |
float | m_specularity |
Protected Attributes | |
STR_HashedString | m_texturename |
STR_HashedString | m_materialname |
int | m_tile |
int | m_tilexrep |
int | m_tileyrep |
int | m_drawingmode |
int | m_alphablend |
bool | m_alpha |
bool | m_zsort |
bool | m_light |
int | m_materialindex |
unsigned int | m_polymatid |
unsigned int | m_flag |
int | m_multimode |
Static Protected Attributes | |
static unsigned int | m_newpolymatid = 0 |
Polygon Material on which the material buckets are sorted
Definition at line 72 of file RAS_IPolygonMaterial.h.
typedef void* RAS_IPolyMaterial::TCachingInfo |
Used to store caching information for materials.
Definition at line 100 of file RAS_IPolygonMaterial.h.
Definition at line 103 of file RAS_IPolygonMaterial.h.
RAS_IPolyMaterial::RAS_IPolyMaterial | ( | ) |
Definition at line 74 of file RAS_IPolygonMaterial.cpp.
References m_diffuse, m_shininess, m_specular, and m_specularity.
RAS_IPolyMaterial::RAS_IPolyMaterial | ( | const STR_String & | texname, |
const STR_String & | matname, | ||
int | materialindex, | ||
int | tile, | ||
int | tilexrep, | ||
int | tileyrep, | ||
int | transp, | ||
bool | alpha, | ||
bool | zsort | ||
) |
Definition at line 96 of file RAS_IPolygonMaterial.cpp.
References m_diffuse, m_shininess, m_specular, and m_specularity.
virtual RAS_IPolyMaterial::~RAS_IPolyMaterial | ( | ) | [inline, virtual] |
Definition at line 133 of file RAS_IPolygonMaterial.h.
virtual bool RAS_IPolyMaterial::Activate | ( | RAS_IRasterizer * | rasty, |
TCachingInfo & | cachingInfo | ||
) | const [inline, virtual] |
Activates the material in the rasterizer. On entry, the cachingInfo contains info about the last activated material. On exit, the cachingInfo should contain updated info about this material.
rasty | The rasterizer in which the material should be active. |
cachingInfo | The information about the material used to speed up rasterizing. |
Reimplemented in KX_BlenderMaterial, and KX_PolygonMaterial.
Definition at line 149 of file RAS_IPolygonMaterial.h.
Referenced by RAS_OpenGLRasterizer::SetMaterial().
virtual void RAS_IPolyMaterial::ActivateMeshSlot | ( | const class RAS_MeshSlot & | ms, |
RAS_IRasterizer * | rasty | ||
) | const [inline, virtual] |
Definition at line 153 of file RAS_IPolygonMaterial.h.
Referenced by RAS_MaterialBucket::RenderMeshSlot().
bool RAS_IPolyMaterial::CastsShadows | ( | ) | const [virtual] |
Definition at line 267 of file RAS_IPolygonMaterial.cpp.
References m_flag, and RAS_CASTSHADOW.
Referenced by RAS_MaterialBucket::ActivateMaterial().
int RAS_IPolyMaterial::ConvertFaceMode | ( | struct GameSettings * | game, |
bool | image | ||
) | const |
Definition at line 157 of file RAS_IPolygonMaterial.cpp.
References GameSettings::alpha_blend, GameSettings::face_orientation, GameSettings::flag, GEMAT_BACKCULL, GEMAT_TEX, and GEMAT_TEXT.
Referenced by Initialize().
bool RAS_IPolyMaterial::Equals | ( | const RAS_IPolyMaterial & | lhs | ) | const [virtual] |
Definition at line 125 of file RAS_IPolygonMaterial.cpp.
References STR_HashedString::hash(), m_alpha, m_alphablend, m_drawingmode, m_flag, m_light, m_materialname, m_multimode, m_texturename, m_tile, m_tilexrep, m_tileyrep, m_zsort, RAS_BLENDERMAT, and rna_array::test.
Referenced by Less(), and operator==().
Image * RAS_IPolyMaterial::GetBlenderImage | ( | ) | const [virtual] |
Reimplemented in KX_PolygonMaterial.
Definition at line 234 of file RAS_IPolygonMaterial.cpp.
References NULL.
Referenced by RAS_OpenGLRasterizer::IndexPrimitivesInternal().
Material * RAS_IPolyMaterial::GetBlenderMaterial | ( | ) | const [virtual] |
Reimplemented in KX_BlenderMaterial, and KX_PolygonMaterial.
Definition at line 229 of file RAS_IPolygonMaterial.cpp.
References NULL.
Referenced by RAS_OpenGLRasterizer::IndexPrimitivesInternal().
Scene * RAS_IPolyMaterial::GetBlenderScene | ( | ) | const [virtual] |
Definition at line 239 of file RAS_IPolygonMaterial.cpp.
References NULL.
Referenced by RAS_OpenGLRasterizer::IndexPrimitivesInternal().
virtual TCachingInfo RAS_IPolyMaterial::GetCachingInfo | ( | void | ) | const [inline, virtual] |
Returns the caching information for this material, This can be used to speed up the rasterizing process.
Reimplemented in KX_BlenderMaterial, and KX_PolygonMaterial.
Definition at line 140 of file RAS_IPolygonMaterial.h.
int RAS_IPolyMaterial::GetDrawingMode | ( | ) | const |
Definition at line 204 of file RAS_IPolygonMaterial.cpp.
References m_drawingmode.
Referenced by RAS_OpenGLRasterizer::IndexPrimitives_3DText(), RAS_OpenGLRasterizer::IndexPrimitivesInternal(), and RAS_MaterialBucket::RenderMeshSlot().
unsigned int RAS_IPolyMaterial::GetFlag | ( | ) | const |
Definition at line 248 of file RAS_IPolygonMaterial.cpp.
References m_flag.
Referenced by RAS_MeshObject::AddMeshUser(), KX_BlenderSceneConverter::FreeBlendFile(), RAS_OpenGLRasterizer::IndexPrimitivesInternal(), RAS_MaterialBucket::RenderMeshSlot(), KX_BlenderRenderTools::RenderText(), GPC_RenderTools::RenderText(), Texture_init(), and KX_GameObject::UpdateMaterialData().
int RAS_IPolyMaterial::GetMaterialIndex | ( | ) | const |
Definition at line 224 of file RAS_IPolygonMaterial.cpp.
References m_materialindex.
Referenced by RAS_MeshObject::AddMeshUser(), and RAS_OpenGLRasterizer::IndexPrimitivesInternal().
const STR_String & RAS_IPolyMaterial::GetMaterialName | ( | ) | const |
Definition at line 209 of file RAS_IPolygonMaterial.cpp.
References m_materialname.
Referenced by getMaterialID(), and RAS_MeshObject::GetMaterialName().
dword RAS_IPolyMaterial::GetMaterialNameHash | ( | ) | const |
Definition at line 214 of file RAS_IPolygonMaterial.cpp.
References STR_HashedString::hash(), and m_materialname.
Referenced by KX_GameObject::UpdateMaterialData().
void RAS_IPolyMaterial::GetMaterialRGBAColor | ( | unsigned char * | rgba | ) | const [virtual] |
Reimplemented in KX_PolygonMaterial.
Definition at line 173 of file RAS_IPolygonMaterial.cpp.
Referenced by CheckTexDM().
const STR_String & RAS_IPolyMaterial::GetTextureName | ( | ) | const |
Definition at line 219 of file RAS_IPolygonMaterial.cpp.
References m_texturename.
Referenced by getMaterialID(), and RAS_MeshObject::GetTextureName().
unsigned int RAS_IPolyMaterial::hash | ( | ) | const |
Definition at line 199 of file RAS_IPolygonMaterial.cpp.
References STR_HashedString::hash(), and m_texturename.
void RAS_IPolyMaterial::Initialize | ( | const STR_String & | texname, |
const STR_String & | matname, | ||
int | materialindex, | ||
int | tile, | ||
int | tilexrep, | ||
int | tileyrep, | ||
int | transp, | ||
bool | alpha, | ||
bool | zsort, | ||
bool | light, | ||
bool | image, | ||
struct GameSettings * | game | ||
) |
Definition at line 40 of file RAS_IPolygonMaterial.cpp.
References ConvertFaceMode(), m_alpha, m_alphablend, m_diffuse, m_drawingmode, m_flag, m_light, m_materialindex, m_materialname, m_multimode, m_newpolymatid, m_polymatid, m_shininess, m_specular, m_specularity, m_texturename, m_tile, m_tilexrep, m_tileyrep, m_zsort, and MT_Tuple3::setValue().
bool RAS_IPolyMaterial::IsAlpha | ( | ) | const |
Definition at line 189 of file RAS_IPolygonMaterial.cpp.
References m_alpha, and m_zsort.
Referenced by RAS_MaterialBucket::IsAlpha().
bool RAS_IPolyMaterial::IsZSort | ( | ) | const |
Definition at line 194 of file RAS_IPolygonMaterial.cpp.
References m_zsort.
Referenced by RAS_MaterialBucket::IsZSort().
bool RAS_IPolyMaterial::Less | ( | const RAS_IPolyMaterial & | rhs | ) | const |
Definition at line 181 of file RAS_IPolygonMaterial.cpp.
References Equals(), and m_polymatid.
Referenced by operator<().
virtual void RAS_IPolyMaterial::OnConstruction | ( | int | layer | ) | [inline, virtual] |
Reimplemented in KX_BlenderMaterial.
Definition at line 187 of file RAS_IPolygonMaterial.h.
void RAS_IPolyMaterial::ReleaseMaterial | ( | ) | [virtual] |
Definition at line 244 of file RAS_IPolygonMaterial.cpp.
virtual void RAS_IPolyMaterial::Replace_IScene | ( | SCA_IScene * | val | ) | [inline, virtual] |
Reimplemented in KX_BlenderMaterial.
Definition at line 177 of file RAS_IPolygonMaterial.h.
Referenced by KX_BlenderSceneConverter::MergeScene().
bool RAS_IPolyMaterial::UsesLighting | ( | RAS_IRasterizer * | rasty | ) | const [virtual] |
Definition at line 253 of file RAS_IPolygonMaterial.cpp.
References RAS_IRasterizer::GetDrawingMode(), RAS_IRasterizer::KX_SHADOW, RAS_IRasterizer::KX_SOLID, m_flag, m_light, RAS_BLENDERMAT, and RAS_MULTILIGHT.
Referenced by RAS_MaterialBucket::ActivateMaterial().
bool RAS_IPolyMaterial::UsesObjectColor | ( | ) | const [virtual] |
Definition at line 272 of file RAS_IPolygonMaterial.cpp.
References m_flag, and RAS_BLENDERGLSL.
Referenced by RAS_MaterialBucket::RenderMeshSlot().
bool RAS_IPolyMaterial::m_alpha [protected] |
Definition at line 82 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), Initialize(), and IsAlpha().
int RAS_IPolyMaterial::m_alphablend [protected] |
Definition at line 81 of file RAS_IPolygonMaterial.h.
Referenced by KX_PolygonMaterial::DefaultActivate(), Equals(), and Initialize().
Definition at line 94 of file RAS_IPolygonMaterial.h.
Referenced by BL_ConvertMesh(), KX_PolygonMaterial::DefaultActivate(), Initialize(), and RAS_IPolyMaterial().
int RAS_IPolyMaterial::m_drawingmode [protected] |
Definition at line 80 of file RAS_IPolygonMaterial.h.
Referenced by KX_PolygonMaterial::DefaultActivate(), Equals(), GetDrawingMode(), and Initialize().
unsigned int RAS_IPolyMaterial::m_flag [protected] |
Definition at line 91 of file RAS_IPolygonMaterial.h.
Referenced by CastsShadows(), Equals(), GetFlag(), KX_BlenderMaterial::Initialize(), Initialize(), UsesLighting(), and UsesObjectColor().
bool RAS_IPolyMaterial::m_light [protected] |
Definition at line 84 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), Initialize(), and UsesLighting().
int RAS_IPolyMaterial::m_materialindex [protected] |
Definition at line 85 of file RAS_IPolygonMaterial.h.
Referenced by GetMaterialIndex(), and Initialize().
STR_HashedString RAS_IPolyMaterial::m_materialname [protected] |
Definition at line 77 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), GetMaterialName(), GetMaterialNameHash(), and Initialize().
int RAS_IPolyMaterial::m_multimode [protected] |
Definition at line 92 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), KX_BlenderMaterial::Initialize(), and Initialize().
unsigned int RAS_IPolyMaterial::m_newpolymatid = 0 [static, protected] |
Definition at line 88 of file RAS_IPolygonMaterial.h.
Referenced by Initialize().
unsigned int RAS_IPolyMaterial::m_polymatid [protected] |
Definition at line 87 of file RAS_IPolygonMaterial.h.
Referenced by Initialize(), and Less().
Definition at line 95 of file RAS_IPolygonMaterial.h.
Referenced by BL_ConvertMesh(), KX_PolygonMaterial::DefaultActivate(), Initialize(), and RAS_IPolyMaterial().
Definition at line 96 of file RAS_IPolygonMaterial.h.
Referenced by BL_ConvertMesh(), KX_PolygonMaterial::DefaultActivate(), Initialize(), and RAS_IPolyMaterial().
Definition at line 97 of file RAS_IPolygonMaterial.h.
Referenced by KX_PolygonMaterial::DefaultActivate(), Initialize(), and RAS_IPolyMaterial().
STR_HashedString RAS_IPolyMaterial::m_texturename [protected] |
Definition at line 76 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), GetTextureName(), hash(), and Initialize().
int RAS_IPolyMaterial::m_tile [protected] |
Definition at line 78 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), and Initialize().
int RAS_IPolyMaterial::m_tilexrep [protected] |
Definition at line 79 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), and Initialize().
int RAS_IPolyMaterial::m_tileyrep [protected] |
Definition at line 79 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), and Initialize().
bool RAS_IPolyMaterial::m_zsort [protected] |
Definition at line 83 of file RAS_IPolygonMaterial.h.
Referenced by Equals(), Initialize(), IsAlpha(), and IsZSort().