mirror of
https://github.com/Relintai/godot-lportal.git
synced 2025-02-20 01:04:19 +01:00
Debug lines to show clipping planes to portals
This commit is contained in:
parent
024aef2a1e
commit
d9822e7037
13
lportal.cpp
13
lportal.cpp
@ -22,6 +22,7 @@
|
|||||||
#include "core/engine.h"
|
#include "core/engine.h"
|
||||||
#include "lroom.h"
|
#include "lroom.h"
|
||||||
#include "ldebug.h"
|
#include "ldebug.h"
|
||||||
|
#include "lroom_manager.h"
|
||||||
|
|
||||||
|
|
||||||
bool LPortal::NameStartsWith(Node * pNode, String szSearch)
|
bool LPortal::NameStartsWith(Node * pNode, String szSearch)
|
||||||
@ -71,7 +72,7 @@ String LPortal::FindNameAfter(Node * pNode, String szStart)
|
|||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// add clipping planes to the vector formed by each portal edge and the camera
|
// add clipping planes to the vector formed by each portal edge and the camera
|
||||||
void LPortal::AddPlanes(const Vector3 &ptCam, LVector<Plane> &planes) const
|
void LPortal::AddPlanes(LRoomManager &manager, const Vector3 &ptCam, LVector<Plane> &planes) const
|
||||||
{
|
{
|
||||||
// short version
|
// short version
|
||||||
const Vector<Vector3> &pts = m_ptsWorld;
|
const Vector<Vector3> &pts = m_ptsWorld;
|
||||||
@ -97,6 +98,16 @@ void LPortal::AddPlanes(const Vector3 &ptCam, LVector<Plane> &planes) const
|
|||||||
// first and last
|
// first and last
|
||||||
p = Plane(ptCam, pts[0], pts[nPoints-1]);
|
p = Plane(ptCam, pts[0], pts[nPoints-1]);
|
||||||
planes.push_back(p);
|
planes.push_back(p);
|
||||||
|
|
||||||
|
// debug
|
||||||
|
if (!manager.m_bDebugPlanes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (int n=0; n<nPoints; n++)
|
||||||
|
{
|
||||||
|
manager.m_DebugPlanes.push_back(pts[n]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "lvector.h"
|
#include "lvector.h"
|
||||||
|
|
||||||
class LRoom;
|
class LRoom;
|
||||||
|
class LRoomManager;
|
||||||
|
|
||||||
class LPortal {
|
class LPortal {
|
||||||
public:
|
public:
|
||||||
@ -50,7 +51,7 @@ public:
|
|||||||
String m_szName;
|
String m_szName;
|
||||||
|
|
||||||
LPortal::eClipResult ClipWithPlane(const Plane &p) const;
|
LPortal::eClipResult ClipWithPlane(const Plane &p) const;
|
||||||
void AddPlanes(const Vector3 &ptCam, LVector<Plane> &planes) const;
|
void AddPlanes(LRoomManager &manager, const Vector3 &ptCam, LVector<Plane> &planes) const;
|
||||||
|
|
||||||
// normal determined by winding order
|
// normal determined by winding order
|
||||||
Vector<Vector3> m_ptsWorld;
|
Vector<Vector3> m_ptsWorld;
|
||||||
|
@ -90,7 +90,7 @@ LRoom * LRoom::DOB_Update(LRoomManager &manager, Spatial * pDOB)
|
|||||||
const Vector3 &pt = pDOB->get_global_transform().origin;
|
const Vector3 &pt = pDOB->get_global_transform().origin;
|
||||||
|
|
||||||
// is it the camera?
|
// is it the camera?
|
||||||
bool bCamera = pDOB->get_instance_id() == manager.m_cameraID;
|
bool bCamera = pDOB->get_instance_id() == manager.m_ID_camera;
|
||||||
float slop = 0.2f;
|
float slop = 0.2f;
|
||||||
if (bCamera)
|
if (bCamera)
|
||||||
slop = 0.0f;
|
slop = 0.0f;
|
||||||
@ -144,7 +144,7 @@ void LRoom::FinalizeVisibility(LRoomManager &manager)
|
|||||||
const LDob &dob = m_DOBs[n];
|
const LDob &dob = m_DOBs[n];
|
||||||
|
|
||||||
// don't cull the main camera
|
// don't cull the main camera
|
||||||
if (dob.m_ID == manager.m_cameraID)
|
if (dob.m_ID == manager.m_ID_camera)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Spatial * pS = dob.GetSpatial();
|
Spatial * pS = dob.GetSpatial();
|
||||||
@ -464,7 +464,7 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
|
|||||||
new_planes.copy_from(planes);
|
new_planes.copy_from(planes);
|
||||||
|
|
||||||
// add the planes for the portal
|
// add the planes for the portal
|
||||||
port.AddPlanes(cam.m_ptPos, new_planes);
|
port.AddPlanes(manager, cam.m_ptPos, new_planes);
|
||||||
|
|
||||||
|
|
||||||
if (pLinkedRoom)
|
if (pLinkedRoom)
|
||||||
|
12
lroom.h
12
lroom.h
@ -51,11 +51,10 @@ public:
|
|||||||
|
|
||||||
class LRoom
|
class LRoom
|
||||||
{
|
{
|
||||||
friend class LPortal;
|
|
||||||
friend class LRoomManager;
|
|
||||||
friend class LRoomConverter;
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
// static objects
|
// static objects
|
||||||
LVector<LSob> m_SOBs;
|
LVector<LSob> m_SOBs;
|
||||||
|
|
||||||
@ -82,12 +81,12 @@ private:
|
|||||||
// when registering DOBs and teleporting them
|
// when registering DOBs and teleporting them
|
||||||
LBound m_Bound;
|
LBound m_Bound;
|
||||||
|
|
||||||
String m_szName;
|
|
||||||
|
|
||||||
public:
|
String m_szName;
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const String &get_name() const {return m_szName;}
|
const String &get_name() const {return m_szName;}
|
||||||
|
|
||||||
protected:
|
|
||||||
// main function
|
// main function
|
||||||
void DetermineVisibility_Recursive(LRoomManager &manager, int depth, const LCamera &cam, const LVector<Plane> &planes, int portalID_from = -1);
|
void DetermineVisibility_Recursive(LRoomManager &manager, int depth, const LCamera &cam, const LVector<Plane> &planes, int portalID_from = -1);
|
||||||
void FirstTouch(LRoomManager &manager);
|
void FirstTouch(LRoomManager &manager);
|
||||||
@ -111,7 +110,6 @@ protected:
|
|||||||
bool DOB_Remove(unsigned int ui);
|
bool DOB_Remove(unsigned int ui);
|
||||||
LRoom * DOB_Update(LRoomManager &manager, Spatial * pDOB);
|
LRoom * DOB_Update(LRoomManager &manager, Spatial * pDOB);
|
||||||
|
|
||||||
public:
|
|
||||||
LRoom();
|
LRoom();
|
||||||
Spatial * GetGodotRoom() const;
|
Spatial * GetGodotRoom() const;
|
||||||
|
|
||||||
|
@ -24,10 +24,12 @@
|
|||||||
#include "scene/3d/mesh_instance.h"
|
#include "scene/3d/mesh_instance.h"
|
||||||
#include "lroom_converter.h"
|
#include "lroom_converter.h"
|
||||||
#include "ldebug.h"
|
#include "ldebug.h"
|
||||||
|
#include "scene/3d/immediate_geometry.h"
|
||||||
|
|
||||||
LRoomManager::LRoomManager()
|
LRoomManager::LRoomManager()
|
||||||
{
|
{
|
||||||
m_cameraID = 0;
|
m_ID_camera = 0;
|
||||||
|
m_ID_DebugPlanes = 0;
|
||||||
m_uiFrameCounter = 0;
|
m_uiFrameCounter = 0;
|
||||||
m_iLoggingLevel = 2;
|
m_iLoggingLevel = 2;
|
||||||
m_bActive = true;
|
m_bActive = true;
|
||||||
@ -36,6 +38,8 @@ LRoomManager::LRoomManager()
|
|||||||
// to know which rooms to hide we keep track of which were shown this, and the previous frame
|
// to know which rooms to hide we keep track of which were shown this, and the previous frame
|
||||||
m_pCurr_VisibleRoomList = &m_VisibleRoomList_A;
|
m_pCurr_VisibleRoomList = &m_VisibleRoomList_A;
|
||||||
m_pPrev_VisibleRoomList = &m_VisibleRoomList_B;
|
m_pPrev_VisibleRoomList = &m_VisibleRoomList_B;
|
||||||
|
|
||||||
|
m_bDebugPlanes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LRoomManager::FindClosestRoom(const Vector3 &pt) const
|
int LRoomManager::FindClosestRoom(const Vector3 &pt) const
|
||||||
@ -185,6 +189,30 @@ bool LRoomManager::dob_register_hint(Node * pDOB, float radius, Node * pRoom)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LRoomManager::CreateDebug()
|
||||||
|
{
|
||||||
|
ImmediateGeometry * p = memnew(ImmediateGeometry);
|
||||||
|
p->set_name("debug_planes");
|
||||||
|
add_child(p);
|
||||||
|
|
||||||
|
m_ID_DebugPlanes = p->get_instance_id();
|
||||||
|
|
||||||
|
// m_mat_Debug_Planes->set_as_toplevel(true);
|
||||||
|
|
||||||
|
m_mat_Debug_Planes = Ref<SpatialMaterial>(memnew(SpatialMaterial));
|
||||||
|
m_mat_Debug_Planes->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
|
||||||
|
// m_mat_Debug_Planes->set_line_width(6.0);
|
||||||
|
// m_mat_Debug_Planes->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
|
||||||
|
// m_mat_Debug_Planes->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||||
|
// m_mat_Debug_Planes->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
|
||||||
|
m_mat_Debug_Planes->set_albedo(Color(1, 0, 1, 1));
|
||||||
|
|
||||||
|
p->set_material_override(m_mat_Debug_Planes);
|
||||||
|
|
||||||
|
p->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LRoomManager::DobRegister(Spatial * pDOB, float radius, int iRoom)
|
bool LRoomManager::DobRegister(Spatial * pDOB, float radius, int iRoom)
|
||||||
{
|
{
|
||||||
//LPRINT(3, "register_dob " + pDOB->get_name());
|
//LPRINT(3, "register_dob " + pDOB->get_name());
|
||||||
@ -234,22 +262,6 @@ bool LRoomManager::dob_register(Node * pDOB, float radius)
|
|||||||
LPRINT(2, "dob_register closest room " + itos(iRoomNum));
|
LPRINT(2, "dob_register closest room " + itos(iRoomNum));
|
||||||
|
|
||||||
return DobRegister(pSpat, radius, iRoomNum);
|
return DobRegister(pSpat, radius, iRoomNum);
|
||||||
// if (iRoomNum == -1)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
// LRoom * pRoom = GetRoom(iRoomNum);
|
|
||||||
// if (!pRoom)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
// LDob dob;
|
|
||||||
// dob.m_ID = pSpat->get_instance_id();
|
|
||||||
// dob.m_fRadius = radius;
|
|
||||||
|
|
||||||
// pRoom->DOB_Add(dob);
|
|
||||||
|
|
||||||
// // save the room ID on the dob metadata
|
|
||||||
// Obj_SetRoomNum(pSpat, iRoomNum);
|
|
||||||
// return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -380,33 +392,6 @@ bool LRoomManager::dob_teleport(Node * pDOB)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
return DobTeleport(pSpat, iRoomNum);
|
return DobTeleport(pSpat, iRoomNum);
|
||||||
|
|
||||||
// // old room
|
|
||||||
// LRoom * pOldRoom = GetRoomFromDOB(pDOB);
|
|
||||||
// if (!pOldRoom)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
|
|
||||||
// LRoom * pNewRoom = GetRoom(iRoomNum);
|
|
||||||
// if (!pNewRoom)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
// // detach from old room, add to new room
|
|
||||||
// // get dob data to move to new room
|
|
||||||
// unsigned int dob_id = pOldRoom->DOB_Find(pDOB);
|
|
||||||
// assert (dob_id != -1);
|
|
||||||
|
|
||||||
// // copy across data before removing
|
|
||||||
// const LDob &data = pOldRoom->DOB_Get(dob_id);
|
|
||||||
// pNewRoom->DOB_Add(data);
|
|
||||||
|
|
||||||
// // remove from old room
|
|
||||||
// pOldRoom->DOB_Remove(dob_id);
|
|
||||||
|
|
||||||
// // save the room ID on the dob metadata
|
|
||||||
// Obj_SetRoomNum(pSpat, iRoomNum);
|
|
||||||
|
|
||||||
// return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -439,6 +424,22 @@ Node * LRoomManager::rooms_get_room(int room_id)
|
|||||||
return pRoom->GetGodotRoom();
|
return pRoom->GetGodotRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LRoomManager::rooms_set_debug_planes(bool bActive)
|
||||||
|
{
|
||||||
|
m_bDebugPlanes = bActive;
|
||||||
|
|
||||||
|
Object * pObj = ObjectDB::get_instance(m_ID_DebugPlanes);
|
||||||
|
ImmediateGeometry * im = Object::cast_to<ImmediateGeometry>(pObj);
|
||||||
|
if (!im)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (bActive)
|
||||||
|
im->show();
|
||||||
|
else
|
||||||
|
im->hide();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// turn on and off culling for debugging
|
// turn on and off culling for debugging
|
||||||
void LRoomManager::rooms_set_active(bool bActive)
|
void LRoomManager::rooms_set_active(bool bActive)
|
||||||
@ -480,7 +481,7 @@ void LRoomManager::rooms_log_frame()
|
|||||||
|
|
||||||
void LRoomManager::rooms_set_camera(Node * pCam)
|
void LRoomManager::rooms_set_camera(Node * pCam)
|
||||||
{
|
{
|
||||||
m_cameraID = 0;
|
m_ID_camera = 0;
|
||||||
|
|
||||||
if (!pCam)
|
if (!pCam)
|
||||||
return;
|
return;
|
||||||
@ -492,7 +493,7 @@ void LRoomManager::rooms_set_camera(Node * pCam)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cameraID = pCam->get_instance_id();
|
m_ID_camera = pCam->get_instance_id();
|
||||||
|
|
||||||
// use this temporarily to force debug
|
// use this temporarily to force debug
|
||||||
// rooms_log_frame();
|
// rooms_log_frame();
|
||||||
@ -531,6 +532,9 @@ void LRoomManager::FrameUpdate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_bDebugPlanes)
|
||||||
|
m_DebugPlanes.clear();
|
||||||
|
|
||||||
// we keep a frame counter to prevent visiting things multiple times on the same frame in recursive functions
|
// we keep a frame counter to prevent visiting things multiple times on the same frame in recursive functions
|
||||||
m_uiFrameCounter++;
|
m_uiFrameCounter++;
|
||||||
|
|
||||||
@ -541,9 +545,9 @@ void LRoomManager::FrameUpdate()
|
|||||||
|
|
||||||
// get the camera desired and make into lcamera
|
// get the camera desired and make into lcamera
|
||||||
Camera * pCamera = 0;
|
Camera * pCamera = 0;
|
||||||
if (m_cameraID)
|
if (m_ID_camera)
|
||||||
{
|
{
|
||||||
Object *pObj = ObjectDB::get_instance(m_cameraID);
|
Object *pObj = ObjectDB::get_instance(m_ID_camera);
|
||||||
pCamera = Object::cast_to<Camera>(pObj);
|
pCamera = Object::cast_to<Camera>(pObj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -588,7 +592,7 @@ void LRoomManager::FrameUpdate()
|
|||||||
assert (pCamera);
|
assert (pCamera);
|
||||||
Transform tr = pCamera->get_global_transform();
|
Transform tr = pCamera->get_global_transform();
|
||||||
cam.m_ptPos = tr.origin;
|
cam.m_ptPos = tr.origin;
|
||||||
cam.m_ptDir = tr.basis.get_row(2); // or possibly get_axis .. z is what we want
|
cam.m_ptDir = -tr.basis.get_axis(2); // or possibly get_axis .. z is what we want
|
||||||
|
|
||||||
// luckily godot already has a function to return a list of the camera clipping planes
|
// luckily godot already has a function to return a list of the camera clipping planes
|
||||||
planes.copy_from(pCamera->get_frustum());
|
planes.copy_from(pCamera->get_frustum());
|
||||||
@ -643,20 +647,57 @@ void LRoomManager::FrameUpdate()
|
|||||||
|
|
||||||
// hide all the DOB
|
// hide all the DOB
|
||||||
|
|
||||||
|
// draw debug
|
||||||
|
FrameUpdate_DrawDebug(cam);
|
||||||
|
|
||||||
// when running, emit less debugging output so as not to choke the IDE
|
// when running, emit less debugging output so as not to choke the IDE
|
||||||
Lawn::LDebug::m_bRunning = true;
|
Lawn::LDebug::m_bRunning = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LRoomManager::FrameUpdate_DrawDebug(const LCamera &cam)
|
||||||
|
{
|
||||||
|
if (!m_bDebugPlanes)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Vector3 ptCam = cam.m_ptPos;
|
||||||
|
// slight adjustment to prevent parallel lines in viewport
|
||||||
|
ptCam += (cam.m_ptDir * 0.1f);
|
||||||
|
|
||||||
|
Object * pObj = ObjectDB::get_instance(m_ID_DebugPlanes);
|
||||||
|
ImmediateGeometry * im = Object::cast_to<ImmediateGeometry>(pObj);
|
||||||
|
if (!im)
|
||||||
|
return;
|
||||||
|
|
||||||
|
im->clear();
|
||||||
|
|
||||||
|
im->begin(Mesh::PRIMITIVE_LINES, NULL);
|
||||||
|
|
||||||
|
int nVerts = m_DebugPlanes.size();
|
||||||
|
|
||||||
|
for (int n=0; n<nVerts; n++)
|
||||||
|
{
|
||||||
|
im->add_vertex(ptCam);
|
||||||
|
im->add_vertex(m_DebugPlanes[n]);
|
||||||
|
}
|
||||||
|
im->end();
|
||||||
|
}
|
||||||
|
|
||||||
void LRoomManager::_notification(int p_what) {
|
void LRoomManager::_notification(int p_what) {
|
||||||
|
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
// turn on process, unless we are in the editor
|
// turn on process, unless we are in the editor
|
||||||
if (!Engine::get_singleton()->is_editor_hint())
|
if (!Engine::get_singleton()->is_editor_hint())
|
||||||
|
{
|
||||||
set_process_internal(true);
|
set_process_internal(true);
|
||||||
|
CreateDebug();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
set_process_internal(false);
|
set_process_internal(false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_PROCESS: {
|
case NOTIFICATION_INTERNAL_PROCESS: {
|
||||||
FrameUpdate();
|
FrameUpdate();
|
||||||
@ -676,6 +717,7 @@ void LRoomManager::_bind_methods()
|
|||||||
ClassDB::bind_method(D_METHOD("rooms_set_logging"), &LRoomManager::rooms_set_logging);
|
ClassDB::bind_method(D_METHOD("rooms_set_logging"), &LRoomManager::rooms_set_logging);
|
||||||
ClassDB::bind_method(D_METHOD("rooms_log_frame"), &LRoomManager::rooms_log_frame);
|
ClassDB::bind_method(D_METHOD("rooms_log_frame"), &LRoomManager::rooms_log_frame);
|
||||||
ClassDB::bind_method(D_METHOD("rooms_set_active"), &LRoomManager::rooms_set_active);
|
ClassDB::bind_method(D_METHOD("rooms_set_active"), &LRoomManager::rooms_set_active);
|
||||||
|
ClassDB::bind_method(D_METHOD("rooms_set_debug_planes"), &LRoomManager::rooms_set_debug_planes);
|
||||||
|
|
||||||
|
|
||||||
// functions to add dynamic objects to the culling system
|
// functions to add dynamic objects to the culling system
|
||||||
|
@ -44,7 +44,7 @@ class LRoomManager : public Spatial {
|
|||||||
|
|
||||||
|
|
||||||
// godot ID of the camera (which should be registered as a DOB to allow moving between rooms)
|
// godot ID of the camera (which should be registered as a DOB to allow moving between rooms)
|
||||||
ObjectID m_cameraID;
|
ObjectID m_ID_camera;
|
||||||
|
|
||||||
// keep track of which rooms are visible, so we can hide ones that aren't hit that were previously on
|
// keep track of which rooms are visible, so we can hide ones that aren't hit that were previously on
|
||||||
Lawn::LBitField_Dynamic m_BF_visible_rooms;
|
Lawn::LBitField_Dynamic m_BF_visible_rooms;
|
||||||
@ -82,6 +82,8 @@ public:
|
|||||||
// turn on and off culling for debugging
|
// turn on and off culling for debugging
|
||||||
void rooms_set_active(bool bActive);
|
void rooms_set_active(bool bActive);
|
||||||
|
|
||||||
|
void rooms_set_debug_planes(bool bActive);
|
||||||
|
|
||||||
// 0 to 6 .. defaults to 4 which is (2) in our priorities (i.e. 6 - level)
|
// 0 to 6 .. defaults to 4 which is (2) in our priorities (i.e. 6 - level)
|
||||||
void rooms_set_logging(int level);
|
void rooms_set_logging(int level);
|
||||||
|
|
||||||
@ -124,6 +126,7 @@ private:
|
|||||||
// internal
|
// internal
|
||||||
bool DobRegister(Spatial * pDOB, float radius, int iRoom);
|
bool DobRegister(Spatial * pDOB, float radius, int iRoom);
|
||||||
bool DobTeleport(Spatial * pDOB, int iNewRoomID);
|
bool DobTeleport(Spatial * pDOB, int iNewRoomID);
|
||||||
|
void CreateDebug();
|
||||||
|
|
||||||
|
|
||||||
// helper funcs
|
// helper funcs
|
||||||
@ -144,12 +147,25 @@ private:
|
|||||||
// debugging emulate view frustum
|
// debugging emulate view frustum
|
||||||
void FrameUpdate_FrustumOnly();
|
void FrameUpdate_FrustumOnly();
|
||||||
|
|
||||||
|
// draw planes and room hulls
|
||||||
|
void FrameUpdate_DrawDebug(const LCamera &cam);
|
||||||
|
|
||||||
// find which room is linked by a portal
|
// find which room is linked by a portal
|
||||||
LRoom &Portal_GetLinkedRoom(const LPortal &port);
|
LRoom &Portal_GetLinkedRoom(const LPortal &port);
|
||||||
|
|
||||||
// lists of rooms and portals, contiguous list so cache friendly
|
// lists of rooms and portals, contiguous list so cache friendly
|
||||||
LVector<LRoom> m_Rooms;
|
LVector<LRoom> m_Rooms;
|
||||||
LVector<LPortal> m_Portals;
|
LVector<LPortal> m_Portals;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// whether debug planes is switched on
|
||||||
|
bool m_bDebugPlanes;
|
||||||
|
|
||||||
|
// the planes are shown as a list of lines from the camera to the portal verts
|
||||||
|
LVector<Vector3> m_DebugPlanes;
|
||||||
|
private:
|
||||||
|
ObjectID m_ID_DebugPlanes;
|
||||||
|
Ref<SpatialMaterial> m_mat_Debug_Planes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user