mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
cleanup
This commit is contained in:
parent
d17f22f536
commit
769c472ceb
9 changed files with 28 additions and 203 deletions
|
@ -12,18 +12,6 @@ namespace irr
|
|||
{
|
||||
namespace scene
|
||||
{
|
||||
enum E_JOINT_UPDATE_ON_RENDER
|
||||
{
|
||||
//! do nothing
|
||||
EJUOR_NONE = 0,
|
||||
|
||||
//! get joints positions from the mesh (for attached nodes, etc)
|
||||
EJUOR_READ,
|
||||
|
||||
//! control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() )
|
||||
EJUOR_CONTROL
|
||||
};
|
||||
|
||||
class IAnimatedMeshSceneNode;
|
||||
|
||||
//! Callback interface for catching events of ended animations.
|
||||
|
@ -141,13 +129,8 @@ public:
|
|||
//! Returns the current mesh
|
||||
virtual IAnimatedMesh *getMesh(void) = 0;
|
||||
|
||||
//! Set how the joints should be updated on render
|
||||
virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode) = 0;
|
||||
|
||||
//! Sets the transition time in seconds
|
||||
/** Note: This needs to enable joints, and setJointmode set to
|
||||
EJUOR_CONTROL. You must call animateJoints(), or the mesh will
|
||||
not animate. */
|
||||
/** Note: You must call animateJoints(), or the mesh will not animate. */
|
||||
virtual void setTransitionTime(f32 Time) = 0;
|
||||
|
||||
//! animates the joints in the mesh based on the current frame.
|
||||
|
|
|
@ -11,60 +11,17 @@ namespace irr
|
|||
namespace scene
|
||||
{
|
||||
|
||||
//! Enumeration for different bone animation modes
|
||||
enum E_BONE_ANIMATION_MODE
|
||||
{
|
||||
//! The bone is usually animated, unless it's parent is not animated
|
||||
EBAM_AUTOMATIC = 0,
|
||||
|
||||
//! The bone is animated by the skin, if it's parent is not animated then animation will resume from this bone onward
|
||||
EBAM_ANIMATED,
|
||||
|
||||
//! The bone is not animated by the skin
|
||||
EBAM_UNANIMATED,
|
||||
|
||||
//! Not an animation mode, just here to count the available modes
|
||||
EBAM_COUNT
|
||||
|
||||
};
|
||||
|
||||
enum E_BONE_SKINNING_SPACE
|
||||
{
|
||||
//! local skinning, standard
|
||||
EBSS_LOCAL = 0,
|
||||
|
||||
//! global skinning
|
||||
EBSS_GLOBAL,
|
||||
|
||||
EBSS_COUNT
|
||||
};
|
||||
|
||||
//! Names for bone animation modes
|
||||
const c8 *const BoneAnimationModeNames[] = {
|
||||
"automatic",
|
||||
"animated",
|
||||
"unanimated",
|
||||
0,
|
||||
};
|
||||
|
||||
//! Interface for bones used for skeletal animation.
|
||||
/** Used with SkinnedMesh and IAnimatedMeshSceneNode. */
|
||||
class IBoneSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
IBoneSceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id = -1) :
|
||||
ISceneNode(parent, mgr, id), positionHint(-1), scaleHint(-1), rotationHint(-1) {}
|
||||
ISceneNode(parent, mgr, id) {}
|
||||
|
||||
//! Get the index of the bone
|
||||
virtual u32 getBoneIndex() const = 0;
|
||||
|
||||
//! Sets the animation mode of the bone.
|
||||
/** \return True if successful. (Unused) */
|
||||
virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0;
|
||||
|
||||
//! Gets the current animation mode of the bone
|
||||
virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
|
||||
|
||||
//! Get the axis aligned bounding box of this node
|
||||
const core::aabbox3d<f32> &getBoundingBox() const override = 0;
|
||||
|
||||
|
@ -78,18 +35,8 @@ public:
|
|||
/** Does nothing as bones are not visible. */
|
||||
void render() override {}
|
||||
|
||||
//! How the relative transformation of the bone is used
|
||||
virtual void setSkinningSpace(E_BONE_SKINNING_SPACE space) = 0;
|
||||
|
||||
//! How the relative transformation of the bone is used
|
||||
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const = 0;
|
||||
|
||||
//! Updates the absolute position based on the relative and the parents position
|
||||
virtual void updateAbsolutePositionOfAllChildren() = 0;
|
||||
|
||||
s32 positionHint;
|
||||
s32 scaleHint;
|
||||
s32 rotationHint;
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
|
|
|
@ -309,7 +309,7 @@ public:
|
|||
//! Joints
|
||||
struct SJoint
|
||||
{
|
||||
SJoint() : GlobalSkinningSpace(false) {}
|
||||
SJoint() {}
|
||||
|
||||
//! The name of this joint
|
||||
std::optional<std::string> Name;
|
||||
|
@ -344,8 +344,6 @@ public:
|
|||
private:
|
||||
//! Internal members used by SkinnedMesh
|
||||
friend class SkinnedMesh;
|
||||
|
||||
bool GlobalSkinningSpace;
|
||||
};
|
||||
|
||||
const std::vector<SJoint *> &getAllJoints() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue