mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-13 15:34:37 +00:00
pathfinder change: triangulation now handles static object update and removal. dcdt initialization is moved to RequestTriangulationPath() and will only be invoked when -triPathfind flag is supplied. unit radius slightly increased (again) to revolve the unit bouncing problem around buildings.
This was SVN commit r5416.
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "ps/GameSetup/Config.h"
|
||||
|
||||
const float MAX_ROTATION_RATE = 2*PI; // radians per second
|
||||
|
||||
CEntity::CEntity( CEntityTemplate* base, CVector3D position, float orientation, const std::set<CStr8>& actorSelections, const CStrW* building )
|
||||
@@ -222,6 +224,22 @@ void CEntity::initAuraData()
|
||||
}
|
||||
}
|
||||
|
||||
void CEntity::removeObstacle()
|
||||
{
|
||||
if(g_Pathfinder.dcdtInitialized)
|
||||
{
|
||||
g_Pathfinder.dcdtPathfinder.remove_polygon(m_dcdtId);
|
||||
g_Pathfinder.dcdtPathfinder.DeleteAbstraction();
|
||||
g_Pathfinder.dcdtPathfinder.Abstract();
|
||||
|
||||
if(g_ShowOverlay)
|
||||
{
|
||||
g_Pathfinder.drawTriangulation();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CEntity::Kill(bool keepActor)
|
||||
{
|
||||
if( entf_get( ENTF_DESTROYED ) )
|
||||
@@ -253,6 +271,10 @@ void CEntity::Kill(bool keepActor)
|
||||
m_extant = false;
|
||||
|
||||
UpdateCollisionPatch();
|
||||
|
||||
//Kai: added to remove the entity in the polygon soup (for triangulation)
|
||||
removeObstacle();
|
||||
|
||||
|
||||
g_Selection.RemoveAll( me );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user