To reduce amount of computations on the caller side and restrict possible values. * verts can't be non-int because it's a number of things. * worldsize is initially defined as int by ESM::Land::REAL_SIZE. * Put function to calculate heightfied shift into components to be able to reuse by other binaries.
15 lines
387 B
C++
15 lines
387 B
C++
#ifndef OPENMW_COMPONENTS_BULLETHELPERS_HEIGHTFIELD_H
|
|
#define OPENMW_COMPONENTS_BULLETHELPERS_HEIGHTFIELD_H
|
|
|
|
#include <LinearMath/btVector3.h>
|
|
|
|
namespace BulletHelpers
|
|
{
|
|
inline btVector3 getHeightfieldShift(int x, int y, int size, float minHeight, float maxHeight)
|
|
{
|
|
return btVector3((x + 0.5f) * size, (y + 0.5f) * size, (maxHeight + minHeight) * 0.5f);
|
|
}
|
|
}
|
|
|
|
#endif
|