1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00
luanti/irr/src/CBoneSceneNode.h
Lars Mueller 769c472ceb cleanup
2025-05-24 17:28:28 +02:00

57 lines
1.2 KiB
C++

// 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
#pragma once
// Used with SkinnedMesh and IAnimatedMeshSceneNode, for boned meshes
#include "IBoneSceneNode.h"
#include <optional>
namespace irr
{
namespace scene
{
class CBoneSceneNode : public IBoneSceneNode
{
public:
//! constructor
CBoneSceneNode(ISceneNode *parent, ISceneManager *mgr,
s32 id = -1, u32 boneIndex = 0,
const std::optional<std::string> &boneName = std::nullopt) :
IBoneSceneNode(parent, mgr, id),
BoneIndex(boneIndex)
{
setName(boneName);
}
//! Returns the index of the bone
u32 getBoneIndex() const override
{
return BoneIndex;
}
//! returns the axis aligned bounding box of this node
const core::aabbox3d<f32> &getBoundingBox() const override
{
return Box;
}
void OnAnimate(u32 timeMs) override;
void updateAbsolutePositionOfAllChildren() override;
private:
void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node);
const u32 BoneIndex;
// Bogus box; bone scene nodes are not rendered anyways.
static constexpr core::aabbox3d<f32> Box = {{0, 0, 0}};
};
} // end namespace scene
} // end namespace irr