CMake autodetecting boost.
Added KRDataBlock to CMakeLists
This commit is contained in:
@@ -71,6 +71,15 @@ PROPERTIES
|
|||||||
OUTPUT_NAME kraken
|
OUTPUT_NAME kraken
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(Boost_USE_STATIC_LIBS ON) # only find static libs
|
||||||
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||||
|
find_package(Boost 1.65.1)
|
||||||
|
if(Boost_FOUND)
|
||||||
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(kraken ${Boost_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
# add_custom_target(package
|
# add_custom_target(package
|
||||||
# COMMENT "Compressing..."
|
# COMMENT "Compressing..."
|
||||||
# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/archive"
|
# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/archive"
|
||||||
|
|||||||
@@ -11,3 +11,6 @@ add_sources(quaternion.cpp)
|
|||||||
add_sources(matrix4.cpp)
|
add_sources(matrix4.cpp)
|
||||||
add_sources(aabb.cpp)
|
add_sources(aabb.cpp)
|
||||||
add_sources(hitinfo.cpp)
|
add_sources(hitinfo.cpp)
|
||||||
|
|
||||||
|
# Private Implementation
|
||||||
|
add_sources(KRDataBlock.cpp)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ private:
|
|||||||
KRAudioManager *m_pSoundManager;
|
KRAudioManager *m_pSoundManager;
|
||||||
|
|
||||||
int m_index;
|
int m_index;
|
||||||
int m_frameCount;
|
int m_frameCount;
|
||||||
int m_frameRate;
|
int m_frameRate;
|
||||||
int m_bytesPerFrame;
|
int m_bytesPerFrame;
|
||||||
KRDataBlock *m_pData;
|
KRDataBlock *m_pData;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ KRDataBlock *KRDataBlock::getSubBlock(int start, int length)
|
|||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
if(m_hPackFile) {
|
if(m_hPackFile) {
|
||||||
new_block->m_hPackFile = m_hPackFile;
|
new_block->m_hPackFile = m_hPackFile;
|
||||||
#elif defined(__APPLE)
|
#elif defined(__APPLE__)
|
||||||
if (m_fdPackFile) {
|
if (m_fdPackFile) {
|
||||||
new_block->m_fdPackFile = m_fdPackFile;
|
new_block->m_fdPackFile = m_fdPackFile;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "public/kraken.h"
|
#include "public/kraken.h"
|
||||||
#include "KRHelpers.h"
|
#include "KRHelpers.h"
|
||||||
|
using namespace kraken;
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -30,8 +31,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
|
||||||
#include "../3rdparty/tinyxml2/tinyxml2.h"
|
#include "../3rdparty/tinyxml2/tinyxml2.h"
|
||||||
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
@@ -51,7 +53,6 @@
|
|||||||
#include <OpenAL/MacOSX_OALExtensions.h>
|
#include <OpenAL/MacOSX_OALExtensions.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "tinyxml2.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/tokenizer.hpp>
|
#include <boost/tokenizer.hpp>
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ using namespace kraken;
|
|||||||
#include "KRMaterialManager.h"
|
#include "KRMaterialManager.h"
|
||||||
#include "KRCamera.h"
|
#include "KRCamera.h"
|
||||||
#include "KRViewport.h"
|
#include "KRViewport.h"
|
||||||
#include "KRHitInfo.h"
|
|
||||||
|
|
||||||
class KRMaterial;
|
class KRMaterial;
|
||||||
class KRNode;
|
class KRNode;
|
||||||
@@ -211,9 +210,9 @@ public:
|
|||||||
|
|
||||||
model_format_t getModelFormat() const;
|
model_format_t getModelFormat() const;
|
||||||
|
|
||||||
bool lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo) const;
|
bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo) const;
|
||||||
bool rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo) const;
|
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo) const;
|
||||||
bool sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo) const;
|
bool sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo) const;
|
||||||
|
|
||||||
static int GetLODCoverage(const std::string &name);
|
static int GetLODCoverage(const std::string &name);
|
||||||
|
|
||||||
@@ -230,8 +229,8 @@ private:
|
|||||||
void getSubmeshes();
|
void getSubmeshes();
|
||||||
void getMaterials();
|
void getMaterials();
|
||||||
|
|
||||||
static bool rayCast(const Vector3 &start, const Vector3 &dir, const Triangle3 &tri, const Vector3 &tri_n0, const Vector3 &tri_n1, const Vector3 &tri_n2, KRHitInfo &hitinfo);
|
static bool rayCast(const Vector3 &start, const Vector3 &dir, const Triangle3 &tri, const Vector3 &tri_n0, const Vector3 &tri_n1, const Vector3 &tri_n2, HitInfo &hitinfo);
|
||||||
static bool sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, const Triangle3 &tri, KRHitInfo &hitinfo);
|
static bool sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, const Triangle3 &tri, HitInfo &hitinfo);
|
||||||
|
|
||||||
int m_lodCoverage; // This LOD level is activated when the bounding box of the model will cover less than this percent of the screen (100 = highest detail model)
|
int m_lodCoverage; // This LOD level is activated when the bounding box of the model will cover less than this percent of the screen (100 = highest detail model)
|
||||||
vector<KRMaterial *> m_materials;
|
vector<KRMaterial *> m_materials;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KROctreeNode.h"
|
#include "KROctreeNode.h"
|
||||||
#include "KRHitInfo.h"
|
|
||||||
|
|
||||||
class KRNode;
|
class KRNode;
|
||||||
|
|
||||||
@@ -27,9 +26,9 @@ public:
|
|||||||
KROctreeNode *getRootNode();
|
KROctreeNode *getRootNode();
|
||||||
std::set<KRNode *> &getOuterSceneNodes();
|
std::set<KRNode *> &getOuterSceneNodes();
|
||||||
|
|
||||||
bool lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KROctreeNode *m_pRootNode;
|
KROctreeNode *m_pRootNode;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#define KROCTREENODE_H
|
#define KROCTREENODE_H
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRHitInfo.h"
|
#include "public/hitinfo.h"
|
||||||
|
|
||||||
class KRNode;
|
class KRNode;
|
||||||
|
|
||||||
@@ -47,9 +47,9 @@ public:
|
|||||||
bool m_occlusionTested;
|
bool m_occlusionTested;
|
||||||
bool m_activeQuery;
|
bool m_activeQuery;
|
||||||
|
|
||||||
bool lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ public:
|
|||||||
|
|
||||||
kraken_stream_level getStreamLevel();
|
kraken_stream_level getStreamLevel();
|
||||||
|
|
||||||
bool lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask);
|
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
|
|
||||||
void renderFrame(GLint defaultFBO, float deltaTime, int width, int height);
|
void renderFrame(GLint defaultFBO, float deltaTime, int width, int height);
|
||||||
void render(KRCamera *pCamera, unordered_map<AABB, int> &visibleBounds, const KRViewport &viewport, KRNode::RenderPass renderPass, bool new_frame);
|
void render(KRCamera *pCamera, unordered_map<AABB, int> &visibleBounds, const KRViewport &viewport, KRNode::RenderPass renderPass, bool new_frame);
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
|
|
||||||
#include "vector3.h"
|
#include "vector3.h"
|
||||||
|
|
||||||
namespace kraken {
|
|
||||||
|
|
||||||
class KRNode;
|
class KRNode;
|
||||||
|
|
||||||
|
namespace kraken {
|
||||||
|
|
||||||
class HitInfo {
|
class HitInfo {
|
||||||
public:
|
public:
|
||||||
HitInfo();
|
HitInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user