mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-26 10:03:48 +00:00
Issue found with PVS-Studio:
A lot of instances where some function args are not actually modified in any way, meaning that it is better for performance to convert them into const references. This prevents an additional copy, which can help performance.
This commit is contained in:
parent
ec63398042
commit
11398bb04e
40 changed files with 59 additions and 59 deletions
|
|
@ -681,7 +681,7 @@ void NavMesh::updateConfig()
|
|||
cfg.tileSize = mTileSize / cfg.cs;
|
||||
}
|
||||
|
||||
S32 NavMesh::getTile(Point3F pos)
|
||||
S32 NavMesh::getTile(const Point3F& pos)
|
||||
{
|
||||
if(mBuilding)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public:
|
|||
/// @}
|
||||
|
||||
/// Return the index of the tile included by this point.
|
||||
S32 getTile(Point3F pos);
|
||||
S32 getTile(const Point3F& pos);
|
||||
|
||||
/// Return the box of a given tile.
|
||||
Box3F getTileBox(U32 id);
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@
|
|||
#include "math/mBox.h"
|
||||
|
||||
inline Point3F DTStoRC(F32 x, F32 y, F32 z) { return Point3F(x, z, -y); }
|
||||
inline Point3F DTStoRC(Point3F point) { return Point3F(point.x, point.z, -point.y); }
|
||||
inline Point3F DTStoRC(const Point3F& point) { return Point3F(point.x, point.z, -point.y); }
|
||||
inline Point3F RCtoDTS(const F32* xyz) { return Point3F(xyz[0], -xyz[2], xyz[1]); }
|
||||
inline Point3F RCtoDTS(F32 x, F32 y, F32 z) { return Point3F(x, -z, y); }
|
||||
inline Point3F RCtoDTS(Point3F point) { return Point3F(point.x, -point.z, point.y); }
|
||||
inline Box3F DTStoRC(Box3F box)
|
||||
inline Point3F RCtoDTS(const Point3F& point) { return Point3F(point.x, -point.z, point.y); }
|
||||
inline Box3F DTStoRC(const Box3F& box)
|
||||
{
|
||||
return Box3F(box.minExtents.x, box.minExtents.z, -box.maxExtents.y,
|
||||
box.maxExtents.x, box.maxExtents.z, -box.minExtents.y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue