Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.38 KB | None | 0 0
  1. #pragma once
  2. #include "StdAfx.h"
  3.  
  4. class PhysX;
  5. class NxActor;
  6. class InputMesh;
  7. #include <vector>
  8. #include "float3.h"
  9. #include "LevelElement.h"
  10. #include "d3dutil.h"
  11. #include "vertex.h"
  12.  
  13. class Box: public LevelElement
  14. {
  15. public:
  16.     Box(tstring Soort,PhysX* physx,D3DXVECTOR3 pos,float width,float height,float depth,float UScale, float VScale,int bodyType);
  17.     virtual ~Box(void);
  18.  
  19.     virtual void SetBodyType(int bodyType);
  20.     virtual void Initialize(ContentManager *pContentManager);
  21.     virtual void Tick(const InputState& refInputState);
  22.     virtual void Draw(const RenderContext* pRenderContext);
  23.     void SetEffect(ID3D10Effect* effect);
  24.     void TriggerNormal();
  25.     void TriggerMulti();
  26.     void TriggerLife();
  27.     void TriggerNitro();
  28.     void TriggerTNT();
  29.     void TriggerCheckpoint();
  30.     void TriggerAkuAku();
  31.     void TriggerSteel();
  32.     void TriggerQuestion();
  33.     tstring GetSoort() const {return m_Soort;}
  34.     void Checksoort(tstring kind);
  35.     D3DXVECTOR3 GetPos() const {return m_Pos;}
  36.     virtual void Translate(const D3DXVECTOR3 pos);
  37.     virtual void InitActor(){}
  38.     virtual NxActor* GetActor(){return m_pActor;}
  39.    
  40.     static const int RIGID = 1, STATIC = 2, GHOST = 3;
  41.  
  42. protected:
  43.     vector<VertexPosNormTex> m_Vertices;
  44.     vector<DWORD>m_VecIndices;
  45.    
  46.     void BuildStacks(vector<VertexPosNormTex>& vertices, vector<DWORD>& indices);
  47.     void DefineInputLayout();
  48.     void CreateEffect(ContentManager *pContentManager);
  49.  
  50.     ID3D10InputLayout*          m_pVertexLayout;
  51.     ID3D10Buffer*               m_pVertexBuffer;
  52.     ID3D10Buffer*               m_pIndexBuffer;
  53.     ID3D10ShaderResourceView *  m_pTextureRV;
  54.     ID3D10Effect*               m_pDefaultEffect;
  55.     ID3D10EffectTechnique*      m_pDefaultTechnique;
  56.  
  57.     ID3D10EffectMatrixVariable* m_pWorldViewProjectionVariable;
  58.     ID3D10EffectMatrixVariable* m_pWorldVariable;
  59.     ID3D10EffectShaderResourceVariable* m_pDiffuseMapVariabele;
  60.    
  61.     void AddTriangle (unsigned int a, unsigned int b, unsigned c);
  62.     void AddQuad(unsigned int a, unsigned int b, unsigned int c,unsigned int d);
  63.     UINT m_VertexBufferStride;
  64.     tstring m_TextureName;
  65.  
  66.     UINT m_NumIndices;
  67.     UINT  m_NumSlices;
  68.     UINT  m_NumStacks;
  69.     float m_UScale;
  70.     float m_VScale;
  71.  
  72.     tstring m_Soort;
  73.     D3DXVECTOR3 m_Pos;
  74.     virtual void InitActor(int bodytype);
  75.     NxActor *m_pActor;
  76.     PhysX* m_pPhysX;
  77.  
  78.     float m_Width,m_Height,m_Depth;
  79. private:
  80.     void FillVertexAndIndexBuffer();
  81.     void GetEffectVariables(ID3D10Effect* pEffect);
  82.  
  83.     Box(const Box& t);
  84.     Box& operator=(const Box& t);
  85. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement