!I integrate from //ce/main...
[CRYENGINE.git] / Code / CryEngine / Cry3DEngine / BasicArea.h
blobf8e48ad8551e983da36319b3f2f3ce6e4e69bf02
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #pragma once
5 class COctreeNode;
7 #define COPY_MEMBER_SAVE(_dst, _src, _name) { (_dst)->_name = (_src)->_name; }
8 #define COPY_MEMBER_LOAD(_dst, _src, _name) { (_dst)->_name = (_src)->_name; }
10 enum EObjList
12 DYNAMIC_OBJECTS = 0,
13 STATIC_OBJECTS,
14 PROC_OBJECTS,
15 ENTITY_LISTS_NUM
18 struct SRNInfo
20 SRNInfo()
22 memset(this, 0, sizeof(*this));
25 SRNInfo(IRenderNode* _pNode)
27 fMaxViewDist = _pNode->m_fWSMaxViewDist;
28 AABB aabbBox = _pNode->GetBBox();
29 objSphere.center = aabbBox.GetCenter();
30 objSphere.radius = aabbBox.GetRadius();
31 pNode = _pNode;
32 nRType = _pNode->GetRenderNodeType();
34 /*#ifdef _DEBUG
35 erType = _pNode->GetRenderNodeType();
36 cry_strcpy(szName, _pNode->GetName());
37 #endif*/
40 bool operator==(const IRenderNode* _pNode) const { return (pNode == _pNode); }
41 bool operator==(const SRNInfo& rOther) const { return (pNode == rOther.pNode); }
43 float fMaxViewDist;
44 Sphere objSphere;
45 IRenderNode* pNode;
46 EERType nRType;
47 /*#ifdef _DEBUG
48 EERType erType;
49 char szName[32];
50 #endif*/
53 #define UPDATE_PTR_AND_SIZE(_pData, _nDataSize, _SIZE_PLUS) \
54 { \
55 _pData += (_SIZE_PLUS); \
56 _nDataSize -= (_SIZE_PLUS); \
57 assert(_nDataSize >= 0); \
58 } \
60 enum EAreaType
62 eAreaType_Undefined,
63 eAreaType_OcNode,
64 eAreaType_VisArea
67 struct CBasicArea : public Cry3DEngineBase
69 CBasicArea()
71 m_boxArea.min = m_boxArea.max = Vec3(0, 0, 0);
72 m_pObjectsTree = NULL;
75 ~CBasicArea();
77 bool IsObjectsTreeValid() { return m_pObjectsTree != nullptr; }
78 COctreeNode* GetObjectsTree() { return m_pObjectsTree; }
79 void SetObjectsTree(COctreeNode* node) { m_pObjectsTree = node; }
81 AABB m_boxArea; // bbox containing everything in sector including child sectors
82 AABB m_boxStatics; // bbox containing only objects in STATIC_OBJECTS list of this node and height-map
84 private:
86 COctreeNode* m_pObjectsTree;