NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
RenderableHelicalTube.h
Go to the documentation of this file.
00001 
00011 #pragma once
00012 
00013 // System Library Includes
00014 #include <d3d9.h>
00015 
00016 // Application Library Includes
00017 
00018 // Local Includes
00019 #include "../RenderableComponent.h"
00020 #include "../../material/MaterialsSystemInterface.h"
00021 #include "../../texture/TexturesSystemInterface.h"
00022 
00023 // Forward Declarations
00024 namespace GraphicsCore {
00025   class MaterialInterface;
00026   class TextureInterface;
00027 }
00028 
00029 // Typedefs
00030 
00031 
00032 namespace GraphicsCore {
00033   class RenderableHelicalTube: public RenderableComponent, public MaterialsSystemInterface, public TexturesSystemInterface {
00034   public:
00035     RenderableHelicalTube(EntitySPTR, ModuleInterface*, LPDIRECT3DDEVICE9);
00036     virtual ~RenderableHelicalTube();
00037     
00038     bool SetLength(float);
00039     bool SetRadius(float);
00040     bool SetPitch(float);
00041     bool SetSegmentCount(unsigned int);
00042     
00044     void UpdateGeometry();
00045     
00046     
00047   private: // Overridden methods from parent classes
00048     void Render(LPDIRECT3DDEVICE9);
00049     
00050     bool InsertMaterial(unsigned int, EnvelopeSPTR);
00051     bool RemoveMaterial(unsigned int);
00052     
00053     bool InsertTexture(unsigned int, EnvelopeSPTR);
00054     bool RemoveTexture(unsigned int);
00055     
00056     
00057   private: // Class properties
00058     float radius, length;
00059     float pitch;
00060     unsigned int numberOfSegments;
00061     
00062     MaterialInterface* material;
00063     TextureInterface* texture;
00064     
00065     LPDIRECT3DDEVICE9 d3dDevice; 
00066     
00067   private: // Class property cache - for performance
00068     LPD3DXMESH mesh;
00069   };
00070 }