2023-10-03 20:37:00 +02: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
|
|
|
|
|
|
|
|
#include "CEmptySceneNode.h"
|
|
|
|
#include "ISceneManager.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
//! constructor
|
2024-03-20 19:35:52 +01:00
|
|
|
CEmptySceneNode::CEmptySceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id) :
|
|
|
|
ISceneNode(parent, mgr, id)
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
2024-03-20 19:35:52 +01:00
|
|
|
#ifdef _DEBUG
|
2023-10-03 20:37:00 +02:00
|
|
|
setDebugName("CEmptySceneNode");
|
2024-03-20 19:35:52 +01:00
|
|
|
#endif
|
2023-10-03 20:37:00 +02:00
|
|
|
|
|
|
|
setAutomaticCulling(scene::EAC_OFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
//! pre render event
|
|
|
|
void CEmptySceneNode::OnRegisterSceneNode()
|
|
|
|
{
|
|
|
|
if (IsVisible)
|
|
|
|
SceneManager->registerNodeForRendering(this);
|
|
|
|
|
|
|
|
ISceneNode::OnRegisterSceneNode();
|
|
|
|
}
|
|
|
|
|
|
|
|
//! render
|
|
|
|
void CEmptySceneNode::render()
|
|
|
|
{
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
//! returns the axis aligned bounding box of this node
|
2024-03-20 19:35:52 +01:00
|
|
|
const core::aabbox3d<f32> &CEmptySceneNode::getBoundingBox() const
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
return Box;
|
|
|
|
}
|
|
|
|
|
|
|
|
//! Creates a clone of this scene node and its children.
|
2024-03-20 19:35:52 +01:00
|
|
|
ISceneNode *CEmptySceneNode::clone(ISceneNode *newParent, ISceneManager *newManager)
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
if (!newParent)
|
|
|
|
newParent = Parent;
|
|
|
|
if (!newManager)
|
|
|
|
newManager = SceneManager;
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
CEmptySceneNode *nb = new CEmptySceneNode(newParent,
|
|
|
|
newManager, ID);
|
2023-10-03 20:37:00 +02:00
|
|
|
|
|
|
|
nb->cloneMembers(this, newManager);
|
|
|
|
nb->Box = Box;
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
if (newParent)
|
2023-10-03 20:37:00 +02:00
|
|
|
nb->drop();
|
|
|
|
return nb;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|