Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Lamp::Material Class Reference

マテリアル More...

`#include <Material.h>`

Inheritance diagram for Lamp::Material:

List of all members.

## Public Types
enum | BlendMode { blendModeDisable = 0, blendModeAdd, blendModeSubtract, blendModeInverseSubtract, blendModeMinimum, blendModeMaximum, blendModeMax }
| ブレンドモード
enum | BlendState { blendStateZero = 0, blendStateOne, blendStateSourceColor, blendStateInverseSourceColor, blendStateSourceAlpha, blendStateInverseSourceAlpha, blendStateSourceAlphaSaturate, blendStateDestinationColor, blendStateInverseDestinationColor, blendStateDestinationAlpha, blendStateInverseDestinationAlpha, blendStateMax }
| ブレンドステート
enum | FogOption { fogOptionNone = 0, fogOptionDisable, fogOptionBlack, fogOptionMax }
| フォグオプション
enum | PipelineMode { pipelineModeNone = 0, pipelineModeFixed, pipelineModeProgrammableShader2 }
| パイプラインモード
## Public Member Functions
virtual int | getReferenceCount () const
| リファレンスカウントの取得
virtual Material * | copy (u_int copyMask=0) const=0
| コピー
virtual void | stateChanged ()
| ステート変更フラグを立てる
virtual bool | hasStateChanged () const
| ステート変更フラグの取得
virtual int | getParentCount () const
| 親の数取得
virtual Mesh * | getParent (int index) const
| 親の取得
virtual bool | useLight () const
| ライトを使用するか
virtual void | setPriority (int priority)
| 優先度の設定
virtual int | getPriority () const
| 優先度の取得
virtual void | setBlendMode (BlendMode blendMode)
| ブレンドモードの設定
virtual BlendMode | getBlendMode () const
| ブレンドモードの取得
virtual bool | isBlendEnabled () const
| ブレンドが有効か
virtual void | setAlpha (float alpha)
| アルファの設定
virtual float | getAlpha () const
| アルファの取得
virtual void | setBlendSource (BlendState blendSource)
| ブレンドソースの設定
virtual BlendState | getBlendSource () const
| ブレンドソースの取得
virtual void | setBlendDestination (BlendState blendDestination)
| ブレンドデスティネーションの設定
virtual BlendState | getBlendDestination () const
| ブレンドデスティネーションの取得
virtual void | setZWrite (bool zWrite)
| Z書き込みの設定.
virtual bool | useZWrite () const
| Z書き込みの取得.
virtual void | setZTest (bool zTest)
| Zテストの設定.
virtual bool | useZTest () const
| Zテストの取得.
virtual void | setFogOption (FogOption fogOption)
| フォグオプションの設定
virtual FogOption | getFogOption () const
| フォグオプションの取得
virtual void | setLightMask (u_int lightMask)
| ライトマスクの設定
virtual u_int | getLightMask () const
| ライトマスクの取得
virtual PipelineMode | getPipelineMode () const
| パイプラインモードの取得
virtual bool | initializeGraphicsDeviceObjects ()
| デバイスオブジェクトの初期化
virtual void | deleteGraphicsDeviceObjects ()
| デバイスオブジェクトの削除
virtual bool | restoreGraphicsDeviceObjects ()
| デバイスオブジェクトのリストア
virtual void | invalidateGraphicsDeviceObjects ()
| デバイスオブジェクトの無効化
virtual bool | isMaterial () const
| マテリアルかどうか
virtual bool | isBasicMaterial () const
| 基本マテリアルかどうか
virtual BasicMaterial * | castBasicMaterial () const
| 基本マテリアルへのキャスト
## Static Public Member Functions
int | recursiveDestroy (Material *material)
| 再帰的破棄
const String & | blendModeToString (BlendMode blendMode)
| ブレンドモードから文字列への変換
BlendMode | blendModeFromString (const String &blendModeString)
| 文字列からブレンドモードへの変換
const String & | blendStateToString (BlendState blendState)
| ブレンドステートから文字列への変換
BlendState | blendStateFromString (const String &blendStateString)
| 文字列からブレンドステートへの変換
const String & | fogOptionToString (FogOption fogOption)
| フォグオプションから文字列への変換
FogOption | fogOptionFromString (const String &fogOptionString)
| 文字列からフォグオプションへの変換
## Protected Member Functions
| Material (const String &name, Scene *scene)
| コンストラクタ
virtual | ~Material ()
| デストラクタ
virtual void | copyMaterialValue (Material *destination) const
| マテリアルの値コピー
virtual int | destroyChildren ()=0
| 子の破棄
virtual void | drawSetup (DrawRequest *request)
| 描画のセットアップ
virtual void | draw (DrawRequest *request)=0
| 描画
virtual void | buildStateBlock (Direct3DStateBlock **startBlock, Direct3DStateBlock **endBlock)=0
| ステートブロックの構築
virtual void | releaseStateBlock ()
| ステートブロックの解放
virtual void | setPipelineMode (PipelineMode pipelineMode)
| パイプラインモードの設定
virtual int | addReference (Mesh *parent)
| 参照の追加
virtual int | removeReference (Mesh *parent)
| 参照の削除
virtual Texture * | setTextureReferense (Texture *nowTexture, Texture *newTexture)
| テクスチャリファレンスの設定
## Friends
class | SceneObjectManagerTemplate< Material >
class | MaterialManager
class | Mesh
class | Renderer

## Detailed Description

マテリアル

Definition at line 43 of file Material.h.

## Constructor & Destructor Documentation

Lamp::Material::Material | ( | const String & | name,
|  | Scene * | scene
| ) | `[protected]`

  | コンストラクタ Parameters:
  name | 名前
  scene | シーン
Definition at line 68 of file Material.cpp. References NULL.

## Member Function Documentation

virtual int Lamp::Material::addReference | ( | Mesh * | parent | ) | `[inline, protected, virtual]`

  | 参照の追加 Parameters:
  parent | 親
Returns: 参照カウント Definition at line 498 of file Material.h. References Lamp::ArrayList< Mesh * >::add(), and getParentCount(). Referenced by Lamp::Mesh::setMaterial().

Material::BlendMode Lamp::Material::blendModeFromString | ( | const String & | blendModeString | ) | `[static]`

  | 文字列からブレンドモードへの変換 Parameters:
  blendModeString | ブレンドモード文字列
Returns: ブレンドモード Definition at line 161 of file Material.cpp. References BlendMode, Lamp::String::equals(), and ErrorOut.

const String & Lamp::Material::blendModeToString | ( | BlendMode | blendMode | ) | `[static]`

  | ブレンドモードから文字列への変換 Parameters:
  blendMode | ブレンドモード
Returns: ブレンドモード文字列 Definition at line 154 of file Material.cpp. References Assert.

Material::BlendState Lamp::Material::blendStateFromString | ( | const String & | blendStateString | ) | `[static]`

  | 文字列からブレンドステートへの変換 Parameters:
  blendStateString | ブレンドステート文字列
Returns: ブレンドステート Definition at line 180 of file Material.cpp. References BlendState, Lamp::String::equals(), and ErrorOut.

const String & Lamp::Material::blendStateToString | ( | BlendState | blendState | ) | `[static]`

  | ブレンドステートから文字列への変換 Parameters:
  blendState | ブレンドステート
Returns: ブレンドステート文字列 Definition at line 173 of file Material.cpp. References Assert.

virtual void Lamp::Material::buildStateBlock | ( | Direct3DStateBlock ** | startBlock,
|  | Direct3DStateBlock ** | endBlock
| ) | `[protected, pure virtual]`

  | ステートブロックの構築 Parameters:
  startBlock | [out]開始ステートブロック
  endBlock | [out]終了ステートブロック
Implemented in Lamp::BasicMaterial. Referenced by restoreGraphicsDeviceObjects().

virtual BasicMaterial* Lamp::Material::castBasicMaterial | ( |  | ) | const`[inline, virtual]`

| 基本マテリアルへのキャスト Returns: 基本マテリアル。型が違えばNULLを返す。 Definition at line 420 of file Material.h. References isBasicMaterial(), and NULL. Referenced by Lamp::TextSceneLoader::readBasicMaterialLink(), Lamp::BinarySceneLoader::readBasicMaterialLink(), Lamp::TextSceneSaver::writeMaterialLinkList(), Lamp::BinarySceneSaver::writeMaterialLinkList(), Lamp::TextSceneSaver::writeMaterialList(), and Lamp::BinarySceneSaver::writeMaterialList().

virtual Material* Lamp::Material::copy | ( | u_int | copyMask = 0 | ) | const`[pure virtual]`

  | コピー Parameters:
  copyMask | コピーマスク
Returns: コピーされたマテリアル Implemented in Lamp::BasicMaterial. Referenced by Lamp::Mesh::copyMeshValue().

void Lamp::Material::copyMaterialValue | ( | Material * | destination | ) | const`[protected, virtual]`

  | マテリアルの値コピー Parameters:
  destination | コピー先マテリアル
Definition at line 83 of file Material.cpp. References setAlpha(), setBlendDestination(), setBlendMode(), setBlendSource(), setFogOption(), setLightMask(), setPriority(), setZTest(), and setZWrite(). Referenced by Lamp::BasicMaterial::copyBasicMaterial().

virtual int Lamp::Material::destroyChildren | ( |  | ) | `[protected, pure virtual]`

| 子の破棄 Returns: 破棄したオブジェクト数 Implemented in Lamp::BasicMaterial. Referenced by recursiveDestroy().

virtual void Lamp::Material::draw | ( | DrawRequest * | request | ) | `[protected, pure virtual]`

  | 描画 Parameters:
  request | 描画リクエスト
Implemented in Lamp::BasicMaterial. Referenced by Lamp::Renderer::rendering().

void Lamp::Material::drawSetup | ( | DrawRequest * | request | ) | `[protected, virtual]`

  | 描画のセットアップ Parameters:
  request | 描画リクエスト
Definition at line 140 of file Material.cpp. References drawEnd(), Lamp::DrawRequest::getPreMaterial(), Lamp::DrawRequest::isMaterialChanged(), and NULL. Referenced by Lamp::BasicMaterial::draw().

Material::FogOption Lamp::Material::fogOptionFromString | ( | const String & | fogOptionString | ) | `[static]`

  | 文字列からフォグオプションへの変換 Parameters:
  fogOptionString | フォグオプション文字列
Returns: フォグオプション Definition at line 199 of file Material.cpp. References Lamp::String::equals(), ErrorOut, and FogOption.

const String & Lamp::Material::fogOptionToString | ( | FogOption | fogOption | ) | `[static]`

  | フォグオプションから文字列への変換 Parameters:
  fogOption | フォグオプション
Returns: フォグオプション文字列 Definition at line 192 of file Material.cpp. References Assert.

virtual float Lamp::Material::getAlpha | ( |  | ) | const`[inline, virtual]`

| アルファの取得 Returns: アルファ Definition at line 190 of file Material.h. Referenced by Lamp::BasicShaderFixed::buildStateBlock(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual BlendState Lamp::Material::getBlendDestination | ( |  | ) | const`[inline, virtual]`

| ブレンドデスティネーションの取得 Returns: ブレンドデスティネーション Definition at line 257 of file Material.h. References BlendState. Referenced by Lamp::Shader::buildMaterialStart(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual BlendMode Lamp::Material::getBlendMode | ( |  | ) | const`[inline, virtual]`

| ブレンドモードの取得 Returns: ブレンドモード Definition at line 166 of file Material.h. References BlendMode. Referenced by Lamp::Shader::buildMaterialStart(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual BlendState Lamp::Material::getBlendSource | ( |  | ) | const`[inline, virtual]`

| ブレンドソースの取得 Returns: ブレンドソース Definition at line 239 of file Material.h. References BlendState. Referenced by Lamp::Shader::buildMaterialStart(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual FogOption Lamp::Material::getFogOption | ( |  | ) | const`[inline, virtual]`

| フォグオプションの取得 Returns: フォグオプション Definition at line 336 of file Material.h. References FogOption. Referenced by Lamp::FixedShader::resetFogOptionFixed(), Lamp::FixedShader::setFogOptionFixed(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual u_int Lamp::Material::getLightMask | ( |  | ) | const`[inline, virtual]`

| ライトマスクの取得 Returns: ライトマスク Definition at line 351 of file Material.h. References u_int. Referenced by Lamp::DrawRequest::getAmbientColor(), Lamp::Scene::getLocalLightList(), Lamp::CollisionConverter::setCollisionLeafData(), Lamp::FixedShader::setupFixedLight(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual Mesh* Lamp::Material::getParent | ( | int | index | ) | const`[inline, virtual]`

  | 親の取得 Parameters:
  index | 親のインデックス
Returns: 親 Definition at line 95 of file Material.h. References Assert, Lamp::ArrayList< Mesh * >::get(), and getParentCount().

virtual int Lamp::Material::getParentCount | ( |  | ) | const`[inline, virtual]`

| 親の数取得 Returns: 親の数 Definition at line 88 of file Material.h. References Lamp::ArrayList< Mesh * >::getCount(). Referenced by addReference(), getParent(), and removeReference().

virtual PipelineMode Lamp::Material::getPipelineMode | ( |  | ) | const`[inline, virtual]`

| パイプラインモードの取得 Returns: パイプラインモード Definition at line 367 of file Material.h. References Assert, and PipelineMode. Referenced by Lamp::DrawRequest::isPipelineModeChanged().

virtual int Lamp::Material::getPriority | ( |  | ) | const`[inline, virtual]`

| 優先度の取得 Returns: 優先度 Definition at line 122 of file Material.h. Referenced by Lamp::Renderer::sortMeshList(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual int Lamp::Material::getReferenceCount | ( |  | ) | const`[inline, virtual]`

| リファレンスカウントの取得 Returns: リファレンスカウント Implements Lamp::SceneObject. Definition at line 54 of file Material.h. References Lamp::ArrayList< Mesh * >::getCount(). Referenced by Lamp::SceneLogicCheckFilter::filterMaterial(), and recursiveDestroy().

virtual bool Lamp::Material::hasStateChanged | ( |  | ) | const`[inline, virtual]`

| ステート変更フラグの取得 Returns: ステート変更フラグ Definition at line 81 of file Material.h.

virtual bool Lamp::Material::initializeGraphicsDeviceObjects | ( |  | ) | `[inline, virtual]`

| デバイスオブジェクトの初期化 Returns: 成功したらtrueを返す Implements Lamp::GraphicsDeviceObjectHolder. Definition at line 379 of file Material.h. Referenced by Lamp::MaterialManager::initializeGraphicsDeviceObjects().

virtual bool Lamp::Material::isBasicMaterial | ( |  | ) | const`[inline, virtual]`

| 基本マテリアルかどうか Returns: 基本マテリアルならtrue Reimplemented in Lamp::BasicMaterial. Definition at line 414 of file Material.h. Referenced by castBasicMaterial(), Lamp::TextSceneSaver::writeMaterialLinkList(), Lamp::BinarySceneSaver::writeMaterialLinkList(), Lamp::TextSceneSaver::writeMaterialList(), and Lamp::BinarySceneSaver::writeMaterialList().

virtual bool Lamp::Material::isBlendEnabled | ( |  | ) | const`[inline, virtual]`

| ブレンドが有効か Returns: ブレンドが有効ならtrue Definition at line 172 of file Material.h. Referenced by Lamp::Shader::buildMaterialStart(), Lamp::DrawRequest::isBlendEnabled(), and Lamp::Renderer::sortMeshList().

virtual bool Lamp::Material::isMaterial | ( |  | ) | const`[inline, virtual]`

| マテリアルかどうか Returns: マテリアルならtrue Reimplemented from Lamp::SceneObject. Definition at line 407 of file Material.h.

int Lamp::Material::recursiveDestroy | ( | Material * | material | ) | `[static]`

  | 再帰的破棄 Parameters:
  material | 破棄するマテリアル
Returns: 破棄したオブジェクト数 Definition at line 96 of file Material.cpp. References Assert, Lamp::SceneObjectManagerTemplate< Material >::destroy(), destroyChildren(), Lamp::Scene::getMaterialManager(), getReferenceCount(), Lamp::SceneObject::getScene(), and NULL.

virtual int Lamp::Material::removeReference | ( | Mesh * | parent | ) | `[inline, protected, virtual]`

  | 参照の削除 Parameters:
  parent | 親
Returns: 参照カウント Definition at line 508 of file Material.h. References getParentCount(), and Lamp::ArrayList< Mesh * >::removeByValue(). Referenced by Lamp::Mesh::setMaterial().

virtual bool Lamp::Material::restoreGraphicsDeviceObjects | ( |  | ) | `[inline, virtual]`

| デバイスオブジェクトのリストア Returns: 成功したらtrueを返す Implements Lamp::GraphicsDeviceObjectHolder. Definition at line 390 of file Material.h. References buildStateBlock(). Referenced by Lamp::MaterialManager::restoreGraphicsDeviceObjects().

virtual void Lamp::Material::setAlpha | ( | float | alpha | ) | `[inline, virtual]`

  | アルファの設定 Parameters:
  alpha | アルファ
Definition at line 181 of file Material.h. References stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setBlendDestination | ( | BlendState | blendDestination | ) | `[inline, virtual]`

  | ブレンドデスティネーションの設定 Parameters:
  blendDestination | ブレンドデスティネーション
Definition at line 246 of file Material.h. References Assert, and stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setBlendMode | ( | BlendMode | blendMode | ) | `[inline, virtual]`

  | ブレンドモードの設定 Parameters:
  blendMode | ブレンドモード
Definition at line 157 of file Material.h. References stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setBlendSource | ( | BlendState | blendSource | ) | `[inline, virtual]`

  | ブレンドソースの設定 Parameters:
  blendSource | ブレンドソース
Definition at line 228 of file Material.h. References Assert, and stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setFogOption | ( | FogOption | fogOption | ) | `[inline, virtual]`

  | フォグオプションの設定 Parameters:
  fogOption | フォグオプション
Definition at line 325 of file Material.h. References Assert, and stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setLightMask | ( | u_int | lightMask | ) | `[inline, virtual]`

  | ライトマスクの設定 Parameters:
  lightMask | ライトマスク
Definition at line 345 of file Material.h. Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setPipelineMode | ( | PipelineMode | pipelineMode | ) | `[inline, protected, virtual]`

  | パイプラインモードの設定 Parameters:
  pipelineMode | パイプラインモード
Definition at line 487 of file Material.h. References Assert. Referenced by Lamp::BasicMaterial::buildStateBlock(), and Lamp::BasicMaterial::draw().

virtual void Lamp::Material::setPriority | ( | int | priority | ) | `[inline, virtual]`

  | 優先度の設定 Parameters:
  priority | 優先度
Definition at line 113 of file Material.h. References stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

Texture * Lamp::Material::setTextureReferense | ( | Texture * | nowTexture,
|  | Texture * | newTexture
| ) | `[protected, virtual]`

  | テクスチャリファレンスの設定 Parameters:
  nowTexture | 現在のテクスチャ
  newTexture | 新しいテクスチャ
Returns: 新しいテクスチャ Definition at line 213 of file Material.cpp. References Lamp::Texture::addReference(), NULL, Lamp::Texture::removeReference(), and stateChanged(). Referenced by Lamp::BasicMaterial::setBaseTexture(), Lamp::BasicMaterial::setGlossTexture(), Lamp::BasicMaterial::setLightTexture(), and Lamp::BasicMaterial::setStainTexture().

virtual void Lamp::Material::setZTest | ( | bool | zTest | ) | `[inline, virtual]`

  | Zテストの設定. Parameters:
  zTest | Zテストを行うならtrue
Definition at line 284 of file Material.h. References stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual void Lamp::Material::setZWrite | ( | bool | zWrite | ) | `[inline, virtual]`

  | Z書き込みの設定. Parameters:
  zWrite | Z書き込みを行うならtrue
Definition at line 268 of file Material.h. References stateChanged(). Referenced by copyMaterialValue(), Lamp::TextSceneLoader::readMaterial(), and Lamp::BinarySceneLoader::readMaterial().

virtual bool Lamp::Material::useLight | ( |  | ) | const`[inline, virtual]`

| ライトを使用するか Returns: ライトを使用するならtrue Definition at line 106 of file Material.h. Referenced by Lamp::Renderer::rendering(), and Lamp::FixedShader::setupFixedLight().

virtual bool Lamp::Material::useZTest | ( |  | ) | const`[inline, virtual]`

| Zテストの取得. Returns: Zテストを行うならtrue Definition at line 293 of file Material.h. Referenced by Lamp::Shader::buildMaterialStart(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

virtual bool Lamp::Material::useZWrite | ( |  | ) | const`[inline, virtual]`

| Z書き込みの取得. Returns: Z書き込みを行うならtrue Definition at line 277 of file Material.h. Referenced by Lamp::Shader::buildMaterialStart(), Lamp::TextSceneSaver::writeMaterial(), and Lamp::BinarySceneSaver::writeMaterial().

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

- Material.h
- Material.cpp