Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
   Copyright (c) 2017 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _QUAD_TREE
#define _QUAD_TREE

#include "Core/Math/Headers/MathMatrices.h"
#include "Platform/Video/Headers/RenderAPIWrapper.h"

namespace Divide {

class Terrain;
class Transform;
class SceneState;
class BoundingBox;
class IMPrimitive;
class VertexBuffer;
class QuadtreeNode;
class ShaderProgram;
class SceneGraphNode;
class SceneRenderState;

class Quadtree {
   public:
    void Build(GFXDevice& context, 
               BoundingBox& terrainBBox,
               const vec2<U32>& HMSize,
               U32 minHMSize,
               Terrain* const terrain);
    BoundingBox& computeBoundingBox();

    inline U32 getChunkCount() const { return _chunkCount; }

    void sceneUpdate(const U64 deltaTime, SceneGraphNode& sgn,
                     SceneState& sceneState);

    void getChunkBufferData(GFXDevice& context,
                            const SceneRenderState& sceneRenderState, 
                            vectorImpl<vec3<U32>>& chunkBufferData) const;

    void drawBBox(GFXDevice& context, GenericDrawCommands& commandsOut);

    QuadtreeNode* findLeaf(const vec2<F32>& pos);

    Quadtree();
    ~Quadtree();

   private:
    U32 _chunkCount;
    VertexBuffer* _parentVB;  //<Pointer to the terrain VB
    QuadtreeNode* _root;
    IMPrimitive*  _bbPrimitive;
};

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Environment/Terrain/Quadtree/Headers/Quadtree.h

Diff revisions: vs.
Revision Author Commited Message
836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

804 Diff Diff IonutCava picture IonutCava Thu 01 Dec, 2016 17:20:59 +0000

[IonutCava]
- Singleton elimination update Part I: get it to compile
— The following classes are no longer Singletons: GFXDevice, GL_API, DX_API, SFXWrapper, FmodWrapper, SDLWrapper, ALWrapper, PXDevice, InputInterface, RenderPassManager, SceneManager and ResourceManager;
— Refactor system to a Context / Component based implementation (Pass relevant context to objects: e.g. GFXDevice object to Textures, GUI to GUIElements, etc)
— Make devices and managers components of the kernel
— Allow multiple Resource caches to co-exist. This may prove useful for later when a more fragmented memory model is need (per frame / per scene / global caches / etc)

  • next steps: part II – cleanup/refactor new code, part III – optimise code, part IV – remove remaining Singletons (e.g. Application, ParamHandler, FrameListenerManager, Recast, PostFX and DebugInterface)
777 Diff Diff IonutCava picture IonutCava Fri 07 Oct, 2016 16:14:48 +0000

[IonutCava]
- Continue to implement CommandBuffer / RenderPass / RenderSubPass system.
— Rendering artefacts are still present.

713 Diff Diff IonutCava picture IonutCava Wed 25 May, 2016 15:43:38 +0000

[IonutCava]
- Removed all unique_ptr’s from the code with classic new/delete pairs. They were seriously not needed.
- Added the concept of SceneComponent to scene specific classes: aiManager, lightPool, sceneGraph, physicsInterface etc
— This allowed the removal of the global GET_ACTIVE_SCENEGRAPH call;

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

504 Diff Diff IonutCava picture IonutCava Tue 25 Aug, 2015 16:17:38 +0000

[IonutCava]
- Better caching of draw commands (W.I.P.)
- Remove unused occlusion culling code. Will be replaced with Hi-Z based culling

396 Diff Diff IonutCava picture IonutCava Thu 02 Apr, 2015 10:51:16 +0000

[Ionut]
- Small cleanups

354 Diff Diff IonutCava picture IonutCava Fri 20 Feb, 2015 17:17:37 +0000

[Ionut]
- Replaced GLEW with glbinding (requires a CEGUI recompile. It currently crashes)
- Replaced most “SceneGraphNode* const sgn” expressions with "SceneGraphNode& sgn"
- Replaced some pointers to kernel to references to kernel
- Fixed compilation issues with EASTL
- Removed NPOT -> POT texture conversion code. Modern GPUs handle NPOT textures perfectly fine

350 Diff Diff IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

[Ionut]
- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)

349 IonutCava picture IonutCava Fri 06 Feb, 2015 17:11:39 +0000

[Ionut]
- More raw pointer replacements
- Removed some redundant parameters to a few scene and application functions