Ensure that absent bone names work (#284)

This commit is contained in:
Lars Müller
2024-02-06 20:22:44 +01:00
committed by GitHub
parent 8482cc3db8
commit f1504093d1
14 changed files with 73 additions and 95 deletions

View File

@ -14,6 +14,7 @@
#include "aabbox3d.h"
#include "matrix4.h"
#include "IAttributes.h"
#include <list>
#include <optional>
@ -117,23 +118,14 @@ namespace scene
//! Returns the name of the node.
/** \return Name as character string. */
virtual const c8* getName() const
virtual const std::optional<std::string> &getName() const
{
return Name.c_str();
return Name;
}
//! Sets the name of the node.
/** \param name New name of the scene node. */
virtual void setName(const c8* name)
{
Name = name;
}
//! Sets the name of the node.
/** \param name New name of the scene node. */
virtual void setName(const core::stringc& name)
virtual void setName(const std::optional<std::string> &name)
{
Name = name;
}
@ -601,7 +593,7 @@ namespace scene
}
//! Name of the scene node.
core::stringc Name;
std::optional<std::string> Name;
//! Absolute transformation of the node.
core::matrix4 AbsoluteTransformation;

View File

@ -10,6 +10,8 @@
#include "IAnimatedMesh.h"
#include "SSkinMeshBuffer.h"
#include <optional>
namespace irr
{
namespace scene
@ -41,12 +43,12 @@ namespace scene
/** \param number: Zero based index of joint. The last joint
has the number getJointCount()-1;
\return Name of joint and null if an error happened. */
virtual const c8* getJointName(u32 number) const = 0;
virtual const std::optional<std::string> &getJointName(u32 number) const = 0;
//! Gets a joint number from its name
/** \param name: Name of the joint.
\return Number of the joint or -1 if not found. */
virtual s32 getJointNumber(const c8* name) const = 0;
\return Number of the joint or std::nullopt if not found. */
virtual std::optional<u32> getJointNumber(const std::string &name) const = 0;
//! Use animation from another mesh
/** The animation is linked (not copied) based on joint names
@ -136,7 +138,7 @@ namespace scene
}
//! The name of this joint
core::stringc Name;
std::optional<std::string> Name;
//! Local matrix of this joint
core::matrix4 LocalMatrix;

View File

@ -5,8 +5,8 @@
#pragma once
//! Identifies the IrrlichtMt fork customized for the Minetest engine
#define IRRLICHT_VERSION_MT_REVISION 14
#define IRRLICHT_VERSION_MT "mt14"
#define IRRLICHT_VERSION_MT_REVISION 15
#define IRRLICHT_VERSION_MT "mt15"
//! Irrlicht SDK Version
#define IRRLICHT_VERSION_MAJOR 1