mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-09-29 14:12:54 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -38,14 +38,14 @@ public:
|
||||
|
||||
virtual bool canCollideWith ( CollisionProperty const * otherCollision ) const
|
||||
{
|
||||
if(otherCollision == NULL)
|
||||
if(otherCollision == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BarrierObject const * barrier = safe_cast<BarrierObject const *>(&getOwner());
|
||||
|
||||
if(barrier == NULL)
|
||||
if(barrier == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void BarrierObject::createAppearance ( void )
|
||||
|
||||
Appearance * appearance = CellProperty::createPortalBarrier(verts,gs_barrierColor);
|
||||
|
||||
if(appearance != NULL)
|
||||
if(appearance != nullptr)
|
||||
{
|
||||
setAppearance( appearance );
|
||||
|
||||
|
||||
@@ -156,8 +156,8 @@ BoxTreeNode::BoxTreeNode()
|
||||
: m_box(),
|
||||
m_index(-1),
|
||||
m_userId(-1),
|
||||
m_childA(NULL),
|
||||
m_childB(NULL)
|
||||
m_childA(nullptr),
|
||||
m_childB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -165,8 +165,8 @@ BoxTreeNode::BoxTreeNode ( AxialBox const & box, int userId )
|
||||
: m_box(box),
|
||||
m_index(-1),
|
||||
m_userId(userId),
|
||||
m_childA(NULL),
|
||||
m_childB(NULL)
|
||||
m_childA(nullptr),
|
||||
m_childB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -195,10 +195,10 @@ void BoxTreeNode::drawDebugShapes ( DebugShapeRenderer * renderer, VectorArgb co
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(m_childA == NULL) return;
|
||||
if(m_childB == NULL) return;
|
||||
if(m_childA == nullptr) return;
|
||||
if(m_childB == nullptr) return;
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
VectorArgb newColor( color.a, color.r * 0.9f, color.g * 0.9f, color.b * 0.9f );
|
||||
|
||||
@@ -227,7 +227,7 @@ int BoxTreeNode::getNodeCount ( void ) const
|
||||
|
||||
float BoxTreeNode::calcWeight ( void ) const
|
||||
{
|
||||
if((m_childA == NULL) && (m_childB == NULL)) return 1.0f;
|
||||
if((m_childA == nullptr) && (m_childB == nullptr)) return 1.0f;
|
||||
|
||||
float accum = 0.0f;
|
||||
|
||||
@@ -241,9 +241,9 @@ float BoxTreeNode::calcWeight ( void ) const
|
||||
|
||||
float BoxTreeNode::calcBalance ( void ) const
|
||||
{
|
||||
if((m_childA == NULL) && (m_childB == NULL)) return 1.0f;
|
||||
if((m_childA == nullptr) && (m_childB == nullptr)) return 1.0f;
|
||||
|
||||
if((m_childA != NULL) && (m_childB != NULL))
|
||||
if((m_childA != nullptr) && (m_childB != nullptr))
|
||||
{
|
||||
return m_childA->calcWeight() / m_childB->calcWeight();
|
||||
}
|
||||
@@ -288,8 +288,8 @@ void BoxTreeNode::packInto ( BoxTreeNode * node, BoxTreeNode * base ) const
|
||||
node->m_box = m_box;
|
||||
node->m_index = m_index;
|
||||
|
||||
node->m_childA = m_childA ? (base + m_childA->m_index) : NULL;
|
||||
node->m_childB = m_childB ? (base + m_childB->m_index) : NULL;
|
||||
node->m_childA = m_childA ? (base + m_childA->m_index) : nullptr;
|
||||
node->m_childB = m_childB ? (base + m_childB->m_index) : nullptr;
|
||||
|
||||
node->m_userId = m_userId;
|
||||
}
|
||||
@@ -302,10 +302,10 @@ void BoxTreeNode::deleteChildren ( void )
|
||||
if(m_childB) m_childB->deleteChildren();
|
||||
|
||||
delete m_childA;
|
||||
m_childA = NULL;
|
||||
m_childA = nullptr;
|
||||
|
||||
delete m_childB;
|
||||
m_childB = NULL;
|
||||
m_childB = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -341,8 +341,8 @@ void BoxTreeNode::read ( Iff & iff, BoxTreeNode * base )
|
||||
int indexA = iff.read_int32();
|
||||
int indexB = iff.read_int32();
|
||||
|
||||
m_childA = ( indexA != -1 ? base + indexA : NULL );
|
||||
m_childB = ( indexB != -1 ? base + indexB : NULL );
|
||||
m_childA = ( indexA != -1 ? base + indexA : nullptr );
|
||||
m_childB = ( indexB != -1 ? base + indexB : nullptr );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -361,7 +361,7 @@ bool BoxTreeNode::findClosest ( Vector const & V, float maxDistance, float & out
|
||||
// ----------
|
||||
// Leaf node case - this leaf node is closer
|
||||
|
||||
if((m_childA == NULL) && (m_childB == NULL))
|
||||
if((m_childA == nullptr) && (m_childB == nullptr))
|
||||
{
|
||||
outDistance = dist;
|
||||
outIndex = m_userId;
|
||||
@@ -417,8 +417,8 @@ void BoxTree::install()
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
BoxTree::BoxTree()
|
||||
: m_flatNodes(NULL),
|
||||
m_root(NULL),
|
||||
: m_flatNodes(nullptr),
|
||||
m_root(nullptr),
|
||||
m_testCounter(0)
|
||||
{
|
||||
}
|
||||
@@ -443,7 +443,7 @@ void BoxTree::build ( BoxVec const & boxes )
|
||||
|
||||
// ----------
|
||||
|
||||
BoxTreeNodePVec nodes(boxes.size(),NULL);
|
||||
BoxTreeNodePVec nodes(boxes.size(),nullptr);
|
||||
|
||||
int boxcount = boxes.size();
|
||||
|
||||
@@ -488,7 +488,7 @@ void BoxTree::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(m_root) m_root->drawDebugShapes( renderer, VectorArgb::solidWhite, 0 );
|
||||
|
||||
@@ -546,7 +546,7 @@ static inline void templateTestOverlapRecurse( BoxTreeNode const * node, TestSha
|
||||
template< class TestShape >
|
||||
static inline bool templateTestOverlap( BoxTree const & tree, TestShape const & testShape, IdVec & outIds )
|
||||
{
|
||||
if(tree.getRoot() == NULL) return false;
|
||||
if(tree.getRoot() == nullptr) return false;
|
||||
|
||||
int oldSize = outIds.size();
|
||||
|
||||
@@ -580,7 +580,7 @@ static inline void templateTestOverlapRecurse2( BoxTreeNode const * node, TestSh
|
||||
template< class TestShape >
|
||||
static inline bool templateTestOverlap2( BoxTree const & tree, TestShape const & testShape, IdVec & outIds )
|
||||
{
|
||||
if(tree.getRoot() == NULL) return false;
|
||||
if(tree.getRoot() == nullptr) return false;
|
||||
|
||||
int oldSize = outIds.size();
|
||||
|
||||
@@ -701,11 +701,11 @@ void BoxTree::clear ( void )
|
||||
m_root->deleteChildren();
|
||||
|
||||
delete m_root;
|
||||
m_root = NULL;
|
||||
m_root = nullptr;
|
||||
}
|
||||
|
||||
delete m_flatNodes;
|
||||
m_flatNodes = NULL;
|
||||
m_flatNodes = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -108,7 +108,7 @@ inline int BoxTree::getTestCounter ( void ) const
|
||||
|
||||
inline bool BoxTree::isFlat ( void ) const
|
||||
{
|
||||
return m_flatNodes != NULL;
|
||||
return m_flatNodes != nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -162,7 +162,7 @@ void CollisionBuckets::build(Vector const & minimumBounds, Vector const & maximu
|
||||
(*m_nodeMatrix)[xx].resize(m_bucketsAlongY);
|
||||
for (unsigned int yy = 0; yy < m_bucketsAlongY; ++yy)
|
||||
{
|
||||
// note that nodes are initialized to NULL
|
||||
// note that nodes are initialized to nullptr
|
||||
(*m_nodeMatrix)[xx][yy].resize(m_bucketsAlongZ, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ CollisionMesh::CollisionMesh()
|
||||
: CollisionSurface(),
|
||||
m_id(0),
|
||||
m_version(1),
|
||||
m_boxTree(NULL),
|
||||
m_extent(NULL),
|
||||
m_boxTree(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_boundsDirty(true)
|
||||
{
|
||||
m_extent = new SimpleExtent( MultiShape(AxialBox()) );
|
||||
@@ -116,10 +116,10 @@ CollisionMesh::CollisionMesh()
|
||||
CollisionMesh::~CollisionMesh()
|
||||
{
|
||||
delete m_boxTree;
|
||||
m_boxTree = NULL;
|
||||
m_boxTree = nullptr;
|
||||
|
||||
delete m_extent;
|
||||
m_extent = NULL;
|
||||
m_extent = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -154,7 +154,7 @@ BaseExtent const * CollisionMesh::getExtent_p ( void ) const
|
||||
void CollisionMesh::clear ( void )
|
||||
{
|
||||
delete m_boxTree;
|
||||
m_boxTree = NULL;
|
||||
m_boxTree = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1010,7 +1010,7 @@ void CollisionMesh::transform( CollisionMesh const * sourceMesh, Transform const
|
||||
|
||||
bool CollisionMesh::hasBoxTree ( void ) const
|
||||
{
|
||||
return m_boxTree != NULL;
|
||||
return m_boxTree != nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -75,7 +75,7 @@ void CollisionNotification::purgeQueue ( void )
|
||||
|
||||
Object * object = entry.m_object;
|
||||
|
||||
if(object == NULL) continue;
|
||||
if(object == nullptr) continue;
|
||||
|
||||
if(entry.m_added)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
namespace CollisionPropertyNamespace
|
||||
{
|
||||
CollisionProperty * ms_activeListHead = NULL;
|
||||
CollisionProperty * ms_activeListHead = nullptr;
|
||||
};
|
||||
|
||||
using namespace CollisionPropertyNamespace;
|
||||
@@ -64,8 +64,8 @@ void CollisionProperty::detachList ( void )
|
||||
ms_activeListHead = m_next;
|
||||
}
|
||||
|
||||
m_prev = NULL;
|
||||
m_next = NULL;
|
||||
m_prev = nullptr;
|
||||
m_next = nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -76,7 +76,7 @@ void CollisionProperty::attachList ( CollisionProperty * & head )
|
||||
|
||||
if(head) head->m_prev = this;
|
||||
|
||||
m_prev = NULL;
|
||||
m_prev = nullptr;
|
||||
m_next = head;
|
||||
|
||||
head = this;
|
||||
@@ -129,7 +129,7 @@ CollisionProperty * CollisionProperty::getActiveHead ( void )
|
||||
|
||||
Transform getTransform_o2c( Object const * object )
|
||||
{
|
||||
if(object == NULL) return Transform::identity;
|
||||
if(object == nullptr) return Transform::identity;
|
||||
|
||||
// If this object is a cell, its o2c transform is the identity transform
|
||||
|
||||
@@ -164,23 +164,23 @@ CollisionProperty::CollisionProperty( Object & owner )
|
||||
: Property( CollisionProperty::getClassPropertyId(), owner ),
|
||||
m_lastTransform_w(Transform::identity),
|
||||
m_lastTransform_p(Transform::identity),
|
||||
m_lastCellObject(NULL),
|
||||
m_lastCellObject(nullptr),
|
||||
m_stepHeight(0.0f),
|
||||
m_defaultRadius(0.0f),
|
||||
m_offsetX(0.0f),
|
||||
m_offsetZ(0.0f),
|
||||
m_extentsDirty(true),
|
||||
m_extent_l(NULL),
|
||||
m_extent_p(NULL),
|
||||
m_extent_l(nullptr),
|
||||
m_extent_p(nullptr),
|
||||
m_sphere_l(),
|
||||
m_sphere_w(),
|
||||
m_scale(owner.getScale().x),
|
||||
m_spatialSubdivisionHandle(NULL),
|
||||
m_floor(NULL),
|
||||
m_footprint(NULL),
|
||||
m_spatialSubdivisionHandle(nullptr),
|
||||
m_floor(nullptr),
|
||||
m_footprint(nullptr),
|
||||
m_idleCounter(3),
|
||||
m_next(NULL),
|
||||
m_prev(NULL),
|
||||
m_next(nullptr),
|
||||
m_prev(nullptr),
|
||||
m_flags(F_collidable),
|
||||
m_spatialDatabaseStorageType(SpatialDatabase::Q_None)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ CollisionProperty::CollisionProperty( Object & owner )
|
||||
{
|
||||
char const * const found = strstr(templateName,"lair");
|
||||
|
||||
if(found != NULL)
|
||||
if(found != nullptr)
|
||||
{
|
||||
setCollidable(false);
|
||||
}
|
||||
@@ -214,23 +214,23 @@ CollisionProperty::CollisionProperty( Object & owner, SharedObjectTemplate const
|
||||
: Property( CollisionProperty::getClassPropertyId(), owner ),
|
||||
m_lastTransform_w(Transform::identity),
|
||||
m_lastTransform_p(Transform::identity),
|
||||
m_lastCellObject(NULL),
|
||||
m_lastCellObject(nullptr),
|
||||
m_stepHeight(0.0f),
|
||||
m_defaultRadius(0.0f),
|
||||
m_offsetX(0.0f),
|
||||
m_offsetZ(0.0f),
|
||||
m_extentsDirty(true),
|
||||
m_extent_l(NULL),
|
||||
m_extent_p(NULL),
|
||||
m_extent_l(nullptr),
|
||||
m_extent_p(nullptr),
|
||||
m_sphere_l(),
|
||||
m_sphere_w(),
|
||||
m_scale(owner.getScale().x),
|
||||
m_spatialSubdivisionHandle(NULL),
|
||||
m_floor(NULL),
|
||||
m_footprint(NULL),
|
||||
m_spatialSubdivisionHandle(nullptr),
|
||||
m_floor(nullptr),
|
||||
m_footprint(nullptr),
|
||||
m_idleCounter(3),
|
||||
m_next(NULL),
|
||||
m_prev(NULL),
|
||||
m_next(nullptr),
|
||||
m_prev(nullptr),
|
||||
m_flags(F_collidable),
|
||||
m_spatialDatabaseStorageType(SpatialDatabase::Q_None)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ CollisionProperty::CollisionProperty( Object & owner, SharedObjectTemplate const
|
||||
{
|
||||
char const * const found = strstr(templateName,"lair");
|
||||
|
||||
if(found != NULL)
|
||||
if(found != nullptr)
|
||||
{
|
||||
setCollidable(false);
|
||||
}
|
||||
@@ -373,7 +373,7 @@ CollisionProperty::~CollisionProperty()
|
||||
|
||||
static_cast<SphereTreeNode<CollisionProperty *, CollisionSphereAccessor>::NodeHandle *>(m_spatialSubdivisionHandle)->removeObject();
|
||||
|
||||
m_spatialSubdivisionHandle = NULL;
|
||||
m_spatialSubdivisionHandle = nullptr;
|
||||
}
|
||||
|
||||
FATAL(CollisionWorld::isUpdating(),("CollisionProperty::~CollisionProperty - Trying to destroy a collision property while the collision world is updating. This is baaaad\n"));
|
||||
@@ -382,16 +382,16 @@ CollisionProperty::~CollisionProperty()
|
||||
detachList();
|
||||
|
||||
delete m_extent_l;
|
||||
m_extent_l = NULL;
|
||||
m_extent_l = nullptr;
|
||||
|
||||
delete m_extent_p;
|
||||
m_extent_p = NULL;
|
||||
m_extent_p = nullptr;
|
||||
|
||||
delete m_floor;
|
||||
m_floor = NULL;
|
||||
m_floor = nullptr;
|
||||
|
||||
delete m_footprint;
|
||||
m_footprint = NULL;
|
||||
m_footprint = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ void CollisionProperty::attachSourceExtent ( BaseExtent * newSourceExtent ) cons
|
||||
m_extent_l = newSourceExtent;
|
||||
|
||||
delete m_extent_p;
|
||||
m_extent_p = NULL;
|
||||
m_extent_p = nullptr;
|
||||
|
||||
m_extentsDirty = true;
|
||||
}
|
||||
@@ -437,12 +437,12 @@ void CollisionProperty::initFloor ( void )
|
||||
if (isMobile())
|
||||
return;
|
||||
|
||||
if(m_floor != NULL)
|
||||
if(m_floor != nullptr)
|
||||
return;
|
||||
|
||||
// ----------
|
||||
|
||||
char const *floorName = NULL;
|
||||
char const *floorName = nullptr;
|
||||
|
||||
Appearance * appearance = getOwner().getAppearance();
|
||||
if(appearance)
|
||||
@@ -487,7 +487,7 @@ void CollisionProperty::addToCollisionWorld ( void )
|
||||
if (getOwner().getNetworkId() < NetworkId::cms_invalid)
|
||||
{
|
||||
delete m_footprint;
|
||||
m_footprint = NULL;
|
||||
m_footprint = nullptr;
|
||||
}
|
||||
|
||||
if (m_footprint)
|
||||
@@ -534,7 +534,7 @@ Transform CollisionProperty::getTransform_o2c ( void ) const
|
||||
|
||||
BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
if(!sourceExtent) return NULL;
|
||||
if(!sourceExtent) return nullptr;
|
||||
|
||||
switch(sourceExtent->getType())
|
||||
{
|
||||
@@ -549,7 +549,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
Extent const * extent = safe_cast<Extent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return new SimpleExtent( MultiShape( extent->getShape() ) );
|
||||
}
|
||||
@@ -558,7 +558,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
CylinderExtent const * extent = safe_cast<CylinderExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return new SimpleExtent( MultiShape( extent->getShape() ) );
|
||||
}
|
||||
@@ -567,7 +567,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
BoxExtent const * extent = safe_cast<BoxExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return new SimpleExtent( MultiShape( extent->getShape() ) );
|
||||
}
|
||||
@@ -576,7 +576,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
MeshExtent const * extent = safe_cast<MeshExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return extent->clone();
|
||||
}
|
||||
@@ -585,7 +585,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
DetailExtent const * extent = safe_cast<DetailExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
DetailExtent * newExtent = new DetailExtent();
|
||||
|
||||
@@ -603,7 +603,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
ComponentExtent const * extent = safe_cast<ComponentExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
ComponentExtent * newExtent = new ComponentExtent();
|
||||
|
||||
@@ -623,7 +623,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
case ET_Null:
|
||||
case ET_ExtentTypeCount:
|
||||
default:
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,10 +653,10 @@ void CollisionProperty::updateExtents ( void ) const
|
||||
if(m_scale != newScale)
|
||||
{
|
||||
delete m_extent_l;
|
||||
m_extent_l = NULL;
|
||||
m_extent_l = nullptr;
|
||||
|
||||
delete m_extent_p;
|
||||
m_extent_p = NULL;
|
||||
m_extent_p = nullptr;
|
||||
|
||||
m_scale = newScale;
|
||||
}
|
||||
@@ -960,7 +960,7 @@ void CollisionProperty::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(ConfigSharedCollision::getDrawExtents())
|
||||
{
|
||||
@@ -1274,9 +1274,9 @@ void CollisionProperty::setLastPos ( CellProperty * cell, Transform const & tran
|
||||
{
|
||||
NAN_CHECK(transform_p);
|
||||
|
||||
if(cell == NULL)
|
||||
if(cell == nullptr)
|
||||
{
|
||||
m_lastCellObject = NULL;
|
||||
m_lastCellObject = nullptr;
|
||||
m_lastTransform_p = transform_p;
|
||||
m_lastTransform_w = transform_p;
|
||||
}
|
||||
@@ -1298,7 +1298,7 @@ Object const * CollisionProperty::getStandingOn ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace CollisionResolveNamespace
|
||||
|
||||
FloorContactList ms_floorContactList;
|
||||
|
||||
Floor const * ms_ignoreFloor = NULL;
|
||||
Floor const * ms_ignoreFloor = nullptr;
|
||||
int ms_ignoreTriId = -1;
|
||||
int ms_ignoreEdge = -1;
|
||||
Vector ms_ignoreNormal = Vector::zero;
|
||||
@@ -312,7 +312,7 @@ ResolutionResult CollisionResolve::resolveCollisions(CollisionProperty * collide
|
||||
|
||||
if(result == RR_Resolved)
|
||||
{
|
||||
colliderA->hitBy(NULL);
|
||||
colliderA->hitBy(nullptr);
|
||||
colliderA->setExtentsDirty(true);
|
||||
|
||||
Vector resetPos = moveSeg.getBegin(moveSeg.m_cellB);
|
||||
@@ -339,7 +339,7 @@ ResolutionResult CollisionResolve::resolveCollisions ( CellProperty const * cell
|
||||
|
||||
const int iterationCount = 8;
|
||||
|
||||
ms_ignoreFloor = NULL;
|
||||
ms_ignoreFloor = nullptr;
|
||||
ms_ignoreTriId = -1;
|
||||
ms_ignoreEdge = -1;
|
||||
ms_ignoreTime = REAL_MAX;
|
||||
@@ -484,12 +484,12 @@ ResolutionResult CollisionResolve::resolveCollisions ( CellProperty const * cell
|
||||
// ----------
|
||||
// Remove the hit obstacle from the extent list
|
||||
|
||||
if(obstacleList->at(minIndex).m_extent != NULL)
|
||||
if(obstacleList->at(minIndex).m_extent != nullptr)
|
||||
{
|
||||
obstacleList->at(minIndex) = obstacleList->back();
|
||||
obstacleList->resize(obstacleList->size()-1);
|
||||
|
||||
ms_ignoreFloor = NULL;
|
||||
ms_ignoreFloor = nullptr;
|
||||
ms_ignoreTriId = -1;
|
||||
ms_ignoreEdge = -1;
|
||||
ms_ignoreTime = REAL_MAX;
|
||||
@@ -561,13 +561,13 @@ void CollisionResolve::explodeExtent ( CellProperty const * cell, BaseExtent con
|
||||
|
||||
void CollisionResolve::explodeFootprint ( Footprint * foot, ObstacleList & obstacleList, FloorContactList & floorContacts )
|
||||
{
|
||||
if(foot == NULL) return;
|
||||
if(foot == nullptr) return;
|
||||
|
||||
for(ContactIterator it(foot->getFloorList()); it; ++it)
|
||||
{
|
||||
FloorContactShape * contact = (*it);
|
||||
|
||||
if(contact == NULL)
|
||||
if(contact == nullptr)
|
||||
continue;
|
||||
|
||||
obstacleList.push_back( ObstacleInfo(contact->m_contact.getCell(),contact) );
|
||||
@@ -594,7 +594,7 @@ void CollisionResolve::explodeCollider(CollisionProperty * colliderA, ColliderLi
|
||||
{
|
||||
CollisionProperty const * const colliderB = *ii;
|
||||
|
||||
if(colliderB == NULL) continue;
|
||||
if(colliderB == nullptr) continue;
|
||||
|
||||
BaseExtent const * const extentB = colliderB->getExtent_p();
|
||||
|
||||
@@ -613,7 +613,7 @@ void CollisionResolve::explodeCollider(CollisionProperty * colliderA, ColliderLi
|
||||
{
|
||||
FloorContactShape * const contact = (*it);
|
||||
|
||||
if(contact == NULL) continue;
|
||||
if(contact == nullptr) continue;
|
||||
|
||||
ms_floorContactList.push_back(contact);
|
||||
}
|
||||
@@ -713,7 +713,7 @@ Contact CollisionResolve::findContactWithFloor ( FloorContactShape * floorContac
|
||||
|
||||
Floor const * floor = loc.getFloor();
|
||||
|
||||
if(floor == NULL) return Contact::noContact;
|
||||
if(floor == nullptr) return Contact::noContact;
|
||||
|
||||
CellProperty const * floorCell = loc.getCell();
|
||||
|
||||
@@ -740,7 +740,7 @@ Contact CollisionResolve::findContactWithFloor ( FloorContactShape * floorContac
|
||||
return Contact::noContact;
|
||||
}
|
||||
|
||||
if((ms_ignoreFloor == NULL) || (floor != ms_ignoreFloor))
|
||||
if((ms_ignoreFloor == nullptr) || (floor != ms_ignoreFloor))
|
||||
{
|
||||
walkResult = floor->canMove(loc,delta,-1,-1,result);
|
||||
}
|
||||
@@ -776,7 +776,7 @@ Contact CollisionResolve::findContactWithFloor ( FloorContactShape * floorContac
|
||||
tempContact.m_surfaceId2 = result.getHitEdgeId();
|
||||
|
||||
tempContact.m_cell = floorCell;
|
||||
tempContact.m_extent = NULL;
|
||||
tempContact.m_extent = nullptr;
|
||||
tempContact.m_surface = result.getFloor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,22 +27,22 @@ class Floor;
|
||||
struct ObstacleInfo
|
||||
{
|
||||
ObstacleInfo()
|
||||
: m_cell(NULL),
|
||||
m_extent(NULL),
|
||||
m_floorContact(NULL)
|
||||
: m_cell(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_floorContact(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ObstacleInfo ( CellProperty const * cell, SimpleExtent const * extent )
|
||||
: m_cell(cell),
|
||||
m_extent(extent),
|
||||
m_floorContact(NULL)
|
||||
m_floorContact(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ObstacleInfo ( CellProperty const * cell, FloorContactShape * contact )
|
||||
: m_cell(cell),
|
||||
m_extent(NULL),
|
||||
m_extent(nullptr),
|
||||
m_floorContact(contact)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ void MergePolyPoly ( VertexList & polyA, VertexList & polyB, VertexList & outPol
|
||||
|
||||
void BuildConvexHull ( Vector const * sortedVerts, int vertCount, VertexList & outPoly )
|
||||
{
|
||||
if(sortedVerts == NULL) return;
|
||||
if(sortedVerts == nullptr) return;
|
||||
|
||||
if(vertCount <= 0) return;
|
||||
if(vertCount == 1) { outPoly.push_back(sortedVerts[0]); return; }
|
||||
@@ -1104,7 +1104,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, BaseExtent const * extent );
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, SimpleExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
return CalcAvoidanceThetas(S,extent->getShape());
|
||||
}
|
||||
@@ -1113,7 +1113,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, SimpleExtent const * extent )
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, ComponentExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
RangeLoop range = RangeLoop::empty;
|
||||
|
||||
@@ -1123,7 +1123,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, ComponentExtent const * extent
|
||||
{
|
||||
BaseExtent const * child = extent->getExtent(i);
|
||||
|
||||
if(child == NULL) continue;
|
||||
if(child == nullptr) continue;
|
||||
|
||||
RangeLoop temp = CalcAvoidanceThetas(S,child);
|
||||
|
||||
@@ -1137,13 +1137,13 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, ComponentExtent const * extent
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, DetailExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
int count = extent->getExtentCount();
|
||||
|
||||
BaseExtent const * child = extent->getExtent(count - 1);
|
||||
|
||||
if(child == NULL) return RangeLoop::empty;
|
||||
if(child == nullptr) return RangeLoop::empty;
|
||||
|
||||
return CalcAvoidanceThetas(S,child);
|
||||
}
|
||||
@@ -1152,7 +1152,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, DetailExtent const * extent )
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, BaseExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
ExtentType type = extent->getType();
|
||||
|
||||
@@ -1176,7 +1176,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, ExtentVec const & extents )
|
||||
{
|
||||
BaseExtent const * child = extents[i];
|
||||
|
||||
if(child == NULL) continue;
|
||||
if(child == nullptr) continue;
|
||||
|
||||
RangeLoop temp = CalcAvoidanceThetas(S,child);
|
||||
|
||||
@@ -1367,7 +1367,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, SimpleExtent
|
||||
|
||||
void explodeObstacle ( Sphere const & sphere, Vector const & delta, DetailExtent const * extent, ExtentVec & outList )
|
||||
{
|
||||
if(extent == NULL) return;
|
||||
if(extent == nullptr) return;
|
||||
|
||||
int count = extent->getExtentCount();
|
||||
|
||||
@@ -1376,7 +1376,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, DetailExtent
|
||||
|
||||
void explodeObstacle ( Sphere const & sphere, Vector const & delta, ComponentExtent const * extent, ExtentVec & outList )
|
||||
{
|
||||
if(extent == NULL) return;
|
||||
if(extent == nullptr) return;
|
||||
|
||||
int count = extent->getExtentCount();
|
||||
|
||||
@@ -1388,7 +1388,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, ComponentExt
|
||||
|
||||
void explodeObstacle ( Sphere const & sphere, Vector const & delta, BaseExtent const * extent, ExtentVec & outList )
|
||||
{
|
||||
if(extent == NULL) return;
|
||||
if(extent == nullptr) return;
|
||||
|
||||
ExtentType type = extent->getType();
|
||||
|
||||
@@ -1411,7 +1411,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, ExtentVec co
|
||||
|
||||
bool CalcAvoidancePoint ( Sphere const & sphere, Transform const & sphereTransform_p2w, Vector const & delta, CollisionProperty const * obstacle, Vector & out )
|
||||
{
|
||||
if(obstacle == NULL) return false;
|
||||
if(obstacle == nullptr) return false;
|
||||
|
||||
static ExtentVec tempExtents;
|
||||
|
||||
@@ -1455,12 +1455,12 @@ bool CalcAvoidancePoint ( Sphere const & sphere, Transform const & sphereTransfo
|
||||
|
||||
bool CalcAvoidancePoint ( CollisionProperty const * mob, Vector const & delta, CollisionProperty const * obstacle, Vector & out )
|
||||
{
|
||||
if(mob == NULL) return false;
|
||||
if(obstacle == NULL) return false;
|
||||
if(mob == nullptr) return false;
|
||||
if(obstacle == nullptr) return false;
|
||||
|
||||
BaseExtent const * mobExtent = mob->getExtent_p();
|
||||
|
||||
if(mobExtent == NULL) return false;
|
||||
if(mobExtent == nullptr) return false;
|
||||
|
||||
Sphere mobSphere = mobExtent->getBoundingSphere();
|
||||
|
||||
@@ -1471,8 +1471,8 @@ bool CalcAvoidancePoint ( CollisionProperty const * mob, Vector const & delta, C
|
||||
|
||||
bool CalcAvoidancePoint ( Object const * mob, Vector const & delta, Object const * obstacle, Vector & out )
|
||||
{
|
||||
if(mob == NULL) return false;
|
||||
if(obstacle == NULL) return false;
|
||||
if(mob == nullptr) return false;
|
||||
if(obstacle == nullptr) return false;
|
||||
|
||||
CollisionProperty const * mobCollision = mob->getCollisionProperty();
|
||||
CollisionProperty const * obstacleCollision = obstacle->getCollisionProperty();
|
||||
@@ -1601,8 +1601,8 @@ Vector transformToCell ( CellProperty const * cellA, Vector const & point_A, Cel
|
||||
{
|
||||
CellProperty const * worldCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
if(cellA == NULL) cellA = worldCell;
|
||||
if(cellB == NULL) cellB = worldCell;
|
||||
if(cellA == nullptr) cellA = worldCell;
|
||||
if(cellB == nullptr) cellB = worldCell;
|
||||
|
||||
if(cellA == cellB) return point_A;
|
||||
|
||||
@@ -1627,8 +1627,8 @@ Vector rotateToCell ( CellProperty const * cellA, Vector const & point_A, CellPr
|
||||
{
|
||||
CellProperty const * worldCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
if(cellA == NULL) cellA = worldCell;
|
||||
if(cellB == NULL) cellB = worldCell;
|
||||
if(cellA == nullptr) cellA = worldCell;
|
||||
if(cellB == nullptr) cellB = worldCell;
|
||||
|
||||
if(cellA == cellB) return point_A;
|
||||
|
||||
@@ -1655,8 +1655,8 @@ Transform transformToCell ( CellProperty const * cellA, Transform const & transf
|
||||
{
|
||||
CellProperty const * worldCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
if(cellA == NULL) cellA = worldCell;
|
||||
if(cellB == NULL) cellB = worldCell;
|
||||
if(cellA == nullptr) cellA = worldCell;
|
||||
if(cellB == nullptr) cellB = worldCell;
|
||||
|
||||
if(cellA == cellB) return transform_A;
|
||||
|
||||
@@ -1743,8 +1743,8 @@ MultiShape transformToCell ( CellProperty const * cellA, MultiShape const & shap
|
||||
|
||||
bool testPortalVis ( CellProperty const * cellA, Vector const & pointA, CellProperty const * cellB, Vector const & pointB )
|
||||
{
|
||||
if(cellA == NULL) return false;
|
||||
if(cellB == NULL) return false;
|
||||
if(cellA == nullptr) return false;
|
||||
if(cellB == nullptr) return false;
|
||||
|
||||
float hitTime = 0.0f;
|
||||
|
||||
@@ -1753,7 +1753,7 @@ bool testPortalVis ( CellProperty const * cellA, Vector const & pointA, CellProp
|
||||
|
||||
if(cellA == cellB)
|
||||
{
|
||||
return cellA->getDestinationCell(pointA,pointB,hitTime) == NULL;
|
||||
return cellA->getDestinationCell(pointA,pointB,hitTime) == nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace CollisionWorldNamespace
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
SpatialDatabase * ms_database = NULL;
|
||||
SpatialDatabase * ms_database = nullptr;
|
||||
|
||||
bool ms_updating = false;
|
||||
bool ms_serverSide = false;
|
||||
@@ -94,7 +94,7 @@ namespace CollisionWorldNamespace
|
||||
bool testPassableTerrain(Vector const & startPos, Vector const & delta, float & collisionTime)
|
||||
{
|
||||
TerrainObject const *const terrainObject = TerrainObject::getConstInstance();
|
||||
if (NULL != terrainObject)
|
||||
if (nullptr != terrainObject)
|
||||
{
|
||||
float totalDistance = delta.magnitude();
|
||||
float distanceTraversed = 0.0f;
|
||||
@@ -134,7 +134,7 @@ namespace CollisionWorldNamespace
|
||||
return;
|
||||
|
||||
TerrainObject const *const terrainObject = TerrainObject::getConstInstance();
|
||||
if (NULL != terrainObject && terrainObject->hasPassableAffectors())
|
||||
if (nullptr != terrainObject && terrainObject->hasPassableAffectors())
|
||||
{
|
||||
|
||||
// pointA_w is *not* the previous world position, but actually the world
|
||||
@@ -289,7 +289,7 @@ bool CollisionWorldNamespace::testFloorCollision(FloorLocator const &startFloorL
|
||||
if (!floor)
|
||||
{
|
||||
// For some reason this solid floor does not have an attached floor. No collision.
|
||||
WARNING(true, ("testFloorCollision(): attempted to test floor with a starting floor locator that had a NULL floor, unexpected. Check calling code's assumptions."));
|
||||
WARNING(true, ("testFloorCollision(): attempted to test floor with a starting floor locator that had a nullptr floor, unexpected. Check calling code's assumptions."));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ bool CollisionWorldNamespace::testFloorCollision(FloorLocator const &startFloorL
|
||||
// if statement above.
|
||||
WARNING(true,
|
||||
("testFloorCollision(): floor collision occurred while checking for floor collisions for floor of object id [%s] but collision floor location has no associated floor. Calling this a non-collision. PathWalkResult was [%d].",
|
||||
floor->getOwner() ? floor->getOwner()->getNetworkId().getValueString().c_str() : "<NULL floor owner>",
|
||||
floor->getOwner() ? floor->getOwner()->getNetworkId().getValueString().c_str() : "<nullptr floor owner>",
|
||||
static_cast<int>(pathWalkResult)
|
||||
));
|
||||
return false;
|
||||
@@ -328,8 +328,8 @@ bool CollisionWorldNamespace::testFloorCollision(FloorLocator const &startFloorL
|
||||
collisionObject = destinationFloor->getOwner();
|
||||
if (!collisionObject)
|
||||
{
|
||||
// We had a collision on a floor, but the floor had a NULL owner. Consider this a non-collision.
|
||||
WARNING(true, ("testFloorCollision(): floor collision occurred, destination collision floor location had a floor but floor reported a NULL owner. Calling this a non-collision."));
|
||||
// We had a collision on a floor, but the floor had a nullptr owner. Consider this a non-collision.
|
||||
WARNING(true, ("testFloorCollision(): floor collision occurred, destination collision floor location had a floor but floor reported a nullptr owner. Calling this a non-collision."));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -447,11 +447,11 @@ void CollisionWorld::remove ( void )
|
||||
CollisionResolve::remove();
|
||||
FloorMesh::remove();
|
||||
|
||||
s_nearWarpWarningCallback = NULL;
|
||||
s_farWarpWarningCallback = NULL;
|
||||
s_nearWarpWarningCallback = nullptr;
|
||||
s_farWarpWarningCallback = nullptr;
|
||||
|
||||
delete ms_database;
|
||||
ms_database = NULL;
|
||||
ms_database = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -595,7 +595,7 @@ bool CollisionWorld::spatialSweepAndResolve(CollisionProperty * collider)
|
||||
|
||||
void CollisionWorld::update(CollisionProperty * collider, float time)
|
||||
{
|
||||
FATAL(!collider, ("CollisionWorld::update(): collider is NULL."));
|
||||
FATAL(!collider, ("CollisionWorld::update(): collider is nullptr."));
|
||||
|
||||
PROFILER_AUTO_BLOCK_DEFINE("CollisionWorld::update");
|
||||
|
||||
@@ -603,9 +603,9 @@ void CollisionWorld::update(CollisionProperty * collider, float time)
|
||||
|
||||
Footprint * foot = collider->getFootprint();
|
||||
|
||||
if(foot == NULL)
|
||||
if(foot == nullptr)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("CollisionWorld::update: foot == NULL");
|
||||
PROFILER_AUTO_BLOCK_DEFINE("CollisionWorld::update: foot == nullptr");
|
||||
|
||||
IGNORE_RETURN (CollisionWorld::spatialSweepAndResolve(collider));
|
||||
collider->storePosition();
|
||||
@@ -1076,11 +1076,11 @@ void CollisionWorld::setFarWarpWarningCallback(WarpWarningCallback callback)
|
||||
|
||||
void CollisionWorld::addObject ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if((collision == NULL) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
if((collision == nullptr) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
|
||||
if(collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1125,7 +1125,7 @@ void CollisionWorld::addObject ( Object * object )
|
||||
{
|
||||
char const * name = object->getObjectTemplateName();
|
||||
|
||||
if(name == NULL)
|
||||
if(name == nullptr)
|
||||
{
|
||||
Appearance const * appearance = object->getAppearance();
|
||||
|
||||
@@ -1162,11 +1162,11 @@ void CollisionWorld::addObject ( Object * object )
|
||||
|
||||
void CollisionWorld::removeObject ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if((collision == NULL) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
if((collision == nullptr) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1218,11 +1218,11 @@ void CollisionWorld::removeObject ( Object * object )
|
||||
|
||||
void CollisionWorld::moveObject (Object * object)
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1248,11 +1248,11 @@ void CollisionWorld::moveObject (Object * object)
|
||||
|
||||
void CollisionWorld::cellChanged ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1266,11 +1266,11 @@ void CollisionWorld::cellChanged ( Object * object )
|
||||
|
||||
void CollisionWorld::appearanceChanged ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1333,12 +1333,12 @@ SpatialDatabase * CollisionWorld::getDatabase ( void )
|
||||
|
||||
void CollisionWorld::objectWarped ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
// object does not have a CollisionProperty
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
// object is not in CollisionWorld
|
||||
if (!collision->isInCollisionWorld()) return;
|
||||
@@ -1458,7 +1458,7 @@ QueryInteractionResult CollisionWorld::queryInteraction ( CellProperty const * c
|
||||
if(hitTime < hitPortalTime)
|
||||
{
|
||||
outHitTime = hitTime;
|
||||
outHitObject = NULL;
|
||||
outHitObject = nullptr;
|
||||
|
||||
return QIR_HitTerrain;
|
||||
}
|
||||
@@ -1472,12 +1472,12 @@ QueryInteractionResult CollisionWorld::queryInteraction ( CellProperty const * c
|
||||
// If we did not hit a portal, the query ends in this cell.
|
||||
// If this cell is not the goal cell, then the query fails.
|
||||
|
||||
if(nextCell == NULL)
|
||||
if(nextCell == nullptr)
|
||||
{
|
||||
if(cellA != cellB)
|
||||
{
|
||||
outHitTime = 1.0f;
|
||||
outHitObject = NULL;
|
||||
outHitObject = nullptr;
|
||||
|
||||
return QIR_MissedTarget;
|
||||
}
|
||||
@@ -1702,7 +1702,7 @@ CanMoveResult CollisionWorld::canMove ( CellProperty const * startCell,
|
||||
|
||||
FloorLocator dummy;
|
||||
|
||||
return canMove( NULL, startCell, startLoc, goalPos, checkY, checkFlora, checkFauna, dummy );
|
||||
return canMove( nullptr, startCell, startLoc, goalPos, checkY, checkFlora, checkFauna, dummy );
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -1714,7 +1714,7 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
bool checkFlora,
|
||||
bool checkFauna )
|
||||
{
|
||||
if(object == NULL)
|
||||
if(object == nullptr)
|
||||
{
|
||||
return CMR_Error;
|
||||
}
|
||||
@@ -1766,7 +1766,7 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
bool checkFauna,
|
||||
FloorLocator & endLoc )
|
||||
{
|
||||
if(startCell == NULL)
|
||||
if(startCell == nullptr)
|
||||
{
|
||||
startCell = CellProperty::getWorldCellProperty();
|
||||
}
|
||||
@@ -1858,7 +1858,7 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
}
|
||||
|
||||
// ----------
|
||||
// A NULL goal cell means we don't care what cell we end up in as long as we make it to the goal
|
||||
// A nullptr goal cell means we don't care what cell we end up in as long as we make it to the goal
|
||||
|
||||
CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
CellProperty const * startCell,
|
||||
@@ -1871,12 +1871,12 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
{
|
||||
// ----------
|
||||
|
||||
if(startCell == NULL)
|
||||
if(startCell == nullptr)
|
||||
{
|
||||
startCell = CellProperty::getWorldCellProperty();
|
||||
}
|
||||
|
||||
if(goalCell == NULL)
|
||||
if(goalCell == nullptr)
|
||||
{
|
||||
FloorLocator dummy;
|
||||
|
||||
@@ -2233,17 +2233,17 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
|
||||
Vector delta = testPos - startPos;
|
||||
|
||||
if(creature == NULL) return false;
|
||||
if(creature == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collision = creature->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
BaseExtent const * baseExtent = collision->getExtent_p();
|
||||
|
||||
SimpleExtent const * simpleExtent = dynamic_cast<SimpleExtent const *>(baseExtent);
|
||||
|
||||
if(simpleExtent == NULL) return false;
|
||||
if(simpleExtent == nullptr) return false;
|
||||
|
||||
MultiShape const & shape = simpleExtent->getShape();
|
||||
|
||||
@@ -2253,7 +2253,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
// Test collision extents
|
||||
|
||||
DetectResult minResult;
|
||||
Object const * minObject = NULL;
|
||||
Object const * minObject = nullptr;
|
||||
|
||||
typedef std::vector<Object*> ObjectVector;
|
||||
static ObjectVector statics;
|
||||
@@ -2262,7 +2262,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
statics.clear();
|
||||
creatures.clear();
|
||||
|
||||
if(ms_database->queryObjects(creature->getParentCell(), shape, delta, (testStatics ? &statics : NULL), (testCreatures ? &creatures : NULL)))
|
||||
if(ms_database->queryObjects(creature->getParentCell(), shape, delta, (testStatics ? &statics : nullptr), (testCreatures ? &creatures : nullptr)))
|
||||
{
|
||||
ObjectVector::size_type const nStatics = statics.size();
|
||||
ObjectVector::size_type i;
|
||||
@@ -2271,7 +2271,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
{
|
||||
Object const * obstacle = statics[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
if(obstacle == creature) continue;
|
||||
|
||||
@@ -2292,7 +2292,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
{
|
||||
Object const * obstacle = creatures[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
if(obstacle == creature) continue;
|
||||
|
||||
@@ -2310,10 +2310,10 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
|
||||
//-- Check for floor collisions.
|
||||
Footprint const *const footprint = collision->getFootprint();
|
||||
FloorLocator const *const floorLocator = (footprint ? footprint->getAnyContact() : NULL);
|
||||
FloorLocator const *const floorLocator = (footprint ? footprint->getAnyContact() : nullptr);
|
||||
if (floorLocator)
|
||||
{
|
||||
Object const *floorCollisionObject = NULL;
|
||||
Object const *floorCollisionObject = nullptr;
|
||||
Vector collisionLocation_w;
|
||||
|
||||
// Do the floor check.
|
||||
@@ -2372,7 +2372,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
// Test collision extents
|
||||
|
||||
DetectResult minResult;
|
||||
Object const * minObject = NULL;
|
||||
Object const * minObject = nullptr;
|
||||
|
||||
static std::vector<Object*> statics;
|
||||
static std::vector<Object*> creatures;
|
||||
@@ -2380,7 +2380,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
statics.clear();
|
||||
creatures.clear();
|
||||
|
||||
if(ms_database->queryObjects(CellProperty::getWorldCellProperty(), shape, delta, (testStatics ? &statics : NULL), (testCreatures ? &creatures : NULL)))
|
||||
if(ms_database->queryObjects(CellProperty::getWorldCellProperty(), shape, delta, (testStatics ? &statics : nullptr), (testCreatures ? &creatures : nullptr)))
|
||||
{
|
||||
size_t const nStatics = statics.size();
|
||||
size_t i;
|
||||
@@ -2389,7 +2389,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
{
|
||||
Object const * obstacle = statics[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
DetectResult result = CollisionDetect::testSphereObject(sphere,delta,obstacle);
|
||||
|
||||
@@ -2406,7 +2406,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
{
|
||||
Object const * obstacle = creatures[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
if(Distance2d::Distance2(obstacle->getPosition_w(),goalPos) < 0.000001) continue;
|
||||
|
||||
@@ -2437,7 +2437,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
|
||||
bool CollisionWorld::calcBubble ( CellProperty const * cell, Vector const & point_p, float maxDistance, float & outRadius )
|
||||
{
|
||||
return calcBubble(cell,point_p,NULL,maxDistance,outRadius);
|
||||
return calcBubble(cell,point_p,nullptr,maxDistance,outRadius);
|
||||
}
|
||||
|
||||
bool CollisionWorld::calcBubble ( CellProperty const * cell, Vector const & point_p, Object const * ignoreObject, float maxDistance, float & outRadius )
|
||||
@@ -2698,16 +2698,16 @@ void CollisionWorld::handleSceneChange(std::string const & sceneId)
|
||||
Floor const * CollisionWorld::getFloorStandingOn(Object const & object)
|
||||
{
|
||||
CollisionProperty const * const objectCollisionProperty = object.getCollisionProperty();
|
||||
Footprint const * const objectFootprint = (objectCollisionProperty != NULL) ? objectCollisionProperty->getFootprint() : NULL;
|
||||
Footprint const * const objectFootprint = (objectCollisionProperty != nullptr) ? objectCollisionProperty->getFootprint() : nullptr;
|
||||
|
||||
if (objectFootprint == NULL)
|
||||
if (objectFootprint == nullptr)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MultiListHandle const & floorList = objectFootprint->getFloorList();
|
||||
float const objectHeight = object.getPosition_w().y;
|
||||
Floor const * resultFloor = NULL;
|
||||
Floor const * resultFloor = nullptr;
|
||||
float resultDistanceBelowObject = 0.0f;
|
||||
float dropTestHeight = std::numeric_limits<float>::min();
|
||||
|
||||
@@ -2750,7 +2750,7 @@ Floor const * CollisionWorld::getFloorStandingOn(Object const & object)
|
||||
{
|
||||
TerrainObject const * const terrainObject = TerrainObject::getConstInstance();
|
||||
|
||||
if (terrainObject != NULL)
|
||||
if (terrainObject != nullptr)
|
||||
{
|
||||
CellProperty const * const parentCell = object.getParentCell();
|
||||
|
||||
@@ -2775,7 +2775,7 @@ Floor const * CollisionWorld::getFloorStandingOn(Object const & object)
|
||||
{
|
||||
if (dropTestHeight < terrainHeight)
|
||||
{
|
||||
resultFloor = NULL;
|
||||
resultFloor = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ float ms_terrainLOSMaxDistance = 64.0f;
|
||||
float ms_losUprightScale = 1.5f;
|
||||
float ms_losProneScale = 1.0f;
|
||||
|
||||
PlayEffectHook ms_playEffectHook = NULL;
|
||||
IsPlayerHouseHook ms_isPlayerHouseHook = NULL;
|
||||
PlayEffectHook ms_playEffectHook = nullptr;
|
||||
IsPlayerHouseHook ms_isPlayerHouseHook = nullptr;
|
||||
|
||||
int ms_spatialSweepAndResolveDefaultMask = static_cast<int>(SpatialDatabase::Q_Static);
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ public:
|
||||
m_normal(newNormal),
|
||||
m_surfaceId1(-1),
|
||||
m_surfaceId2(-1),
|
||||
m_cell(NULL),
|
||||
m_extent(NULL),
|
||||
m_surface(NULL)
|
||||
m_cell(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_surface(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
ContactPoint::ContactPoint()
|
||||
: m_pSurface( NULL ),
|
||||
: m_pSurface( nullptr ),
|
||||
m_position( Vector::zero ),
|
||||
m_offset( 0.0f ),
|
||||
m_hitId( -1 )
|
||||
@@ -45,7 +45,7 @@ ContactPoint::ContactPoint ( ContactPoint const & locCopy )
|
||||
|
||||
bool ContactPoint::isAttached ( void ) const
|
||||
{
|
||||
return (m_hitId != -1) && (m_pSurface != NULL);
|
||||
return (m_hitId != -1) && (m_pSurface != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -115,7 +115,7 @@ void ContactPoint::read_0000 ( Iff & iff )
|
||||
{
|
||||
m_position = iff.read_floatVector();
|
||||
m_offset = iff.read_float();
|
||||
m_pSurface = NULL;
|
||||
m_pSurface = nullptr;
|
||||
m_hitId = iff.read_int32();
|
||||
|
||||
NAN_CHECK(m_position);
|
||||
|
||||
@@ -99,11 +99,11 @@ DoorObject::DoorObject ( DoorInfo const & info, Portal * portal )
|
||||
m_doorHelper2 ( info ),
|
||||
m_delta ( info.m_delta ),
|
||||
m_portal ( portal ),
|
||||
m_neighbor ( NULL ),
|
||||
m_neighbor ( nullptr ),
|
||||
m_spring ( info.m_spring ),
|
||||
m_smoothness ( info.m_smoothness ),
|
||||
m_draw ( true ),
|
||||
m_barrier ( NULL ),
|
||||
m_barrier ( nullptr ),
|
||||
m_oldDoorPos ( Vector::maxXYZ ),
|
||||
m_wasOpen(false),
|
||||
m_isForceField( false ),
|
||||
@@ -119,7 +119,7 @@ DoorObject::DoorObject ( DoorInfo const & info, Portal * portal )
|
||||
setDebugName("Door object");
|
||||
|
||||
for (int i = 0; i < MAX_DRAWN_DOORS; ++i)
|
||||
m_drawnDoor[i] = NULL;
|
||||
m_drawnDoor[i] = nullptr;
|
||||
|
||||
createAppearance(info);
|
||||
createTrigger(info);
|
||||
@@ -131,7 +131,7 @@ DoorObject::DoorObject ( DoorInfo const & info, Portal * portal )
|
||||
DoorObject::~DoorObject()
|
||||
{
|
||||
m_hitByObjects.clear();
|
||||
m_portal = NULL;
|
||||
m_portal = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -181,7 +181,7 @@ DoorObject const * DoorObject::getNeighbor ( void ) const
|
||||
int DoorObject::getNumberOfDrawnDoors ( void )
|
||||
{
|
||||
for (int i = 0; i < MAX_DRAWN_DOORS; ++i)
|
||||
if (m_drawnDoor[i] == NULL)
|
||||
if (m_drawnDoor[i] == nullptr)
|
||||
return i;
|
||||
|
||||
return MAX_DRAWN_DOORS;
|
||||
@@ -210,7 +210,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
{
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(info.m_frameAppearance);
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
setAppearance(appearance);
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for DoorObject::createAppearance missing, first stanza."));
|
||||
@@ -233,7 +233,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
Collision3d::MovePolyOnto(verts,Vector::zero);
|
||||
Appearance * appearance = CellProperty::createForceField(verts,gs_forceFieldColor);
|
||||
|
||||
if(appearance != NULL)
|
||||
if(appearance != nullptr)
|
||||
{
|
||||
m_drawnDoor[0]->setAppearance( appearance );
|
||||
Extent * appearanceExtent = new Extent( Containment3d::EncloseSphere(verts) );
|
||||
@@ -249,7 +249,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
{
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(info.m_doorAppearance);
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
m_drawnDoor[0]->setAppearance(appearance);
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for DoorObject::createAppearance missing, third stanza."));
|
||||
@@ -263,7 +263,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(info.m_doorAppearance2);
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
m_drawnDoor[1]->setAppearance(appearance);
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for DoorObject::createAppearance missing, fourth stanza."));
|
||||
@@ -476,7 +476,7 @@ float DoorObject::tween ( float t ) const
|
||||
|
||||
void DoorObject::hitBy( CollisionProperty const * collision )
|
||||
{
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
CellProperty const * doorCell = getParentCell();
|
||||
CellProperty const * doorNeighborCell = m_neighbor ? m_neighbor->getParentCell() : doorCell;
|
||||
@@ -533,7 +533,7 @@ void DoorObject::setNeighbor ( DoorObject * newNeighbor )
|
||||
if (newNeighbor)
|
||||
m_barrier->setNeighbor( newNeighbor->m_barrier );
|
||||
else
|
||||
m_barrier->setNeighbor( NULL );
|
||||
m_barrier->setNeighbor( nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ void DoorObject::trackHitByObject(Object const &hitByObject)
|
||||
if (static_cast<int>(m_hitByObjects.size()) >= cs_maxHitByObjectsToTrack)
|
||||
return;
|
||||
|
||||
// NOTE: This can't be a set because the key's value can change when a watcher's value changes from non-NULL to NULL.
|
||||
// NOTE: This can't be a set because the key's value can change when a watcher's value changes from non-nullptr to nullptr.
|
||||
// Check if the object already exists in the list.
|
||||
if (std::find(m_hitByObjects.begin(), m_hitByObjects.end(), ConstWatcher<Object>(&hitByObject)) != m_hitByObjects.end())
|
||||
return;
|
||||
@@ -607,7 +607,7 @@ void DoorObject::maintainHitByObjectVector()
|
||||
// Remove any objects that no longer exist or no longer are within the trigger radius.
|
||||
for (WatcherObjectVector::iterator it = m_hitByObjects.begin(); it != m_hitByObjects.end(); )
|
||||
{
|
||||
if (it->getPointer() == NULL)
|
||||
if (it->getPointer() == nullptr)
|
||||
{
|
||||
// This hit-by object has been deleted so clear it out of the tracking list.
|
||||
it = m_hitByObjects.erase(it);
|
||||
|
||||
@@ -49,8 +49,8 @@ Floor::Floor( FloorMesh const * pMesh, Object const * owner, Appearance const *
|
||||
m_mesh(pMesh),
|
||||
m_footList(this,1),
|
||||
m_databaseList(this,1),
|
||||
m_spatialSubdivisionHandle(NULL),
|
||||
m_extent(NULL),
|
||||
m_spatialSubdivisionHandle(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_extentDirty(true),
|
||||
m_sphere_l(),
|
||||
m_sphere_w()
|
||||
@@ -104,15 +104,15 @@ Floor::~Floor()
|
||||
}
|
||||
|
||||
const_cast<FloorMesh*>(m_mesh)->releaseReference();
|
||||
m_mesh = NULL;
|
||||
m_mesh = nullptr;
|
||||
|
||||
m_owner = NULL;
|
||||
m_appearance = NULL;
|
||||
m_owner = nullptr;
|
||||
m_appearance = nullptr;
|
||||
|
||||
m_spatialSubdivisionHandle = NULL;
|
||||
m_spatialSubdivisionHandle = nullptr;
|
||||
|
||||
delete m_extent;
|
||||
m_extent = NULL;
|
||||
m_extent = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -255,7 +255,7 @@ bool Floor::segTestBounds ( Vector const & begin, Vector const & end ) const
|
||||
|
||||
Object const * Floor::getOwner ( void ) const
|
||||
{
|
||||
if(m_owner != NULL)
|
||||
if(m_owner != nullptr)
|
||||
{
|
||||
return m_owner;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ Object const * Floor::getOwner ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ Object const * Floor::getOwner ( void ) const
|
||||
|
||||
Appearance const * Floor::getAppearance ( void ) const
|
||||
{
|
||||
if(m_appearance != NULL)
|
||||
if(m_appearance != nullptr)
|
||||
{
|
||||
return m_appearance;
|
||||
}
|
||||
@@ -283,7 +283,7 @@ Appearance const * Floor::getAppearance ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ CellProperty const * Floor::getCell ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ NetworkId const & Floor::getId() const
|
||||
{
|
||||
CellProperty const * const cellProperty = getCell();
|
||||
|
||||
return (cellProperty != NULL) ? cellProperty->getOwner().getNetworkId() : NetworkId::cms_invalid;
|
||||
return (cellProperty != nullptr) ? cellProperty->getOwner().getNetworkId() : NetworkId::cms_invalid;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -34,7 +34,7 @@ FloorTri gs_dummyFloorTri;
|
||||
FloorLocator::FloorLocator()
|
||||
: ContactPoint(),
|
||||
m_valid(false),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(0.0f),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -47,7 +47,7 @@ FloorLocator::FloorLocator()
|
||||
// ----------
|
||||
|
||||
FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint, int triId, float dist, float radius )
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : NULL),localPoint,triId,dist),
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : nullptr),localPoint,triId,dist),
|
||||
m_valid(true),
|
||||
m_floor(floor),
|
||||
m_radius(radius),
|
||||
@@ -64,7 +64,7 @@ FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint, int
|
||||
FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point, int triId, float dist, float radius )
|
||||
: ContactPoint(mesh,point,triId,dist),
|
||||
m_valid(true),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(radius),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -78,7 +78,7 @@ FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point,
|
||||
// ----------
|
||||
|
||||
FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint )
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : NULL),localPoint,-1,0.0f),
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : nullptr),localPoint,-1,0.0f),
|
||||
m_valid(true),
|
||||
m_floor(floor),
|
||||
m_radius(0.0f),
|
||||
@@ -95,7 +95,7 @@ FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint )
|
||||
FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point )
|
||||
: ContactPoint(mesh,point,-1,0.0f),
|
||||
m_valid(true),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(0.0f),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -109,9 +109,9 @@ FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point
|
||||
// ----------
|
||||
|
||||
FloorLocator::FloorLocator( Vector const & point, float radius )
|
||||
: ContactPoint(NULL,point,-1,0.0f),
|
||||
: ContactPoint(nullptr,point,-1,0.0f),
|
||||
m_valid(true),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(radius),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -226,7 +226,7 @@ void FloorLocator::setFloor ( Floor const * newFloor )
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getFloorMesh() == NULL)
|
||||
if(getFloorMesh() == nullptr)
|
||||
{
|
||||
Vector oldPos = getPosition_p();
|
||||
|
||||
@@ -239,7 +239,7 @@ void FloorLocator::setFloor ( Floor const * newFloor )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_floor = NULL;
|
||||
m_floor = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ CellProperty const * FloorLocator::getCell ( void ) const
|
||||
{
|
||||
if(getFloorMesh())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -312,7 +312,7 @@ CellProperty * FloorLocator::getCell ( void )
|
||||
{
|
||||
if(getFloorMesh())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -417,7 +417,7 @@ void FloorLocator::write ( Iff & iff ) const
|
||||
|
||||
void FloorLocator::detach ( void )
|
||||
{
|
||||
setFloor(NULL);
|
||||
setFloor(nullptr);
|
||||
setId(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
namespace FloorManagerNamespace
|
||||
{
|
||||
|
||||
ObjectFactory ms_pathGraphFactory = NULL;
|
||||
ObjectWriter ms_pathGraphWriter = NULL;
|
||||
ObjectRenderer ms_pathGraphRenderer = NULL;
|
||||
ObjectFactory ms_pathGraphFactory = nullptr;
|
||||
ObjectWriter ms_pathGraphWriter = nullptr;
|
||||
ObjectRenderer ms_pathGraphRenderer = nullptr;
|
||||
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ Floor * FloorManager::createFloor ( const char * floorMeshFilename, Object const
|
||||
if(!pMesh)
|
||||
{
|
||||
WARNING(true, ("Could not find floor mesh %s", floorMeshFilename));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -78,8 +78,8 @@ const Tag TAG_BTRE = TAG(B,T,R,E);
|
||||
const Tag TAG_BEDG = TAG(B,E,D,G);
|
||||
const Tag TAG_PGRF = TAG(P,G,R,F);
|
||||
|
||||
template <> FloorMeshList::CreateDataResourceMap *FloorMeshList::ms_bindings = NULL;
|
||||
template <> FloorMeshList::LoadedDataResourceMap *FloorMeshList::ms_loaded = NULL;
|
||||
template <> FloorMeshList::CreateDataResourceMap *FloorMeshList::ms_bindings = nullptr;
|
||||
template <> FloorMeshList::LoadedDataResourceMap *FloorMeshList::ms_loaded = nullptr;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -92,20 +92,20 @@ FloorMesh::FloorMesh(const std::string & filename)
|
||||
m_uncrossableEdges( new FloorEdgeIdVec() ),
|
||||
m_wallBaseEdges( new FloorEdgeIdVec() ),
|
||||
m_wallTopEdges( new FloorEdgeIdVec() ),
|
||||
m_pathGraph(NULL),
|
||||
m_appearance(NULL),
|
||||
m_pathGraph(nullptr),
|
||||
m_appearance(nullptr),
|
||||
m_triMarkCounter(1000), // just some random number
|
||||
m_objectFloor(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
m_crossableLines = NULL;
|
||||
m_uncrossableLines = NULL;
|
||||
m_interiorLines = NULL;
|
||||
m_portalLines = NULL;
|
||||
m_rampLines = NULL;
|
||||
m_fallthroughTriLines = NULL;
|
||||
m_solidTriLines = NULL;
|
||||
m_crossableLines = nullptr;
|
||||
m_uncrossableLines = nullptr;
|
||||
m_interiorLines = nullptr;
|
||||
m_portalLines = nullptr;
|
||||
m_rampLines = nullptr;
|
||||
m_fallthroughTriLines = nullptr;
|
||||
m_solidTriLines = nullptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -121,8 +121,8 @@ FloorMesh::FloorMesh( VectorVector const & vertices, IntVector const & indices )
|
||||
m_uncrossableEdges( new FloorEdgeIdVec() ),
|
||||
m_wallBaseEdges( new FloorEdgeIdVec() ),
|
||||
m_wallTopEdges( new FloorEdgeIdVec() ),
|
||||
m_pathGraph(NULL),
|
||||
m_appearance(NULL),
|
||||
m_pathGraph(nullptr),
|
||||
m_appearance(nullptr),
|
||||
m_triMarkCounter(1000),
|
||||
m_objectFloor(false)
|
||||
{
|
||||
@@ -130,13 +130,13 @@ FloorMesh::FloorMesh( VectorVector const & vertices, IntVector const & indices )
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
m_crossableLines = NULL;
|
||||
m_uncrossableLines = NULL;
|
||||
m_interiorLines = NULL;
|
||||
m_portalLines = NULL;
|
||||
m_rampLines = NULL;
|
||||
m_fallthroughTriLines = NULL;
|
||||
m_solidTriLines = NULL;
|
||||
m_crossableLines = nullptr;
|
||||
m_uncrossableLines = nullptr;
|
||||
m_interiorLines = nullptr;
|
||||
m_portalLines = nullptr;
|
||||
m_rampLines = nullptr;
|
||||
m_fallthroughTriLines = nullptr;
|
||||
m_solidTriLines = nullptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -146,50 +146,50 @@ FloorMesh::FloorMesh( VectorVector const & vertices, IntVector const & indices )
|
||||
FloorMesh::~FloorMesh()
|
||||
{
|
||||
delete m_vertices;
|
||||
m_vertices = NULL;
|
||||
m_vertices = nullptr;
|
||||
|
||||
delete m_floorTris;
|
||||
m_floorTris = NULL;
|
||||
m_floorTris = nullptr;
|
||||
|
||||
delete m_crossableEdges;
|
||||
m_crossableEdges = NULL;
|
||||
m_crossableEdges = nullptr;
|
||||
|
||||
delete m_uncrossableEdges;
|
||||
m_crossableEdges = NULL;
|
||||
m_crossableEdges = nullptr;
|
||||
|
||||
delete m_wallBaseEdges;
|
||||
m_wallBaseEdges = NULL;
|
||||
m_wallBaseEdges = nullptr;
|
||||
|
||||
delete m_wallTopEdges;
|
||||
m_wallTopEdges = NULL;
|
||||
m_wallTopEdges = nullptr;
|
||||
|
||||
delete m_pathGraph;
|
||||
m_pathGraph = NULL;
|
||||
m_pathGraph = nullptr;
|
||||
|
||||
m_appearance = NULL;
|
||||
m_appearance = nullptr;
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
delete m_crossableLines;
|
||||
m_crossableLines = NULL;
|
||||
m_crossableLines = nullptr;
|
||||
|
||||
delete m_uncrossableLines;
|
||||
m_uncrossableLines = NULL;
|
||||
m_uncrossableLines = nullptr;
|
||||
|
||||
delete m_interiorLines;
|
||||
m_interiorLines = NULL;
|
||||
m_interiorLines = nullptr;
|
||||
|
||||
delete m_portalLines;
|
||||
m_portalLines = NULL;
|
||||
m_portalLines = nullptr;
|
||||
|
||||
delete m_rampLines;
|
||||
m_rampLines = NULL;
|
||||
m_rampLines = nullptr;
|
||||
|
||||
delete m_fallthroughTriLines;
|
||||
m_fallthroughTriLines = NULL;
|
||||
m_fallthroughTriLines = nullptr;
|
||||
|
||||
delete m_solidTriLines;
|
||||
m_solidTriLines = NULL;
|
||||
m_solidTriLines = nullptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -833,7 +833,7 @@ void FloorMesh::write ( Iff & iff )
|
||||
|
||||
// ----------
|
||||
|
||||
if(m_boxTree != NULL)
|
||||
if(m_boxTree != nullptr)
|
||||
{
|
||||
m_boxTree->write(iff);
|
||||
}
|
||||
@@ -1772,7 +1772,7 @@ bool FloorMesh::canEnterEdge ( FloorLocator const & enterLoc ) const
|
||||
{
|
||||
if(enterLoc.getEdgeId() == -1) return false;
|
||||
if(enterLoc.getTriId() == -1) return false;
|
||||
if(enterLoc.getFloorMesh() == NULL) return false;
|
||||
if(enterLoc.getFloorMesh() == nullptr) return false;
|
||||
|
||||
// Can't enter the tri if it's facing down
|
||||
|
||||
@@ -1837,7 +1837,7 @@ bool FloorMesh::canExitEdge ( FloorLocator const & exitLoc, Vector const & delta
|
||||
{
|
||||
if(exitLoc.getTriId() == -1) return false;
|
||||
if(exitLoc.getEdgeId() == -1) return false;
|
||||
if(exitLoc.getFloorMesh() == NULL) return false;
|
||||
if(exitLoc.getFloorMesh() == nullptr) return false;
|
||||
|
||||
FloorEdgeType edgeType = exitLoc.getFloorTri().getEdgeType(exitLoc.getEdgeId());
|
||||
|
||||
@@ -3808,7 +3808,7 @@ void FloorMesh::drawDebugShapes ( DebugShapeRenderer * renderer, bool drawExtent
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(ConfigSharedCollision::getDrawFloors())
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ static bool epsilonEqual( float value, float target, float epsilon )
|
||||
Footprint::Footprint ( Vector const & position, float radius, CollisionProperty * parent, const float swimHeight )
|
||||
: BaseClass(),
|
||||
m_parent(parent),
|
||||
m_cellObject(NULL),
|
||||
m_cellObject(nullptr),
|
||||
m_position_p(Vector::zero),
|
||||
m_position_w(Vector::zero),
|
||||
m_radius(radius),
|
||||
@@ -112,9 +112,9 @@ Footprint::Footprint ( Vector const & position, float radius, CollisionProperty
|
||||
#ifdef _DEBUG
|
||||
,
|
||||
m_backupPosition_p(position),
|
||||
m_backupCell(NULL),
|
||||
m_backupCell(nullptr),
|
||||
m_backupObjectPosition_p(position),
|
||||
m_backupObjectCell(NULL),
|
||||
m_backupObjectCell(nullptr),
|
||||
m_lineHitTime( -1.0f ),
|
||||
m_lineOrigin( Vector(0.0f,1.5f,0.0f) ),
|
||||
m_lineDelta( Vector(0.0f,0.0f,10.0f) ),
|
||||
@@ -137,8 +137,8 @@ Footprint::~Footprint()
|
||||
{
|
||||
detach();
|
||||
|
||||
m_parent = NULL;
|
||||
m_cellObject = NULL;
|
||||
m_parent = nullptr;
|
||||
m_cellObject = nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -334,7 +334,7 @@ Object * Footprint::getOwner ( void )
|
||||
|
||||
void Footprint::addContact ( FloorLocator const & loc )
|
||||
{
|
||||
if(loc.getFloor() == NULL)
|
||||
if(loc.getFloor() == nullptr)
|
||||
{
|
||||
FLOOR_LOG("Footprint::addContact - loc isn't attached to a floor\n");
|
||||
}
|
||||
@@ -445,7 +445,7 @@ void Footprint::setSwimHeight ( float swimHeight )
|
||||
|
||||
Vector const & Footprint::getPosition_p ( void ) const
|
||||
{
|
||||
if(m_cellObject.getPointer() == NULL)
|
||||
if(m_cellObject.getPointer() == nullptr)
|
||||
{
|
||||
WARNING(true,("Footprint::getPosition_p - Footprint's parent cell has disappeared"));
|
||||
|
||||
@@ -525,7 +525,7 @@ void Footprint::setPosition ( CellProperty * pNewCell, Vector const & pos )
|
||||
{
|
||||
NAN_CHECK(pos);
|
||||
|
||||
if(pNewCell == NULL) pNewCell = CellProperty::getWorldCellProperty();
|
||||
if(pNewCell == nullptr) pNewCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
m_cellObject = &(pNewCell->getOwner());
|
||||
m_position_p = pos;
|
||||
@@ -808,13 +808,13 @@ void Footprint::runDebugTests ( void )
|
||||
IGNORE_RETURN(CollisionWorld::calcBubble(getCell(),getPosition_p(),20.0f,m_bubbleSize));
|
||||
*/
|
||||
|
||||
Object const * hitObject = NULL;
|
||||
Object const * hitObject = nullptr;
|
||||
|
||||
QueryInteractionResult result = CollisionWorld::queryInteraction(objCell,
|
||||
objPos + m_lineOrigin,
|
||||
objCell,
|
||||
objPos + m_lineOrigin + delta,
|
||||
NULL,
|
||||
nullptr,
|
||||
!ConfigSharedCollision::getIgnoreTerrainLos(),
|
||||
ConfigSharedCollision::getGenerateTerrainLos(),
|
||||
ConfigSharedCollision::getTerrainLOSMinDistance(),
|
||||
@@ -843,14 +843,14 @@ FloorLocator const * Footprint::getAnyContact ( void ) const
|
||||
if(contact->m_contact.isAttached()) return &contact->m_contact;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
FloorLocator const * Footprint::getSolidContact ( void ) const
|
||||
{
|
||||
FloorLocator const * temp = NULL;
|
||||
FloorLocator const * temp = nullptr;
|
||||
|
||||
float maxHeight = -REAL_MAX;
|
||||
|
||||
@@ -883,11 +883,11 @@ Object const * Footprint::getStandingOn ( void ) const
|
||||
{
|
||||
FloorLocator const * contact = getSolidContact();
|
||||
|
||||
if(contact == NULL) return NULL;
|
||||
if(contact == nullptr) return nullptr;
|
||||
|
||||
Floor const * floor = contact->getFloor();
|
||||
|
||||
if(floor == NULL) return NULL;
|
||||
if(floor == nullptr) return nullptr;
|
||||
|
||||
return floor->getOwner();
|
||||
}
|
||||
@@ -921,9 +921,9 @@ bool Footprint::snapToCellFloor ( void )
|
||||
|
||||
bool Footprint::isAttachedTo ( Floor const * floor ) const
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
return getFloorList().find( floor->getFootList() ) != NULL;
|
||||
return getFloorList().find( floor->getFootList() ) != nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1114,7 +1114,7 @@ void Footprint::updateOffsets ( void )
|
||||
|
||||
bool Footprint::attachTo ( Floor const * floor, bool fromObject )
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
if(isAttachedTo(floor)) return false;
|
||||
|
||||
@@ -1240,7 +1240,7 @@ int Footprint::elevatorMove ( int nFloors, Transform & outTransform )
|
||||
// ----------
|
||||
// Find the contact that's on the cell's floor
|
||||
|
||||
FloorContactShape const * cellContact = NULL;
|
||||
FloorContactShape const * cellContact = nullptr;
|
||||
|
||||
for(ConstContactIterator it(getFloorList()); it; ++it)
|
||||
{
|
||||
@@ -1261,7 +1261,7 @@ int Footprint::elevatorMove ( int nFloors, Transform & outTransform )
|
||||
}
|
||||
}
|
||||
|
||||
if(cellContact == NULL)
|
||||
if(cellContact == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1328,7 +1328,7 @@ void Footprint::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(ConfigSharedCollision::getDrawFootprints())
|
||||
{
|
||||
@@ -1525,7 +1525,7 @@ void Footprint::alignToGroundNoFloat ( void )
|
||||
if (owner)
|
||||
DEBUG_WARNING(true, ("Footprint::alignToGroundNoFloat(): called on object id=[%s],template=[%s] when no ground could be found.", owner->getNetworkId().getValueString().c_str(), owner->getObjectTemplateName()));
|
||||
else
|
||||
DEBUG_WARNING(true, ("Footprint::alignToGroundNoFloat(): called on object id=[<NULL owner>],template=[<NULL owner>] when no ground could be found."));
|
||||
DEBUG_WARNING(true, ("Footprint::alignToGroundNoFloat(): called on object id=[<nullptr owner>],template=[<nullptr owner>] when no ground could be found."));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ namespace FootprintForceReattachManagerNamespace
|
||||
|
||||
DataTable const * const dt = DataTableManager::getTable(ms_datatableName, true);
|
||||
|
||||
if (NULL == dt)
|
||||
if (nullptr == dt)
|
||||
WARNING(true, ("FootprintForceReattachManager unable to find [%s]", ms_datatableName));
|
||||
else
|
||||
{
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
MultiListHandle::MultiListHandle( BaseClass * object, int color )
|
||||
: m_color(color),
|
||||
m_object(object),
|
||||
m_head(NULL),
|
||||
m_tail(NULL)
|
||||
m_head(nullptr),
|
||||
m_tail(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ MultiListHandle::~MultiListHandle()
|
||||
{
|
||||
IGNORE_RETURN( detach() );
|
||||
|
||||
m_object = NULL;
|
||||
m_head = NULL;
|
||||
m_tail = NULL;
|
||||
m_object = nullptr;
|
||||
m_head = nullptr;
|
||||
m_tail = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -55,7 +55,7 @@ MultiListNode * MultiListHandle::detachHead ( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ MultiListHandle * MultiListHandle::detach ( void )
|
||||
|
||||
bool MultiListHandle::isConnected ( void ) const
|
||||
{
|
||||
return m_head != NULL;
|
||||
return m_head != nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -97,7 +97,7 @@ void MultiListHandle::erase ( MultiListNode * node )
|
||||
|
||||
bool MultiListHandle::isEmpty ( void ) const
|
||||
{
|
||||
return m_head == NULL;
|
||||
return m_head == nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -109,8 +109,8 @@ void MultiListHandle::insert( MultiListNode * node, MultiListNode * prev, MultiL
|
||||
DEBUG_FATAL( next == node, ("MultiListHandle::insert - Next and node are the same "));
|
||||
DEBUG_FATAL( (prev || next) && (prev == next), ("MultiListHandle::insert - Prev and Next are the same"));
|
||||
|
||||
// verify that the node to insert is not null
|
||||
DEBUG_FATAL( node == NULL, ("MultiListHandle::insert - Cannot insert null node"));
|
||||
// verify that the node to insert is not nullptr
|
||||
DEBUG_FATAL( node == nullptr, ("MultiListHandle::insert - Cannot insert nullptr node"));
|
||||
|
||||
// verify that the nodes we're inserting between are adjacent
|
||||
DEBUG_FATAL( prev && (prev->m_next[m_color] != next), ("MultiListHandle::insert - Prev and Next are not adjacent"));
|
||||
@@ -155,7 +155,7 @@ void MultiListHandle::connectTo( MultiListHandle & handle, BaseClass * data )
|
||||
|
||||
void MultiListHandle::insert( MultiListNode * node )
|
||||
{
|
||||
insert( node, NULL, m_head );
|
||||
insert( node, nullptr, m_head );
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -175,9 +175,9 @@ MultiListNode * MultiListHandle::detach ( MultiListNode * node )
|
||||
|
||||
// ----------
|
||||
|
||||
node->m_next[m_color] = NULL;
|
||||
node->m_prev[m_color] = NULL;
|
||||
node->m_list[m_color] = NULL;
|
||||
node->m_next[m_color] = nullptr;
|
||||
node->m_prev[m_color] = nullptr;
|
||||
node->m_list[m_color] = nullptr;
|
||||
}
|
||||
|
||||
return node;
|
||||
@@ -221,7 +221,7 @@ MultiListNode * MultiListHandle::find ( MultiListHandle & testHandle )
|
||||
cursor = cursor->m_next[m_color];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} //lint !e1764 // testHandle could be made const ref
|
||||
|
||||
MultiListNode const * MultiListHandle::find ( MultiListHandle const & testHandle ) const
|
||||
@@ -240,7 +240,7 @@ MultiListNode const * MultiListHandle::find ( MultiListHandle const & testHandle
|
||||
cursor = cursor->m_next[m_color];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -288,13 +288,13 @@ void MultiListHandle::destroyNodes ( void )
|
||||
// ======================================================================
|
||||
|
||||
MultiListNode::MultiListNode()
|
||||
: m_data(NULL)
|
||||
: m_data(nullptr)
|
||||
{
|
||||
for(int i = 0; i < nColors; i++)
|
||||
{
|
||||
m_next[i] = NULL;
|
||||
m_prev[i] = NULL;
|
||||
m_list[i] = NULL;
|
||||
m_next[i] = nullptr;
|
||||
m_prev[i] = nullptr;
|
||||
m_list[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ MultiListNode::~MultiListNode()
|
||||
IGNORE_RETURN( detach() );
|
||||
|
||||
BaseClass * data = m_data;
|
||||
m_data = NULL;
|
||||
m_data = nullptr;
|
||||
delete data;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ BaseClass * MultiListNode::getObject ( int color )
|
||||
if(m_list[color])
|
||||
return m_list[color]->getObject();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} //lint !e1762 // function could be const
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ BaseClass const * MultiListNode::getObject ( int color ) const
|
||||
if(m_list[color])
|
||||
return m_list[color]->getObject();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -375,7 +375,7 @@ void MultiListNode::setData( BaseClass * data )
|
||||
if(m_data == data) return;
|
||||
|
||||
BaseClass * deadData = m_data;
|
||||
m_data = NULL;
|
||||
m_data = nullptr;
|
||||
delete deadData;
|
||||
m_data = data;
|
||||
}
|
||||
@@ -403,7 +403,7 @@ void MultiListNode::swapNext ( int color )
|
||||
|
||||
/*
|
||||
MultiList::MultiList()
|
||||
: m_free(0,NULL)
|
||||
: m_free(0,nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ MultiList::MultiList()
|
||||
|
||||
bool MultiList::connect ( MultiListHandle * red, MultiListHandle * blue )
|
||||
{
|
||||
return connect(red,blue,NULL);
|
||||
return connect(red,blue,nullptr);
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -436,7 +436,7 @@ bool MultiList::connect ( MultiListHandle & red, MultiListHandle & blue, BaseCla
|
||||
|
||||
bool MultiList::connected( MultiListHandle & red, MultiListHandle & blue )
|
||||
{
|
||||
return red.find(blue) != NULL;
|
||||
return red.find(blue) != nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -450,7 +450,7 @@ bool MultiList::disconnect( MultiListHandle & red, MultiListHandle & blue )
|
||||
|
||||
MultiListNode * MultiList::getFreeNode ( void )
|
||||
{
|
||||
if(m_free.m_head == NULL)
|
||||
if(m_free.m_head == nullptr)
|
||||
{
|
||||
return new MultiListNode();
|
||||
}
|
||||
@@ -502,8 +502,8 @@ void MultiList::insert( MultiListHandle * node, MultiListHandle * prev, MultiLis
|
||||
DEBUG_FATAL( next == node, ("MultiList::insert - Next and Node are the same"));
|
||||
DEBUG_FATAL( prev == next, ("MultiList::insert - Prev and Next are the same"));
|
||||
|
||||
// verify that the node to insert is not null
|
||||
DEBUG_FATAL( node == NULL, ("MultiList::insert - Cannot insert a null node"));
|
||||
// verify that the node to insert is not nullptr
|
||||
DEBUG_FATAL( node == nullptr, ("MultiList::insert - Cannot insert a nullptr node"));
|
||||
|
||||
// verify that the two nodes are adjacent
|
||||
DEBUG_FATAL( prev && (prev->m_next != next), ("MultiList::insert - Prev and Next are not adjacent"));
|
||||
@@ -539,7 +539,7 @@ void MultiList::insert( MultiListHandle * node, MultiListHandle * prev, MultiLis
|
||||
|
||||
MultiListHandle * MultiList::detach( MultiListHandle * node )
|
||||
{
|
||||
DEBUG_FATAL( node == NULL, ("MultiList::detach - Cannot detach null node"));
|
||||
DEBUG_FATAL( node == nullptr, ("MultiList::detach - Cannot detach nullptr node"));
|
||||
DEBUG_FATAL( node->m_list != this, ("MultiList::detach - Node is not part of this list"));
|
||||
|
||||
// ----------
|
||||
@@ -555,9 +555,9 @@ MultiListHandle * MultiList::detach( MultiListHandle * node )
|
||||
if(m_head[color] == node) m_head[color] = node->m_next;
|
||||
if(m_tail[color] == node) m_tail[color] = node->m_prev;
|
||||
|
||||
node->m_prev = NULL;
|
||||
node->m_next = NULL;
|
||||
node->m_list = NULL;
|
||||
node->m_prev = nullptr;
|
||||
node->m_next = nullptr;
|
||||
node->m_list = nullptr;
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -566,13 +566,13 @@ MultiListHandle * MultiList::detach( MultiListHandle * node )
|
||||
|
||||
void MultiList::insert( MultiListHandle * node )
|
||||
{
|
||||
DEBUG_FATAL(node == NULL, ("MultiList::insert - Cannot insert NULL node"));
|
||||
DEBUG_FATAL(node == nullptr, ("MultiList::insert - Cannot insert nullptr node"));
|
||||
|
||||
// ----------
|
||||
|
||||
int color = node->m_color;
|
||||
|
||||
insert(node,NULL,m_head[color]);
|
||||
insert(node,nullptr,m_head[color]);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -168,12 +168,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T const *>(m_node->getObject(m_valueColor));
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
@@ -212,12 +212,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T *>(m_node->getObject(m_valueColor));
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
|
||||
MultiListConstDataIterator( void )
|
||||
{
|
||||
m_node = NULL;
|
||||
m_node = nullptr;
|
||||
m_color = -1;
|
||||
}
|
||||
|
||||
@@ -281,12 +281,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T const *>(m_node->getData());
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
|
||||
MultiListDataIterator( void )
|
||||
{
|
||||
m_node = NULL;
|
||||
m_node = nullptr;
|
||||
m_color = -1;
|
||||
}
|
||||
|
||||
@@ -345,12 +345,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T *>(m_node->getData());
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
NeighborObject::NeighborObject()
|
||||
: m_neighbor(NULL)
|
||||
: m_neighbor(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ SimpleCollisionMesh::SimpleCollisionMesh( IndexedTriangleList * tris )
|
||||
SimpleCollisionMesh::~SimpleCollisionMesh()
|
||||
{
|
||||
delete m_tris;
|
||||
m_tris = NULL;
|
||||
m_tris = nullptr;
|
||||
delete m_bucket;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ void SimpleCollisionMesh::drawDebugShapes ( DebugShapeRenderer * renderer ) cons
|
||||
UNREF(renderer);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if (s_renderCollisionBuckets)
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
* This functionality is used on the client to prevent a door from visually opening for
|
||||
* a mounted creature or a rider. The actual stop logic for movement is on the server.
|
||||
*
|
||||
* @param callback If NULL, no check is made. If non-NULL, the callback is called
|
||||
* @param callback If nullptr, no check is made. If non-nullptr, the callback is called
|
||||
* any time a mobile is detected to have collided with a DoorObject.
|
||||
* The return value of the callback dictates whether the hit() and hitBy()
|
||||
* logic is called on the mobile and door. If the return value of callback
|
||||
@@ -152,29 +152,29 @@ SpatialDatabase::SpatialDatabase()
|
||||
SpatialDatabase::~SpatialDatabase ( void )
|
||||
{
|
||||
delete m_staticTree;
|
||||
m_staticTree = NULL;
|
||||
m_staticTree = nullptr;
|
||||
|
||||
delete m_dynamicTree;
|
||||
m_dynamicTree = NULL;
|
||||
m_dynamicTree = nullptr;
|
||||
|
||||
delete m_doorTree;
|
||||
m_doorTree = NULL;
|
||||
m_doorTree = nullptr;
|
||||
|
||||
delete m_barrierTree;
|
||||
m_barrierTree = NULL;
|
||||
m_barrierTree = nullptr;
|
||||
|
||||
delete m_floorTree;
|
||||
m_floorTree = NULL;
|
||||
m_floorTree = nullptr;
|
||||
|
||||
delete m_ignoreStack;
|
||||
m_ignoreStack = NULL;
|
||||
m_ignoreStack = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool SpatialDatabase::canCollideWithStatics ( CollisionProperty * collision ) const
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
// On the client, remote creatures and players don't collide with statics
|
||||
|
||||
@@ -207,10 +207,10 @@ bool SpatialDatabase::canCollideWithStatics ( CollisionProperty * collision ) co
|
||||
|
||||
bool SpatialDatabase::canCollideWithStatic ( Object const * mobObject, Object * staticObject ) const
|
||||
{
|
||||
// Objects can't collide with NULL
|
||||
// Objects can't collide with nullptr
|
||||
|
||||
if(mobObject == NULL) return false;
|
||||
if(staticObject == NULL) return false;
|
||||
if(mobObject == nullptr) return false;
|
||||
if(staticObject == nullptr) return false;
|
||||
|
||||
// Objects can't collide with themselves
|
||||
|
||||
@@ -223,7 +223,7 @@ bool SpatialDatabase::canCollideWithStatic ( Object const * mobObject, Object *
|
||||
|
||||
bool SpatialDatabase::canCollideWithCreatures ( CollisionProperty const * collision ) const
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
if(collision->isPlayerControlled() && collision->isServerSide())
|
||||
{
|
||||
@@ -253,9 +253,9 @@ bool SpatialDatabase::canCollideWithCreature ( Object * player, Object * creatur
|
||||
|
||||
bool SpatialDatabase::canWalkOnFloor ( CollisionProperty * collision ) const
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
if(collision->getFootprint() == NULL) return false;
|
||||
if(collision->getFootprint() == nullptr) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -470,12 +470,12 @@ void SpatialDatabase::updateCreatureCollision(CollisionProperty * playerCollisio
|
||||
|
||||
bool SpatialDatabase::addObject(Query const query, Object * const object)
|
||||
{
|
||||
if(object == NULL)
|
||||
if(object == nullptr)
|
||||
return false;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL)
|
||||
if(collision == nullptr)
|
||||
return false;
|
||||
|
||||
if(collision->getSpatialSubdivisionHandle())
|
||||
@@ -511,15 +511,15 @@ bool SpatialDatabase::addObject(Query const query, Object * const object)
|
||||
|
||||
bool SpatialDatabase::removeObject(Query const query, Object * const object)
|
||||
{
|
||||
if(object == NULL)
|
||||
if(object == nullptr)
|
||||
return false;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL)
|
||||
if(collision == nullptr)
|
||||
return false;
|
||||
|
||||
if(collision->getSpatialSubdivisionHandle() == NULL)
|
||||
if(collision->getSpatialSubdivisionHandle() == nullptr)
|
||||
return false;
|
||||
|
||||
switch (query)
|
||||
@@ -548,7 +548,7 @@ bool SpatialDatabase::removeObject(Query const query, Object * const object)
|
||||
break;
|
||||
}
|
||||
|
||||
collision->setSpatialSubdivisionHandle(NULL);
|
||||
collision->setSpatialSubdivisionHandle(nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -645,7 +645,7 @@ bool SpatialDatabase::checkIgnoreObject ( Object const * object ) const
|
||||
|
||||
bool SpatialDatabase::addFloor ( Floor * floor )
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
if(floor->getSpatialSubdivisionHandle()) return false;
|
||||
|
||||
@@ -660,15 +660,15 @@ bool SpatialDatabase::addFloor ( Floor * floor )
|
||||
|
||||
bool SpatialDatabase::removeFloor ( Floor * floor )
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
if(floor->getSpatialSubdivisionHandle() == NULL) return false;
|
||||
if(floor->getSpatialSubdivisionHandle() == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
m_floorTree->removeObject( floor->getSpatialSubdivisionHandle() );
|
||||
|
||||
floor->setSpatialSubdivisionHandle(NULL);
|
||||
floor->setSpatialSubdivisionHandle(nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -684,11 +684,11 @@ int SpatialDatabase::getFloorCount ( void ) const
|
||||
|
||||
bool SpatialDatabase::moveObject ( CollisionProperty * collision )
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
SpatialSubdivisionHandle * handle = collision->getSpatialSubdivisionHandle();
|
||||
|
||||
if(handle == NULL) return false;
|
||||
if(handle == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -729,7 +729,7 @@ bool SpatialDatabase::queryStatics ( AxialBox const & box, ObjectVec * outList )
|
||||
|
||||
bool SpatialDatabase::queryStatics ( MultiShape const & shape, ObjectVec * outList ) const
|
||||
{
|
||||
return queryStatics( NULL, shape, outList );
|
||||
return queryStatics( nullptr, shape, outList );
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -779,21 +779,21 @@ bool SpatialDatabase::queryStatics ( Line3d const & line, ObjectVec * outList )
|
||||
|
||||
bool SpatialDatabase::queryStatics ( CellProperty const * cell, MultiShape const & shape, ObjectVec * outList ) const
|
||||
{
|
||||
return queryObjects(cell,shape,outList,NULL);
|
||||
return queryObjects(cell,shape,outList,nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool SpatialDatabase::queryDynamics ( Sphere const & sphere, ObjectVec * outList ) const
|
||||
{
|
||||
return queryObjects( NULL, MultiShape(sphere), NULL, outList );
|
||||
return queryObjects( nullptr, MultiShape(sphere), nullptr, outList );
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
bool SpatialDatabase::queryDynamics ( MultiShape const & shape, ObjectVec * outList ) const
|
||||
{
|
||||
return queryObjects( NULL, shape, NULL, outList );
|
||||
return queryObjects( nullptr, shape, nullptr, outList );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -982,7 +982,7 @@ bool SpatialDatabase::queryCloseStatics ( Vector const & point_w, float maxDista
|
||||
float minClose;
|
||||
float maxClose;
|
||||
|
||||
CollisionProperty * dummy = NULL;
|
||||
CollisionProperty * dummy = nullptr;
|
||||
|
||||
if(m_staticTree->findClosest(point_w,maxDistance,dummy,minClose,maxClose))
|
||||
{
|
||||
@@ -1001,7 +1001,7 @@ bool SpatialDatabase::queryCloseFloors ( Vector const & point_w, float maxDistan
|
||||
float minClose;
|
||||
float maxClose;
|
||||
|
||||
Floor * dummy = NULL;
|
||||
Floor * dummy = nullptr;
|
||||
|
||||
if(m_floorTree->findClosest(point_w,maxDistance,dummy,minClose,maxClose))
|
||||
{
|
||||
@@ -1163,7 +1163,7 @@ bool SpatialDatabase::queryMaterial ( CellProperty const * cell,
|
||||
// TODO: why are we skipping out on the tests when the extent is a MeshExtent???
|
||||
MeshExtent const * mesh = dynamic_cast<MeshExtent const *>(extent);
|
||||
|
||||
if(mesh != NULL) continue;
|
||||
if(mesh != nullptr) continue;
|
||||
|
||||
Range hitRange = extent->rangedIntersect(seg_p);
|
||||
|
||||
@@ -1244,7 +1244,7 @@ bool SpatialDatabase::queryMaterial ( CellProperty const * cellA,
|
||||
CollisionProperty * collisionB = results[i];
|
||||
|
||||
NOT_NULL(collisionB);
|
||||
if (collisionB == NULL)
|
||||
if (collisionB == nullptr)
|
||||
continue;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -394,7 +394,7 @@ void BoxExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidBlue );
|
||||
renderer->drawBox(m_box);
|
||||
|
||||
@@ -49,11 +49,11 @@ int CollisionDetect::getTestCounter ( void )
|
||||
|
||||
BaseExtent const * getCollisionExtent_p ( Object const * obj )
|
||||
{
|
||||
if(obj == NULL) return NULL;
|
||||
if(obj == nullptr) return nullptr;
|
||||
|
||||
CollisionProperty const * collision = obj->getCollisionProperty();
|
||||
|
||||
if(!collision) return NULL;
|
||||
if(!collision) return nullptr;
|
||||
|
||||
return collision->getExtent_p();
|
||||
}
|
||||
@@ -62,8 +62,8 @@ BaseExtent const * getCollisionExtent_p ( Object const * obj )
|
||||
|
||||
DetectResult CollisionDetect::testObjects ( Object const * objA, Object const * objB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objB == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -85,8 +85,8 @@ DetectResult CollisionDetect::testObjects ( Object const * objA, Object const *
|
||||
|
||||
DetectResult CollisionDetect::testObjects ( Object const * objA, Vector const & velocity, Object const * objB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objB == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -108,8 +108,8 @@ DetectResult CollisionDetect::testObjects ( Object const * objA, Vector const &
|
||||
|
||||
DetectResult CollisionDetect::testObjectsAsCylinders ( Object const * objA, Object const * objB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objB == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -133,7 +133,7 @@ DetectResult CollisionDetect::testObjectsAsCylinders ( Object const * objA, Obje
|
||||
|
||||
DetectResult CollisionDetect::testObjectExtent ( Object const * objA, BaseExtent const * extentB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collA = objA->getCollisionProperty();
|
||||
|
||||
@@ -158,7 +158,7 @@ DetectResult CollisionDetect::testSphereExtent ( Sphere const & sphereA, BaseExt
|
||||
|
||||
// don't return a DetectResult that contains a pointer to a temporary
|
||||
|
||||
result.extentA = NULL;
|
||||
result.extentA = nullptr;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ DetectResult CollisionDetect::testSphereExtent ( Sphere const & sphereA, Vector
|
||||
|
||||
// don't return a DetectResult that contains a pointer to a temporary
|
||||
|
||||
result.extentA = NULL;
|
||||
result.extentA = nullptr;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ DetectResult CollisionDetect::testSphereExtent ( Sphere const & sphereA, Vector
|
||||
|
||||
DetectResult CollisionDetect::testSphereObject ( Sphere const & sphereA, Object const * objB )
|
||||
{
|
||||
if(objB == NULL) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collB = objB->getCollisionProperty();
|
||||
|
||||
@@ -201,7 +201,7 @@ DetectResult CollisionDetect::testSphereObject ( Sphere const & sphereA, Object
|
||||
|
||||
DetectResult CollisionDetect::testSphereObject ( Sphere const & sphereA, Vector const & velocity, Object const * objB )
|
||||
{
|
||||
if(objB == NULL) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collB = objB->getCollisionProperty();
|
||||
|
||||
@@ -332,8 +332,8 @@ DetectResult CollisionDetect::testCapsuleObjectAgainstAllTypes(Capsule const & c
|
||||
|
||||
DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, BaseExtent const * extentB )
|
||||
{
|
||||
if(extentA == NULL) return false;
|
||||
if(extentB == NULL) return false;
|
||||
if(extentA == nullptr) return false;
|
||||
if(extentB == nullptr) return false;
|
||||
|
||||
ExtentType typeA = extentA->getType();
|
||||
ExtentType typeB = extentB->getType();
|
||||
@@ -352,8 +352,8 @@ DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, BaseExte
|
||||
|
||||
DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, Vector const & velocity, BaseExtent const * extentB )
|
||||
{
|
||||
if(extentA == NULL) return false;
|
||||
if(extentB == NULL) return false;
|
||||
if(extentA == nullptr) return false;
|
||||
if(extentB == nullptr) return false;
|
||||
|
||||
ExtentType typeA = extentA->getType();
|
||||
ExtentType typeB = extentB->getType();
|
||||
@@ -372,8 +372,8 @@ DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, Vector c
|
||||
|
||||
DetectResult CollisionDetect::testExtentsAsCylinders ( BaseExtent const * extentA, BaseExtent const * extentB )
|
||||
{
|
||||
if(extentA == NULL) return false;
|
||||
if(extentB == NULL) return false;
|
||||
if(extentA == nullptr) return false;
|
||||
if(extentB == nullptr) return false;
|
||||
|
||||
SimpleExtent const * simpleExtentA = safe_cast<SimpleExtent const * >(extentA);
|
||||
SimpleExtent const * simpleExtentB = safe_cast<SimpleExtent const * >(extentB);
|
||||
|
||||
@@ -25,16 +25,16 @@ public:
|
||||
DetectResult()
|
||||
: collided(false),
|
||||
collisionTime(Range::empty),
|
||||
extentA(NULL),
|
||||
extentB(NULL)
|
||||
extentA(nullptr),
|
||||
extentB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
DetectResult ( bool result )
|
||||
: collided(result),
|
||||
collisionTime( result ? Range::inf : Range::empty ),
|
||||
extentA(NULL),
|
||||
extentB(NULL)
|
||||
extentA(nullptr),
|
||||
extentB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ CompositeExtent::~CompositeExtent()
|
||||
{
|
||||
delete m_extents->at(i);
|
||||
|
||||
m_extents->at(i) = NULL;
|
||||
m_extents->at(i) = nullptr;
|
||||
}
|
||||
|
||||
delete m_extents;
|
||||
m_extents = NULL;
|
||||
m_extents = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void CompositeExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
for(int i = 0; i < getExtentCount(); i++)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ void CylinderExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidGreen );
|
||||
renderer->drawCylinder(m_cylinder);
|
||||
|
||||
@@ -232,11 +232,11 @@ void DetailExtent::updateBounds ( void )
|
||||
|
||||
int countExtents ( BaseExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return 0;
|
||||
if(extent == nullptr) return 0;
|
||||
|
||||
CompositeExtent const * composite = dynamic_cast<CompositeExtent const *>(extent);
|
||||
|
||||
if(composite == NULL) return 1;
|
||||
if(composite == nullptr) return 1;
|
||||
|
||||
int accum = 0;
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ void Extent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidYellow );
|
||||
renderer->drawSphere(m_sphere);
|
||||
|
||||
@@ -44,7 +44,7 @@ Extent * ExtentList::nullFactory ( Iff & iff )
|
||||
|
||||
IGNORE_RETURN( iff.goForward() );
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -110,7 +110,7 @@ void ExtentList::remove(void)
|
||||
|
||||
void ExtentList::assignBinding(Tag tag, CreateFunction createFunction)
|
||||
{
|
||||
DEBUG_FATAL(!createFunction, ("createFunction may not be NULL"));
|
||||
DEBUG_FATAL(!createFunction, ("createFunction may not be nullptr"));
|
||||
|
||||
(*ms_bindImpl.m_map) [tag] = createFunction;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ void ExtentList::removeBinding(Tag tag)
|
||||
/**
|
||||
* Fetch an Extent.
|
||||
*
|
||||
* This routine may be passed NULL.
|
||||
* This routine may be passed nullptr.
|
||||
*
|
||||
* This routine will increase the reference count of the specified extent.
|
||||
*
|
||||
@@ -165,7 +165,7 @@ Extent * ExtentList::create(Iff & iff)
|
||||
|
||||
// handle no extents
|
||||
if (iff.atEndOfForm())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
const Tag tag = iff.getCurrentName();
|
||||
|
||||
@@ -201,7 +201,7 @@ const Extent *ExtentList::fetch(Iff & iff)
|
||||
/**
|
||||
* Release an Extent.
|
||||
*
|
||||
* This routine may be passed NULL.
|
||||
* This routine may be passed nullptr.
|
||||
*
|
||||
* This routine will decrement the reference count of the Extent. When
|
||||
* the reference count becomes 0, the Extent will be deleted.
|
||||
|
||||
@@ -62,15 +62,15 @@ SimpleCollisionMesh * MeshExtent::createMesh( IndexedTriangleList * tris )
|
||||
|
||||
MeshExtent::MeshExtent()
|
||||
: Extent(ET_Mesh),
|
||||
m_mesh(NULL),
|
||||
m_mesh(nullptr),
|
||||
m_box()
|
||||
{
|
||||
m_mesh = createMesh(NULL);
|
||||
m_mesh = createMesh(nullptr);
|
||||
}
|
||||
|
||||
MeshExtent::MeshExtent( IndexedTriangleList * tris )
|
||||
: Extent(ET_Mesh),
|
||||
m_mesh(NULL),
|
||||
m_mesh(nullptr),
|
||||
m_box()
|
||||
{
|
||||
m_mesh = createMesh(tris);
|
||||
@@ -86,7 +86,7 @@ MeshExtent::MeshExtent( SimpleCollisionMesh * mesh )
|
||||
MeshExtent::~MeshExtent()
|
||||
{
|
||||
delete m_mesh;
|
||||
m_mesh = NULL;
|
||||
m_mesh = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -168,7 +168,7 @@ void MeshExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidWhite );
|
||||
m_mesh->drawDebugShapes(renderer);
|
||||
|
||||
@@ -106,7 +106,7 @@ void OrientedCylinderExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) c
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidGreen );
|
||||
renderer->draw(m_cylinder);
|
||||
|
||||
@@ -146,7 +146,7 @@ void SimpleExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
switch( getShape().getShapeType() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user