2019-12-12 17:32:41 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __C_BONE_SCENE_NODE_H_INCLUDED__
|
|
|
|
#define __C_BONE_SCENE_NODE_H_INCLUDED__
|
|
|
|
|
|
|
|
// Used with SkinnedMesh and IAnimatedMeshSceneNode, for boned meshes
|
|
|
|
|
|
|
|
#include "IBoneSceneNode.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
class CBoneSceneNode : public IBoneSceneNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr,
|
|
|
|
s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
|
|
|
|
|
|
|
|
//! Returns the index of the bone
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual u32 getBoneIndex() const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Sets the animation mode of the bone. Returns true if successful.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Gets the current animation mode of the bone
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual E_BONE_ANIMATION_MODE getAnimationMode() const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! returns the axis aligned bounding box of this node
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual const core::aabbox3d<f32>& getBoundingBox() const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
//! Returns the relative transformation of the scene node.
|
2021-08-27 14:55:10 +02:00
|
|
|
//virtual core::matrix4 getRelativeTransformation() const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
*/
|
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void OnAnimate(u32 timeMs) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void updateAbsolutePositionOfAllChildren() IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Writes attributes of the scene node.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Reads attributes of the scene node.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! How the relative transformation of the bone is used
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void setSkinningSpace(E_BONE_SKINNING_SPACE space) IRR_OVERRIDE
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
|
|
|
SkinningSpace=space;
|
|
|
|
}
|
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const IRR_OVERRIDE
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
|
|
|
return SkinningSpace;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node);
|
|
|
|
|
|
|
|
u32 BoneIndex;
|
|
|
|
|
|
|
|
core::aabbox3d<f32> Box;
|
|
|
|
|
|
|
|
E_BONE_ANIMATION_MODE AnimationMode;
|
|
|
|
E_BONE_SKINNING_SPACE SkinningSpace;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|