1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Fix situation around aabbox3d default constructor (#15586)

Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
This commit is contained in:
sfan5 2024-12-29 14:36:30 +01:00 committed by GitHub
parent cca65fde08
commit f2b1cc3e61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 67 additions and 53 deletions

View file

@ -134,7 +134,7 @@ public:
//! Index buffer
SIndexBuffer *Indices;
//! Bounding box of this meshbuffer.
core::aabbox3d<f32> BoundingBox;
core::aabbox3d<f32> BoundingBox{{0, 0, 0}};
//! Primitive type used for rendering (triangles, lines, ...)
E_PRIMITIVE_TYPE PrimitiveType;
};

View file

@ -108,7 +108,7 @@ public:
if (!mesh)
return true;
bool result = true;
core::aabbox3df bufferbox;
core::aabbox3df bufferbox{{0, 0, 0}};
for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i) {
result &= apply(func, mesh->getMeshBuffer(i), boundingBoxUpdate);
if (boundingBoxUpdate) {
@ -136,7 +136,7 @@ protected:
if (!buffer)
return true;
core::aabbox3df bufferbox;
core::aabbox3df bufferbox{{0, 0, 0}};
for (u32 i = 0; i < buffer->getVertexCount(); ++i) {
switch (buffer->getVertexType()) {
case video::EVT_STANDARD: {

View file

@ -154,7 +154,7 @@ struct SAnimatedMesh final : public IAnimatedMesh
std::vector<IMesh *> Meshes;
//! The bounding box of this mesh
core::aabbox3d<f32> Box;
core::aabbox3d<f32> Box{{0.0f, 0.0f, 0.0f}};
//! Default animation speed of this mesh.
f32 FramesPerSecond;

View file

@ -133,7 +133,7 @@ struct SMesh final : public IMesh
std::vector<u32> TextureSlots;
//! The bounding box of this mesh
core::aabbox3d<f32> BoundingBox;
core::aabbox3d<f32> BoundingBox{{0, 0, 0}};
};
} // end namespace scene

View file

@ -228,7 +228,7 @@ public:
video::SMaterial Material;
video::E_VERTEX_TYPE VertexType;
core::aabbox3d<f32> BoundingBox;
core::aabbox3d<f32> BoundingBox{{0, 0, 0}};
//! Primitive type used for rendering (triangles, lines, ...)
E_PRIMITIVE_TYPE PrimitiveType;

View file

@ -117,7 +117,7 @@ struct SViewFrustum
core::plane3d<f32> planes[VF_PLANE_COUNT];
//! bounding box around the view frustum
core::aabbox3d<f32> boundingBox;
core::aabbox3d<f32> boundingBox{{0, 0, 0}};
private:
//! Hold a copy of important transform matrices

View file

@ -137,7 +137,7 @@ public:
//! Moves the mesh into static position.
void resetAnimation();
virtual void updateBoundingBox();
void updateBoundingBox();
//! Recovers the joints from the mesh
void recoverJointsFromMesh(std::vector<IBoneSceneNode *> &jointChildSceneNodes);
@ -370,7 +370,7 @@ protected:
// doesn't allow taking a reference to individual elements.
std::vector<std::vector<char>> Vertices_Moved;
core::aabbox3d<f32> BoundingBox;
core::aabbox3d<f32> BoundingBox{{0, 0, 0}};
f32 EndFrame;
f32 FramesPerSecond;

View file

@ -20,9 +20,7 @@ template <class T>
class aabbox3d
{
public:
//! Default Constructor.
constexpr aabbox3d() :
MinEdge(-1, -1, -1), MaxEdge(1, 1, 1) {}
constexpr aabbox3d() = delete;
//! Constructor with min edge and max edge.
constexpr aabbox3d(const vector3d<T> &min, const vector3d<T> &max) :
MinEdge(min), MaxEdge(max) {}