Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+28
-28
@@ -230,16 +230,16 @@ void BuildingManager::Tick(const dtEntity::Message &message)
|
||||
dtEntityOSG::LayerAttachPointComponent *lac;
|
||||
if (!mEntityManager->GetComponent(dspl.mAttachPointId, lac))
|
||||
{
|
||||
WARNING_LOG() << "NO sLayerAttachPointComponent";
|
||||
WARNING_LOG(m_logger) << "NO sLayerAttachPointComponent";
|
||||
return;
|
||||
}
|
||||
if( shotdspl.mGeode.valid())
|
||||
{
|
||||
DEBUG_LOG() << "displayTimeOver OVER KILL IT drawables: !" << shotdspl.mGeode->getNumDrawables();
|
||||
DEBUG_LOG(m_logger) << "displayTimeOver OVER KILL IT drawables: !" << shotdspl.mGeode->getNumDrawables();
|
||||
while (shotdspl.mGeode->getNumDrawables() > 0)
|
||||
shotdspl.mGeode->removeDrawables(0, shotdspl.mGeode->getNumDrawables());
|
||||
bool ret = lac->GetNode()->asGroup()->removeChild(shotdspl.mGeode);
|
||||
DEBUG_LOG() << "displayTimeOver OVER KILL IT! result: " << ret;
|
||||
DEBUG_LOG(m_logger) << "displayTimeOver OVER KILL IT! result: " << ret;
|
||||
|
||||
|
||||
dtEntity::GetWindowInterface()->RequestRedraw(dspl.mContextId);
|
||||
@@ -248,7 +248,7 @@ void BuildingManager::Tick(const dtEntity::Message &message)
|
||||
|
||||
if (lifeTimeOver)
|
||||
{
|
||||
DEBUG_LOG() << "lifeTimeOver OVER ERASE IT!";
|
||||
DEBUG_LOG(m_logger) << "lifeTimeOver OVER ERASE IT!";
|
||||
itShotDisplay = dspl.mShotDisplays.erase(itShotDisplay);
|
||||
}
|
||||
else
|
||||
@@ -280,7 +280,7 @@ bool BuildingManager::getFloorOfRoom(const std::string &bdlgFeatureId, int roomN
|
||||
|
||||
void BuildingManager::updateShotDuration(unsigned int newDuration_s)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " newDuration_s= " << newDuration_s;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " newDuration_s= " << newDuration_s;
|
||||
|
||||
QMutexLocker locker(&m_mutexShots);
|
||||
|
||||
@@ -294,7 +294,7 @@ void BuildingManager::updateShotDuration(unsigned int newDuration_s)
|
||||
if (!building->mDisplays.empty())
|
||||
{
|
||||
BuildingDisplay buildingDisplay = building->mDisplays.front();
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " buildingDisplay.mContextId " << buildingDisplay.mContextId;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " buildingDisplay.mContextId " << buildingDisplay.mContextId;
|
||||
updateShots(*building, buildingDisplay);
|
||||
dtEntity::GetWindowInterface()->RequestRedraw(buildingDisplay.mContextId);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ bool BuildingManager::displayBuilding(const std::string& featureId, unsigned int
|
||||
|
||||
bool BuildingManager::displayBuilding(unsigned int contextid, dtEntity::EntityId buildingid, const osg::Vec4& bgcolor, ViewMode viewmode, bool exactPos)
|
||||
{
|
||||
DEBUG_LOG() << "BuildingManager::displayBuilding";
|
||||
DEBUG_LOG(m_logger) << "BuildingManager::displayBuilding";
|
||||
mExactPos = exactPos;
|
||||
dtEntity::EntityManager &em = *mEntityManager;
|
||||
|
||||
@@ -629,7 +629,7 @@ bool BuildingManager::displayBuilding(unsigned int contextid, dtEntity::EntityId
|
||||
|
||||
|
||||
{
|
||||
DEBUG_LOG() << "mDevices.size = " << building->mDevices.size();
|
||||
DEBUG_LOG(m_logger) << "mDevices.size = " << building->mDevices.size();
|
||||
if (!building->mDevices.empty())
|
||||
{
|
||||
for (Device *d : building->mDevices)
|
||||
@@ -1333,7 +1333,7 @@ void BuildingManager::updatePlayerPosition(const std::string &navmeshgrpname, dt
|
||||
|
||||
osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisplay &dspl, const osg::Vec3d &world, int roomNumber)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str()
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str()
|
||||
<< ", roomNumber= " << roomNumber;
|
||||
|
||||
if (roomNumber > 0)
|
||||
@@ -1349,7 +1349,7 @@ osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisp
|
||||
if (level.mFloorId == floorOut)
|
||||
{
|
||||
const osg::Vec3d &l = world * bd.mWorldToLocal;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str()
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str()
|
||||
<< ", roomNumber= " << roomNumber
|
||||
<< ", floorOut= " << floorOut
|
||||
<< ", world.z()= " << world.z()
|
||||
@@ -1369,7 +1369,7 @@ osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisp
|
||||
if (i == (numlevels - 1) || (dspl.mLevels[i + 1].mHeightAboveGround - 0.1f) > l[2])
|
||||
{
|
||||
const BuildingLevel &level = dspl.mLevels[i];
|
||||
DEBUG_LOG() << Q_FUNC_INFO
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " remapXPosition"
|
||||
<< ", l.z=" << l.z()
|
||||
<< ", i=" << i
|
||||
@@ -1603,11 +1603,11 @@ dtEntity::EntityId BuildingManager::getWorldPlayerIdFromLocalPlayer(dtEntity::En
|
||||
|
||||
void BuildingManager::removeShoot(int32_t id)
|
||||
{
|
||||
DEBUG_LOG() << "removeShoot id=" << id;
|
||||
DEBUG_LOG(m_logger) << "removeShoot id=" << id;
|
||||
QMutexLocker locker(&m_mutexShots);
|
||||
for (Building *bldg : mBuildings)
|
||||
{
|
||||
DEBUG_LOG() << "Vorher: bldg->mShots.size()=" << bldg->mShots.size();
|
||||
DEBUG_LOG(m_logger) << "Vorher: bldg->mShots.size()=" << bldg->mShots.size();
|
||||
auto it = std::remove_if(bldg->mShots.begin(), bldg->mShots.end(),
|
||||
[id]( Shot *shot)
|
||||
{
|
||||
@@ -1625,12 +1625,12 @@ void BuildingManager::removeShoot(int32_t id)
|
||||
bool wasRemoved = (it != bldg->mShots.end());
|
||||
|
||||
bldg->mShots.erase(it, bldg->mShots.end());
|
||||
DEBUG_LOG() << "Nachher: bldg->mShots.size()=" << bldg->mShots.size();
|
||||
DEBUG_LOG(m_logger) << "Nachher: bldg->mShots.size()=" << bldg->mShots.size();
|
||||
|
||||
if (wasRemoved)
|
||||
for (BuildingDisplay &dspl : bldg->mDisplays)
|
||||
{
|
||||
DEBUG_LOG() << "wasRemoved id=" << id;
|
||||
DEBUG_LOG(m_logger) << "wasRemoved id=" << id;
|
||||
updateShots(*bldg, dspl);
|
||||
dtEntity::GetWindowInterface()->RequestRedraw(dspl.mContextId);
|
||||
}
|
||||
@@ -1694,13 +1694,13 @@ void BuildingManager::showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity
|
||||
}
|
||||
}
|
||||
bldg->mShots.push_back(shot);
|
||||
DEBUG_LOG() << "XXXX SIM TIME CREATED = " << QString::number(_simTimeCreated, 'f', 5) << " and SIM TIME IS " <<QString::number(dtEntity::GetSystemInterface()->GetSimulationTime(), 'f', 5);
|
||||
DEBUG_LOG(m_logger) << "XXXX SIM TIME CREATED = " << QString::number(_simTimeCreated, 'f', 5) << " and SIM TIME IS " <<QString::number(dtEntity::GetSystemInterface()->GetSimulationTime(), 'f', 5);
|
||||
|
||||
for (BuildingDisplay &bldgDispl : bldg->mDisplays)
|
||||
{
|
||||
ShotDisplay shotDispl;
|
||||
shotDispl.mShot = shot;
|
||||
DEBUG_LOG() << "mShotDisplays.push_back id=" << shot->getId();
|
||||
DEBUG_LOG(m_logger) << "mShotDisplays.push_back id=" << shot->getId();
|
||||
bldgDispl.mShotDisplays.push_back(std::move(shotDispl));
|
||||
|
||||
updateShots(*bldg, bldgDispl);
|
||||
@@ -1715,7 +1715,7 @@ void BuildingManager::showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity
|
||||
|
||||
void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " Building= " << bd.mWorldBuildingId;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Building= " << bd.mWorldBuildingId;
|
||||
|
||||
dtEntityOSG::CameraComponent *camcomp;
|
||||
if (!mEntityManager->GetComponent(dspl.mCameraId, camcomp))
|
||||
@@ -1728,7 +1728,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
|
||||
|
||||
const double simTime = dtEntity::GetSystemInterface()->GetSimulationTime();
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " dspl.mShotDisplays.size()= " << dspl.mShotDisplays.size()
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dspl.mShotDisplays.size()= " << dspl.mShotDisplays.size()
|
||||
<< ", simTime=" << (int)simTime;
|
||||
|
||||
for (ShotDisplay &shotdspl : dspl.mShotDisplays)
|
||||
@@ -1754,7 +1754,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
|
||||
if (shotdspl.mGeode)
|
||||
numParents = shotdspl.mGeode->getNumParents();
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " BB shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " BB shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
|
||||
<< ", shotdspl.mGeode=" << shotdspl.mGeode
|
||||
<< ", shotdspl.mGeode->getNumParents=" << numParents
|
||||
<< ", bDisplay=" << bDisplay;
|
||||
@@ -1762,7 +1762,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
|
||||
|
||||
if ((!shotdspl.mGeode || shotdspl.mGeode->getNumParents() == 0) && bDisplay)
|
||||
{
|
||||
DEBUG_LOG() << "NEW mGeode! id " << shotdspl.mShot->getId();
|
||||
DEBUG_LOG(m_logger) << "NEW mGeode! id " << shotdspl.mShot->getId();
|
||||
if (!shotdspl.mGeode)
|
||||
shotdspl.mGeode = new osg::Geode();
|
||||
|
||||
@@ -1770,7 +1770,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
|
||||
ss->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
|
||||
ss->setRenderBinDetails(240001, "RenderBin");
|
||||
osg::ref_ptr<osg::LineWidth> lw = new osg::LineWidth();
|
||||
DEBUG_LOG() << "NEW LINE " << shotdspl.mShot->getLineType();
|
||||
DEBUG_LOG(m_logger) << "NEW LINE " << shotdspl.mShot->getLineType();
|
||||
|
||||
if (shotdspl.mShot->getLineType() < 2 )
|
||||
{
|
||||
@@ -1806,7 +1806,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl)
|
||||
shooterpos[2] += 1;
|
||||
targetpos[2] += 1;
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " shotdspl.mShot->getId()= " << shotdspl.mShot->getId()
|
||||
<< ", getShooterPos.z()=" << shotdspl.mShot->getShooterPos().z()
|
||||
<< ", BuildingIdSrc=" << shotdspl.mShot->getBuildingIdSrc() << ", RoomNumberSrc=" << shotdspl.mShot->getRoomNumberSrc()
|
||||
<< ", shooterpos=" << shooterpos
|
||||
@@ -1906,16 +1906,16 @@ void BuildingManager::updateDevices(const Building &bd, BuildingDisplay &dspl)
|
||||
void BuildingManager::addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntity::EntityId buildingid,
|
||||
const osg::Vec3d &pos, const std::string &iconpath)
|
||||
{
|
||||
DEBUG_LOG() << "addDeviceToBuilding";
|
||||
DEBUG_LOG(m_logger) << "addDeviceToBuilding";
|
||||
for (Building *building : mBuildings)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "mWorldBuildingId=" << building->mWorldBuildingId
|
||||
DEBUG_LOG(m_logger) << "mWorldBuildingId=" << building->mWorldBuildingId
|
||||
<< " buildingid=" << buildingid;
|
||||
|
||||
if (building->mWorldBuildingId != buildingid)
|
||||
continue;
|
||||
DEBUG_LOG() << "addDeviceToBuilding 1";
|
||||
DEBUG_LOG(m_logger) << "addDeviceToBuilding 1";
|
||||
|
||||
Device *device = new Device();
|
||||
device->mWorldPlayerId = iconmainid;
|
||||
@@ -1923,10 +1923,10 @@ void BuildingManager::addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntit
|
||||
device->mPosition = pos;
|
||||
building->mDevices.push_back(device);
|
||||
|
||||
DEBUG_LOG() << "building->mDisplays.size=" << building->mDisplays.size();
|
||||
DEBUG_LOG(m_logger) << "building->mDisplays.size=" << building->mDisplays.size();
|
||||
for (BuildingDisplay &dspl : building->mDisplays)
|
||||
{
|
||||
DEBUG_LOG() << "addDeviceToBuilding 2";
|
||||
DEBUG_LOG(m_logger) << "addDeviceToBuilding 2";
|
||||
DeviceDisplay dd;
|
||||
dd.mDevice = device;
|
||||
dd.mWorldPlayerId = iconmainid;
|
||||
|
||||
+2
@@ -196,6 +196,7 @@ public:
|
||||
int32_t getId() const { return mId; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int32_t mId;
|
||||
osg::Vec3d mShooterPos;
|
||||
osg::Vec3d mTargetPos;
|
||||
@@ -424,6 +425,7 @@ public:
|
||||
void setCallbackCamPosChanged(const CallbackCamPosChanged &cb);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void updateShots(const Building &bd, BuildingDisplay &dspl);
|
||||
void updateDevices(const Building &bd, BuildingDisplay &dspl);
|
||||
void createRoomNames(dtEntity::EntityId buildingid, Building& building);
|
||||
|
||||
+2
@@ -308,6 +308,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool open(const std::string& strFeatureID, bool exactPos);
|
||||
bool open(const std::vector<std::string> &vecFeatureIDs, bool exactPos);
|
||||
bool openAll(bool exactPos);
|
||||
|
||||
Reference in new issue
Block a user