mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: make sure shape editor and shape instance max vert count is always the same
Use the same constant for class ShapeVolumeTool and struct ShapeVolume, since we do plan on increasing this in the future. Having multiple constants can cause hard to find problems when tweaking this.
This commit is contained in:
parent
be27f75442
commit
e9e1a96310
@ -275,7 +275,7 @@ void ShapeVolumeTool::handleClick(const float* /*s*/, const float* p, bool shift
|
||||
if (m_nhull > 2)
|
||||
{
|
||||
// Create shape.
|
||||
float verts[MAX_PTS*3];
|
||||
float verts[MAX_SHAPEVOL_PTS*3];
|
||||
for (int i = 0; i < m_nhull; ++i)
|
||||
rdVcopy(&verts[i*3], &m_pts[m_hull[i]*3]);
|
||||
|
||||
@ -287,8 +287,8 @@ void ShapeVolumeTool::handleClick(const float* /*s*/, const float* p, bool shift
|
||||
|
||||
if (m_convexOffset > 0.01f)
|
||||
{
|
||||
float offset[MAX_PTS*2*3];
|
||||
const int noffset = rcOffsetPoly(verts, m_nhull, m_convexOffset, offset, MAX_PTS*2);
|
||||
float offset[MAX_SHAPEVOL_PTS*2*3];
|
||||
const int noffset = rcOffsetPoly(verts, m_nhull, m_convexOffset, offset, MAX_SHAPEVOL_PTS*2);
|
||||
if (noffset > 0)
|
||||
geom->addConvexVolume(offset, noffset, minh, maxh, (unsigned short)m_polyFlags, (unsigned char)m_areaType);
|
||||
}
|
||||
@ -304,7 +304,7 @@ void ShapeVolumeTool::handleClick(const float* /*s*/, const float* p, bool shift
|
||||
else
|
||||
{
|
||||
// Add new point
|
||||
if (m_npts < MAX_PTS)
|
||||
if (m_npts < MAX_SHAPEVOL_PTS)
|
||||
{
|
||||
rdVcopy(&m_pts[m_npts*3], p);
|
||||
m_npts++;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#define SHAPEVOLUMETOOL_H
|
||||
|
||||
#include "NavEditor/Include/Editor.h"
|
||||
#include "NavEditor/Include/InputGeom.h"
|
||||
|
||||
// Tool to create shape volumes for InputGeom
|
||||
|
||||
@ -40,10 +41,9 @@ class ShapeVolumeTool : public EditorTool
|
||||
float m_convexHeight;
|
||||
float m_convexDescent;
|
||||
|
||||
static const int MAX_PTS = 12;
|
||||
float m_pts[MAX_PTS*3];
|
||||
float m_pts[MAX_SHAPEVOL_PTS*3];
|
||||
int m_npts;
|
||||
int m_hull[MAX_PTS];
|
||||
int m_hull[MAX_SHAPEVOL_PTS];
|
||||
int m_nhull;
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user