raSystem  1.0 bata
raNode.h
Go to the documentation of this file.
1 #pragma once
2 
3  class raGroup;
4  // {0B57EDFD-5EDE-4C92-BCD5-F1A7A52710EB}
5  DEFINE_GUID(RAIID_raNode,
6  0xb57edfd, 0x5ede, 0x4c92, 0xbc, 0xd5, 0xf1, 0xa7, 0xa5, 0x27, 0x10, 0xeb);
7 
8  class RAPI raNode : public raRender
9  {
10  protected:
11  raNode(const GUID& raguid, raSmartPointer<raDirectX> dx, LPCSTR strName = "raNode", raNode* pParent = NULL);
12  public:
13  raNode(raSmartPointer<raDirectX> dx, LPCSTR strName = "raNode", raNode* pParent = NULL);
14  ~raNode();
15 
16  void SetChild(raNode* pChild);
17  void SetSibling(raNode* pSibling);
18 
19  virtual raMatrix* GetWorldMatrix() { return &m_WorldTransformed; }
20  virtual void SetWorldMatrix (const raMatrix& value);
21 
22  virtual bool Create();
23  virtual void Destroy();
24  virtual bool Render(UINT drawOrder, const raMatrix& pView, const raMatrix& pProj,
25  const raLight* pLight, LPCSTR techniqueName = "");
26  virtual bool Update(float fTime, float fElapsedTime);
27 
28  virtual void SetVisible (bool bVisible);
29  virtual void SetSelected(bool bSelected);
30 
31  virtual void Update(raFrameMap &m_FrameData, float fTime, UINT subScriptionNo){};
32 
33  virtual void TransformFrame(raMatrix* pParentWorld);
34  virtual void TransformFrame(raMatrix* pParentWorld, UINT instanceNo);
35 
36  raNode* FindNode(LPCSTR strName);
37  raNode* FindRoot();
38 
39  raVisual* GetVisual(){return m_pMesh;}
40  void SetVisual(raVisual* pVisual);
41  raVisual* GetVisual(UINT n ){ return FindRoot()->m_Meshes[n];}
42  UINT GetNumVisuals(){ return (UINT)FindRoot()->m_Meshes.size();}
43 
44  virtual bool Intersects(const raVector3* pRayPos,
45  const raVector3* pRayDir,
46  float* pDist);
47 
48  void SetLocatorMarkers(raGroup* pGroup);
49 
50  protected:
52 
56 
58 
59  public:
60  std::vector<raVisual*> m_Meshes; //Wurzelknoten jeder Hierarchie führt Liste der Meshes
61  //Vorsicht beim Einfügen von Kindern, die vorher selbst Wurzelknoten waren!
62  };
virtual raMatrix * GetWorldMatrix()
Definition: raNode.h:19
Definition: raLight.h:5
virtual void Update(raFrameMap &m_FrameData, float fTime, UINT subScriptionNo)
Definition: raNode.h:31
UINT GetNumVisuals()
Definition: raNode.h:42
std::vector< raVisual * > m_Meshes
Definition: raNode.h:60
virtual void Destroy()
Definition: raRender.h:12
#define RAPI
Definition: raMain.h:11
raVisual * m_pMesh
Definition: raNode.h:57
raMatrix m_WorldTransformed
Definition: raNode.h:51
raNode * m_pParent
Definition: raNode.h:53
raNode * m_pSibling
Definition: raNode.h:54
Definition: raNode.h:8
virtual bool Intersects(const raVector3 *pRayPos, const raVector3 *pRayDir, float *pDist)
Definition: raRender.h:28
std::map< LPCSTR, System::RAANIMATION_FRAME_DATA * > raFrameMap
Definition: raMain.h:157
DEFINE_GUID(RAIID_raNode, 0xb57edfd, 0x5ede, 0x4c92, 0xbc, 0xd5, 0xf1, 0xa7, 0xa5, 0x27, 0x10, 0xeb)
virtual bool Render(UINT drawOrder, const raMatrix &pView, const raMatrix &pProj, const raLight *pLight, LPCSTR techniqueName="")
Definition: raRender.h:14
virtual void SetVisible(bool bVisible)
Definition: raRender.h:22
virtual bool Update(float fTime, float fRunTime)
Definition: raRender.h:17
virtual void SetSelected(bool bSelected)
Definition: raRender.h:23
raNode * m_pChild
Definition: raNode.h:55
raVisual * GetVisual()
Definition: raNode.h:39
virtual bool Create()
Definition: raRender.h:11
raVisual * GetVisual(UINT n)
Definition: raNode.h:41
virtual void SetWorldMatrix(const raMatrix &value)
Definition: raRender.cpp:13