From fcd58c134dc532a99dbc19a884b9f3aa9ec70b69 Mon Sep 17 00:00:00 2001 From: XTZGZoReX Date: Mon, 7 Jun 2010 13:57:34 +0200 Subject: * Move VMap3 code to a separate static 'collision' library. --HG-- branch : trunk --- src/server/collision/Models/ModelInstance.h | 81 +++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/server/collision/Models/ModelInstance.h (limited to 'src/server/collision/Models/ModelInstance.h') diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h new file mode 100644 index 00000000000..97b3ab632a1 --- /dev/null +++ b/src/server/collision/Models/ModelInstance.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2005-2010 MaNGOS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _MODELINSTANCE_H_ +#define _MODELINSTANCE_H_ + +#include +#include +#include +#include + +#include "Platform/Define.h" + +namespace VMAP +{ + class WorldModel; + struct AreaInfo; + struct LocationInfo; + + enum ModelFlags + { + MOD_M2 = 1, + MOD_WORLDSPAWN = 1<<1, + MOD_HAS_BOUND = 1<<2 + }; + + class ModelSpawn + { + public: + //mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name + uint32 flags; + uint16 adtId; + uint32 ID; + G3D::Vector3 iPos; + G3D::Vector3 iRot; + float iScale; + G3D::AABox iBound; + std::string name; + bool operator==(const ModelSpawn &other) const { return ID == other.ID; } + //uint32 hashCode() const { return ID; } + // temp? + const G3D::AABox& getBounds() const { return iBound; } + + + static bool readFromFile(FILE *rf, ModelSpawn &spawn); + static bool writeToFile(FILE *rw, const ModelSpawn &spawn); + }; + + class ModelInstance: public ModelSpawn + { + public: + ModelInstance(): iModel(0) {} + ModelInstance(const ModelSpawn &spawn, WorldModel *model); + void setUnloaded() { iModel = 0; } + bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const; + void intersectPoint(const G3D::Vector3& p, AreaInfo &info) const; + bool GetLocationInfo(const G3D::Vector3& p, LocationInfo &info) const; + bool GetLiquidLevel(const G3D::Vector3& p, LocationInfo &info, float &liqHeight) const; + protected: + G3D::Matrix3 iInvRot; + float iInvScale; + WorldModel *iModel; + }; +} // namespace VMAP + +#endif // _MODELINSTANCE -- cgit v1.2.3 From a5f4e3de948f388505b7a6d1baf107ceacfd718b Mon Sep 17 00:00:00 2001 From: Tartalo Date: Tue, 8 Jun 2010 01:20:06 +0200 Subject: more cmake fixes. comment collision compilation until fixed --HG-- branch : trunk --- src/server/CMakeLists.txt | 2 +- src/server/authserver/CMakeLists.txt | 13 +++++++++---- src/server/authserver/Main.cpp | 2 +- src/server/authserver/Server/AuthSocket.cpp | 4 ++-- src/server/authserver/Server/AuthSocket.h | 2 +- src/server/collision/CMakeLists.txt | 6 +++++- src/server/collision/Maps/MapTree.h | 6 +++--- src/server/collision/Models/ModelInstance.h | 2 +- src/server/collision/Models/WorldModel.h | 4 ++-- src/server/shared/CMakeLists.txt | 1 + 10 files changed, 26 insertions(+), 16 deletions(-) (limited to 'src/server/collision/Models/ModelInstance.h') diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 1a6321c23e3..ccf7b894eb4 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(shared) add_subdirectory(game) -add_subdirectory(collision) +#add_subdirectory(collision) if (DO_SCRIPTS) add_subdirectory(scripts) endif (DO_SCRIPTS) diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt index 496f1ff689e..98142e88729 100644 --- a/src/server/authserver/CMakeLists.txt +++ b/src/server/authserver/CMakeLists.txt @@ -18,7 +18,15 @@ include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Database - ${CMAKE_SOURCE_DIR}/src/server/framework + ${CMAKE_SOURCE_DIR}/src/server/shared/Packets + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities + ${CMAKE_SOURCE_DIR}/src/server/authserver + ${CMAKE_SOURCE_DIR}/src/server/authserver/Authentication + ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms + ${CMAKE_SOURCE_DIR}/src/server/authserver/Server ${MYSQL_INCLUDE_DIR} ) @@ -41,12 +49,9 @@ SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "${trinity-realm_LINK_ target_link_libraries( trinity-realm shared -trinityframework -trinitysockets trinitydatabase trinityauth trinityconfig -zlib ${SSLLIB} ${MYSQL_LIBRARIES} ${OSX_LIBS} diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 09bae4908e0..4d5362608a7 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -25,7 +25,7 @@ #include "Common.h" #include "Database/DatabaseEnv.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Log.h" #include "SystemConfig.h" #include "Util.h" diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index cc293097977..c33f84a9669 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -25,13 +25,13 @@ #include "Common.h" #include "Database/DatabaseEnv.h" #include "ByteBuffer.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Log.h" #include "RealmList.h" #include "AuthSocket.h" #include "AuthCodes.h" #include -#include "Auth/Sha1.h" +#include "SHA1.h" //#include "Util.h" -- for commented utf8ToUpperOnlyLatin extern DatabaseType LoginDatabase; diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index bfd0fa4fdca..0ad40b6930b 100644 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -26,7 +26,7 @@ #define _AUTHSOCKET_H #include "Common.h" -#include "Auth/BigNumber.h" +#include "BigNumber.h" #include "RealmSocket.h" diff --git a/src/server/collision/CMakeLists.txt b/src/server/collision/CMakeLists.txt index b9d7d420d5d..a67cd8d660a 100644 --- a/src/server/collision/CMakeLists.txt +++ b/src/server/collision/CMakeLists.txt @@ -1,5 +1,5 @@ -########### next target ############### +########### collision ############### SET(collision_STAT_SRCS BoundingIntervalHierarchy.h @@ -27,6 +27,10 @@ include_directories( ${CMAKE_SOURCE_DIR}/externals/g3dlite/G3D.lib ${CMAKE_SOURCE_DIR}/externals/g3dlite/G3D.lib/include ${CMAKE_SOURCE_DIR}/externals/g3dlite/G3D.lib/include/G3D + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic + ${CMAKE_SOURCE_DIR}/src/server/collision + ${CMAKE_SOURCE_DIR}/src/server/collision/Maps ) add_library(collision STATIC ${collision_STAT_SRCS}) diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h index 7955cb92d68..282f34d42fd 100644 --- a/src/server/collision/Maps/MapTree.h +++ b/src/server/collision/Maps/MapTree.h @@ -19,9 +19,9 @@ #ifndef _MAPTREE_H #define _MAPTREE_H -#include "Platform/Define.h" -#include "Utilities/UnorderedMap.h" -#include "BIH.h" +#include "Define.h" +#include "UnorderedMap.h" +#include "BoundingIntervalHierarchy.cpp" namespace VMAP { diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h index 97b3ab632a1..42b92c8fb89 100644 --- a/src/server/collision/Models/ModelInstance.h +++ b/src/server/collision/Models/ModelInstance.h @@ -24,7 +24,7 @@ #include #include -#include "Platform/Define.h" +#include "Define.h" namespace VMAP { diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h index f12efed4f5d..b23f4ae3f00 100644 --- a/src/server/collision/Models/WorldModel.h +++ b/src/server/collision/Models/WorldModel.h @@ -23,9 +23,9 @@ #include #include #include -#include "BIH.h" +#include "BoundingIntervalHierarchy.cpp" -#include "Platform/Define.h" +#include "Define.h" namespace VMAP { diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index 3495a47f915..6c796d60f11 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -6,6 +6,7 @@ SET(shared_STAT_SRCS Logging/Log.h Packets/ByteBuffer.h Packets/WorldPacket.h + Policies/ObjectLifeTime.cpp Threading/DelayExecutor.cpp Threading/DelayExecutor.h Threading/Threading.cpp -- cgit v1.2.3