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

Lamp::CharacterModel Class Reference

キャラクタモデル More...

#include <CharacterModel.h>

Inheritance diagram for Lamp::CharacterModel:

Lamp::Model Lamp::SceneLeaf Lamp::SceneObject List of all members.

Public Member Functions

virtual bool isCharacterModel () const
 キャラクタモデルかどうか

virtual SceneLeafcopy (u_int copyMask=0) const
 コピー

virtual ModelcopyModel (u_int copyMask=0) const
 モデルのコピー

virtual CharacterModelcopyCharacterModel (u_int copyMask=0) const
 キャラクタモデルのコピー

virtual void buildBoneMatrix (bool forceCalculation=false)
 ボーン行列の構築

virtual bool isBoneScaled () const
 ボーンにスケールが含まれるか

virtual const Matrix34getPositionDeformMatrixArray (bool forceCalculation=false)
 位置変形行列配列の取得

virtual const Matrix33getNormalDeformMatrixArray (bool forceCalculation=false)
 法線変形行列配列の取得

virtual BonecreateBone (const String &boneName)
 ボーンの作成

virtual void destroyBone (Bone *bone)
 ボーンの破棄

virtual int clearBone ()
 ボーンのクリア

virtual int getBoneCount () const
 ボーン数の取得

virtual BonegetBone (int index) const
 ボーンの取得

virtual int getBoneIndex (Bone *bone) const
 ボーンインデックスの取得

virtual BonesearchBone (const String &boneName) const
 ボーンの検索

virtual void addMesh (Mesh *mesh)
 メッシュの追加


Static Public Attributes

const int maxBoneCount = 64
 最大ボーン数


Protected Member Functions

 CharacterModel (const String &name, Scene *scene)
 コンストラクタ

virtual ~CharacterModel ()
 デストラクタ

virtual void buildDeformMatrixArray ()
 変形行列配列の構築


Protected Attributes

HashMap< String, Bone * > boneHash_
 ボーンハッシュ

ArrayList< Bone * > boneArray_
 ボーン配列

Matrix34positionDeformMatrixArray_
 位置変形行列配列

Matrix33normalDeformMatrixArray_
 法線変形行列配列

int deformMatrixArraySize_
 変形行列配列サイズ

int buildBoneMatrixTick_
 ボーン行列の構築チック

int deformMatrixArrayTick_
 変形行列配列チック

bool boneScaled_
 ボーンにスケールが含まれるか


Friends

class ModelManager

Detailed Description

キャラクタモデル

Definition at line 37 of file CharacterModel.h.


Constructor & Destructor Documentation

Lamp::CharacterModel::CharacterModel const String name,
Scene scene
[protected]
 

コンストラクタ

Parameters:
name 名前
scene シーン

Definition at line 35 of file CharacterModel.cpp.

References buildBoneMatrixTick_, deformMatrixArrayTick_, Lamp::Scene::getTick(), NULL, and Lamp::SceneObject::scene_.


Member Function Documentation

void Lamp::CharacterModel::addMesh Mesh mesh  )  [virtual]
 

メッシュの追加

Parameters:
mesh 追加するメッシュ

Reimplemented from Lamp::Model.

Definition at line 178 of file CharacterModel.cpp.

References Assert, and Lamp::Mesh::isCharacterMesh().

void Lamp::CharacterModel::buildBoneMatrix bool  forceCalculation = false  )  [virtual]
 

ボーン行列の構築

Parameters:
forceCalculation 強制的に再計算する

Definition at line 79 of file CharacterModel.cpp.

References boneScaled_, Lamp::Bone::buildBoneMatrix(), buildBoneMatrixTick_, getBone(), Lamp::Scene::getTick(), Lamp::SceneObject::scene_, and u_int.

Referenced by Lamp::PrimitiveDrawRequestBuilder::buildBone(), and Lamp::CharacterMesh::deform().

int Lamp::CharacterModel::clearBone  )  [virtual]
 

ボーンのクリア

Returns:
削除したボーン数

Definition at line 169 of file CharacterModel.cpp.

References boneArray_, boneHash_, Lamp::ArrayList< Bone * >::clear(), Lamp::HashMap< String, Bone * >::clear(), getBone(), and getBoneCount().

Referenced by ~CharacterModel().

virtual SceneLeaf* Lamp::CharacterModel::copy u_int  copyMask = 0  )  const [inline, virtual]
 

コピー

Parameters:
copyMask コピーマスク
Returns:
コピーされたシーンリーフ

Implements Lamp::SceneLeaf.

Definition at line 57 of file CharacterModel.h.

References copyCharacterModel().

CharacterModel * Lamp::CharacterModel::copyCharacterModel u_int  copyMask = 0  )  const [virtual]
 

キャラクタモデルのコピー

Parameters:
copyMask コピーマスク
Returns:
コピーされたモデル

Definition at line 51 of file CharacterModel.cpp.

References Lamp::Bone::addBone(), Lamp::Bone::copyBoneValue(), copyModel(), Lamp::Model::copyModelValue(), createBone(), Lamp::ModelManager::createCharacterModel(), Lamp::Bone::getBone(), getBone(), Lamp::Bone::getBoneCount(), getBoneCount(), Lamp::Scene::getModelManager(), Lamp::Bone::getName(), Lamp::SceneObject::name_, Lamp::SceneObjectManagerTemplate< Model >::rename(), Lamp::SceneObject::scene_, and searchBone().

Referenced by copy(), and copyModel().

virtual Model* Lamp::CharacterModel::copyModel u_int  copyMask = 0  )  const [inline, virtual]
 

モデルのコピー

Parameters:
copyMask コピーマスク
Returns:
コピーされたモデル

Implements Lamp::Model.

Definition at line 66 of file CharacterModel.h.

References copyCharacterModel().

Referenced by copyCharacterModel().

Bone * Lamp::CharacterModel::createBone const String boneName  )  [virtual]
 

ボーンの作成

ボーンを作成し、ボーンリストの最後尾に追加します。 すでに同じ名前のボーンが存在するとエラーになります。 空文字列を名前に指定するとエラーになります。

Parameters:
boneName ボーン名
Returns:
作成されたボーン

Definition at line 140 of file CharacterModel.cpp.

References Lamp::ArrayList< Bone * >::add(), Assert, boneArray_, boneHash_, ErrorOut, Lamp::String::getBytes(), Lamp::ArrayList< Bone * >::getCount(), Lamp::String::getSize(), maxBoneCount, NULL, and Lamp::HashMap< String, Bone * >::put().

Referenced by copyCharacterModel(), Lamp::TextSceneLoader::readBone(), and Lamp::BinarySceneLoader::readBone().

void Lamp::CharacterModel::destroyBone Bone bone  )  [virtual]
 

ボーンの破棄

Parameters:
bone 破棄するボーン

Definition at line 159 of file CharacterModel.cpp.

References boneArray_, boneHash_, ErrorOut, Lamp::String::getBytes(), Lamp::Bone::getName(), NULL, Lamp::HashMap< String, Bone * >::remove(), and Lamp::ArrayList< Bone * >::removeByValue().

virtual Bone* Lamp::CharacterModel::getBone int  index  )  const [inline, virtual]
 

ボーンの取得

Parameters:
index ボーンのインデクス
Returns:
ボーン

Definition at line 144 of file CharacterModel.h.

References Assert, boneArray_, Lamp::ArrayList< Bone * >::get(), and Lamp::ArrayList< Bone * >::getCount().

Referenced by Lamp::PrimitiveDrawRequestBuilder::buildBone(), buildBoneMatrix(), buildDeformMatrixArray(), clearBone(), copyCharacterModel(), getBoneIndex(), Lamp::BinarySceneLoader::readCharacterModel(), Lamp::TextSceneSaver::writeCharacterModel(), and Lamp::BinarySceneSaver::writeCharacterModel().

virtual int Lamp::CharacterModel::getBoneCount  )  const [inline, virtual]
 

ボーン数の取得

Returns:
ボーン数

Definition at line 137 of file CharacterModel.h.

References boneArray_, and Lamp::ArrayList< Bone * >::getCount().

Referenced by Lamp::PrimitiveDrawRequestBuilder::buildBone(), buildDeformMatrixArray(), clearBone(), copyCharacterModel(), getBoneIndex(), Lamp::TextSceneSaver::writeCharacterModel(), and Lamp::BinarySceneSaver::writeCharacterModel().

virtual int Lamp::CharacterModel::getBoneIndex Bone bone  )  const [inline, virtual]
 

ボーンインデックスの取得

Parameters:
bone ボーン
Returns:
ボーンインデックス。見つからなければ-1

Definition at line 155 of file CharacterModel.h.

References getBone(), and getBoneCount().

Referenced by Lamp::BinarySceneSaver::writeBoneLink().

const Matrix33 * Lamp::CharacterModel::getNormalDeformMatrixArray bool  forceCalculation = false  )  [virtual]
 

法線変形行列配列の取得

Parameters:
forceCalculation 強制的に再計算する
Returns:
法線変形行列配列

Definition at line 100 of file CharacterModel.cpp.

References Assert, boneScaled_, buildDeformMatrixArray(), deformMatrixArrayTick_, Lamp::Scene::getTick(), normalDeformMatrixArray_, and Lamp::SceneObject::scene_.

Referenced by Lamp::CharacterMesh::deform().

const Matrix34 * Lamp::CharacterModel::getPositionDeformMatrixArray bool  forceCalculation = false  )  [virtual]
 

位置変形行列配列の取得

Parameters:
forceCalculation 強制的に再計算する
Returns:
位置変形行列配列

Definition at line 88 of file CharacterModel.cpp.

References buildDeformMatrixArray(), deformMatrixArrayTick_, Lamp::Scene::getTick(), positionDeformMatrixArray_, and Lamp::SceneObject::scene_.

Referenced by Lamp::CharacterMesh::deform().

virtual bool Lamp::CharacterModel::isBoneScaled  )  const [inline, virtual]
 

ボーンにスケールが含まれるか

Returns:
ボーンにスケールが含まれるならtrue

Definition at line 88 of file CharacterModel.h.

References boneScaled_.

Referenced by Lamp::CharacterMesh::deform().

virtual bool Lamp::CharacterModel::isCharacterModel  )  const [inline, virtual]
 

キャラクタモデルかどうか

Returns:
キャラクタモデルならtrue

Reimplemented from Lamp::Model.

Definition at line 49 of file CharacterModel.h.

virtual Bone* Lamp::CharacterModel::searchBone const String boneName  )  const [inline, virtual]
 

ボーンの検索

Parameters:
boneName 検索するボーン名
Returns:
ボーン

Definition at line 168 of file CharacterModel.h.

References boneHash_, and Lamp::HashMap< String, Bone * >::get().

Referenced by Lamp::CharacterModelAnimation::bind(), copyCharacterModel(), and Lamp::TextSceneLoader::readCharacterModel().


The documentation for this class was generated from the following files:
Generated on Wed Mar 16 10:29:45 2005 for Lamp by doxygen 1.3.2