mirror of
https://github.com/Relintai/godot-lportal.git
synced 2024-11-11 10:52:09 +01:00
Mid conversion to render sob list
This commit is contained in:
parent
7f5eb565e1
commit
02184f2022
20
lroom.cpp
20
lroom.cpp
@ -344,11 +344,6 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
|
||||
{
|
||||
LSob &sob = manager.m_SOBs[n];
|
||||
|
||||
// already determined to be visible through another portal
|
||||
//if (sob.m_bVisible)
|
||||
//continue;
|
||||
|
||||
|
||||
//LPRINT_RUN(2, "sob " + itos(n) + " " + sob.GetSpatial()->get_name());
|
||||
// already determined to be visible through another portal
|
||||
if (manager.m_BF_visible_SOBs.GetBit(n))
|
||||
@ -388,8 +383,8 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
|
||||
//sob.m_bSOBVisible = true;
|
||||
// sob is renderable and visible (not shadow only)
|
||||
manager.m_BF_visible_SOBs.SetBit(n, true);
|
||||
//manager.m_BF_render_SOBs.SetBit(n, true);
|
||||
//manager.m_RenderList_SOBs.push_back(n);
|
||||
manager.m_BF_render_SOBs.SetBit(n, true);
|
||||
manager.m_RenderList_SOBs.push_back(n);
|
||||
}
|
||||
|
||||
} // for through sobs
|
||||
@ -440,23 +435,12 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
|
||||
{
|
||||
int port_id = m_iFirstPortal + port_num;
|
||||
|
||||
// ignore if the portal we are looking in from
|
||||
// is this needed? surely the portal we are looking in from is in another room?
|
||||
// if (port_id == portalID_from)
|
||||
// {
|
||||
// LPRINT_RUN(2, "\tIGNORING PORTAL LOOKING IN FROM");
|
||||
// continue;
|
||||
// }
|
||||
|
||||
const LPortal &port = manager.m_Portals[port_id];
|
||||
|
||||
// have we already handled the room on this frame?
|
||||
// get the room pointed to by the portal
|
||||
LRoom * pLinkedRoom = &manager.Portal_GetLinkedRoom(port);
|
||||
|
||||
// if (pLinkedRoom->m_uiFrameTouched == manager.m_uiFrameCounter)
|
||||
// continue;
|
||||
|
||||
// cull by portal angle to camera.
|
||||
// Note we need to deal with 'side on' portals, and the camera has a spreading view, so we cannot simply dot
|
||||
// the portal normal with camera direction, we need to take into account angle to the portal itself.
|
||||
|
@ -61,7 +61,7 @@ void LRoomConverter::Convert(LRoomManager &manager)
|
||||
// make sure manager bitfields are the correct size for number of objects
|
||||
int num_sobs = LMAN->m_SOBs.size();
|
||||
LPRINT(5,"Total SOBs " + itos(num_sobs));
|
||||
//LMAN->m_BF_render_SOBs.Create(num_sobs);
|
||||
LMAN->m_BF_render_SOBs.Create(num_sobs);
|
||||
LMAN->m_BF_visible_SOBs.Create(num_sobs);
|
||||
|
||||
|
||||
|
@ -625,8 +625,8 @@ void LRoomManager::FrameUpdate()
|
||||
|
||||
// clear the visible room list to write to each frame
|
||||
m_pCurr_VisibleRoomList->clear();
|
||||
//m_RenderList_SOBs.clear();
|
||||
//m_BF_render_SOBs.Blank();
|
||||
m_RenderList_SOBs.clear();
|
||||
m_BF_render_SOBs.Blank();
|
||||
m_BF_visible_SOBs.Blank();
|
||||
|
||||
// get the camera desired and make into lcamera
|
||||
|
@ -49,6 +49,12 @@ class LRoomManager : public Spatial {
|
||||
// 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;
|
||||
|
||||
|
||||
// the render list is all objects that are in view,
|
||||
// and also objects out of view but casting shadows INTO the view
|
||||
LVector<int> m_RenderList_SOBs;
|
||||
Lawn::LBitField_Dynamic m_BF_render_SOBs;
|
||||
|
||||
// visible bit marks in view, if not set, it is a shadow caster only
|
||||
Lawn::LBitField_Dynamic m_BF_visible_SOBs;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user