TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DynamicTree.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 
20 #ifndef _DYNTREE_H
21 #define _DYNTREE_H
22 
23 #include "Define.h"
24 
25 namespace G3D
26 {
27  class Ray;
28  class Vector3;
29 }
30 
31 class GameObjectModel;
32 struct DynTreeImpl;
33 
35 {
37 
38 public:
39 
41  ~DynamicMapTree();
42 
43  bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2,
44  float z2, uint32 phasemask) const;
45 
46  bool getIntersectionTime(uint32 phasemask, const G3D::Ray& ray,
47  const G3D::Vector3& endPos, float& maxDist) const;
48 
49  bool getObjectHitPos(uint32 phasemask, const G3D::Vector3& pPos1,
50  const G3D::Vector3& pPos2, G3D::Vector3& pResultHitPos,
51  float pModifyDist) const;
52 
53  float getHeight(float x, float y, float z, float maxSearchDist, uint32 phasemask) const;
54 
55  void insert(const GameObjectModel&);
56  void remove(const GameObjectModel&);
57  bool contains(const GameObjectModel&) const;
58  int size() const;
59 
60  void balance();
61  void update(uint32 diff);
62 };
63 
64 #endif // _DYNTREE_H
DynTreeImpl * impl
Definition: DynamicTree.h:36
Definition: AABox.h:25
Definition: DynamicTree.h:34
Definition: Vector3.h:58
static bool contains(const unsigned char *a, const unsigned char an, const unsigned char v)
Definition: RecastLayers.cpp:55
Definition: DynamicTree.cpp:63
G3D::int16 z
Definition: Vector3int16.h:46
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
Definition: Ray.h:24
#define TC_COMMON_API
Definition: Define.h:116
Definition: GameObjectModel.h:50
G3D::int16 x
Definition: Vector2int16.h:37
static unsigned short getHeight(const float fx, const float fy, const float fz, const float, const float ics, const float ch, const rcHeightPatch &hp)
Definition: RecastMeshDetail.cpp:203