Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CModel Class Reference

Models. More...

`#include <KeosModel.h>`

Inheritance diagram for Keos::CModel:

List of all members.

## Public Types

typedef ushort | TIndex
| Indice type for models.

## Public Member Functions

| CModel (const TVertex *pVertices, ulong nVerticesCount, const TIndex *pIndices, ulong nIndicesCount, const String &strTexture)
| Default constructor.
| CModel (const TVertex *pVertices, ulong nVerticesCount, const TIndex *pIndices, ulong nIndicesCount, CImage *pImage)
| ~CModel ()
| Destructor.
void | Render () const
| Render the model.
CTexture * | GetTexture ()
| Return the texture of the model.
void | SetTexture (const String &strTexture)
| Set the texture of the model.

## Private Attributes

CDeclarationPtr | m_pDeclaration
| Vertex declaration.
CBuffer< TVertex > | m_VertexBuffer
| Vertex buffer of the model.
CBuffer< TIndex > | m_IndexBuffer
| Index buffer du model.
CTexture * | m_pTexture
| Texture of the model.

## Classes

struct | TVertex
| Vertex type for models. More...

## Detailed Description

Models.

Contains one vertex buffer, one index buffer, one CDeclaration and one function to render the model.

Definition at line 37 of file KeosModel.h.

## Member Typedef Documentation

typedef ushort Keos::CModel::TIndex

| Indice type for models. Definition at line 50 of file KeosModel.h.

## Constructor & Destructor Documentation

Keos::CModel::CModel | ( | const TVertex * | pVertices,
|  | ulong | nVerticesCount,
|  | const TIndex * | pIndices,
|  | ulong | nIndicesCount,
|  | const String & | strTexture
| ) |

| Default constructor.

Parameters:

  | pVertices | Pointer on vertex array.
  | nVerticesCount | Number of vertices.
  | pIndices | Pointer on index array.
  | nIndicesCount | Number of indices.
  | strTexture | Path of the model texture.

Definition at line 40 of file KeosModel.cpp.

References Assert, Keos::CTexture::CreateFromFile(), Keos::ELT_TYPE_COLOR, Keos::ELT_TYPE_FLOAT2, Keos::ELT_TYPE_FLOAT3, Keos::ELT_USAGE_DIFFUSE, Keos::ELT_USAGE_NORMAL, Keos::ELT_USAGE_POSITION, Keos::ELT_USAGE_TEXCOORD0, m_IndexBuffer, m_pDeclaration, m_pTexture, m_VertexBuffer, Keos::PXF_A8R8G8B8, and Renderer.

Keos::CModel::CModel | ( | const TVertex * | pVertices,
|  | ulong | nVerticesCount,
|  | const TIndex * | pIndices,
|  | ulong | nIndicesCount,
|  | CImage * | pImage
| ) |

| Definition at line 67 of file KeosModel.cpp. References Assert, Keos::CTexture::CreateFromImage(), Keos::ELT_TYPE_COLOR, Keos::ELT_TYPE_FLOAT2, Keos::ELT_TYPE_FLOAT3, Keos::ELT_USAGE_DIFFUSE, Keos::ELT_USAGE_NORMAL, Keos::ELT_USAGE_POSITION, Keos::ELT_USAGE_TEXCOORD0, m_IndexBuffer, m_pDeclaration, m_pTexture, m_VertexBuffer, and Renderer.

Keos::CModel::~CModel | ( |  | ) |

| Destructor. Definition at line 94 of file KeosModel.cpp. References KEOS_DELETE, and m_pTexture.

## Member Function Documentation

CTexture* Keos::CModel::GetTexture | ( |  | ) | `[inline]`

| Return the texture of the model.

Returns:
  Reference on the texture.

Definition at line 74 of file KeosModel.h.

void Keos::CModel::Render | ( |  | ) | const

| Render the model. Definition at line 100 of file KeosModel.cpp. References Keos::CBuffer< T >::GetCount(), Keos::CTexture::GetTexture(), m_IndexBuffer, m_pDeclaration, m_pTexture, m_VertexBuffer, Keos::PT_TRIANGLELIST, and Renderer.

void Keos::CModel::SetTexture | ( | const String & | strTexture | ) | `[inline]`

| Set the texture of the model.

Parameters:

  | strTexture | Path of the model texture.

Definition at line 80 of file KeosModel.h.

References KEOS_DELETE, and Keos::PXF_A8R8G8B8.

## Member Data Documentation

CBuffer<TIndex> Keos::CModel::m_IndexBuffer`[private]`

| Index buffer du model. Definition at line 97 of file KeosModel.h. Referenced by CModel(), and Render().

CDeclarationPtr Keos::CModel::m_pDeclaration`[private]`

| Vertex declaration. Definition at line 93 of file KeosModel.h. Referenced by CModel(), and Render().

CTexture* Keos::CModel::m_pTexture`[private]`

| Texture of the model. Definition at line 99 of file KeosModel.h. Referenced by CModel(), Render(), and ~CModel().

CBuffer<TVertex> Keos::CModel::m_VertexBuffer`[private]`

| Vertex buffer of the model. Definition at line 95 of file KeosModel.h. Referenced by CModel(), and Render().

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

- KeosEngine/KeosModel.h
- KeosEngine/KeosModel.cpp