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 "CDummyTransformationSceneNode.h"
|
|
|
|
#include "os.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
CDummyTransformationSceneNode::CDummyTransformationSceneNode(
|
2024-03-20 19:35:52 +01:00
|
|
|
ISceneNode *parent, ISceneManager *mgr, s32 id) :
|
|
|
|
IDummyTransformationSceneNode(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("CDummyTransformationSceneNode");
|
2024-03-20 19:35:52 +01:00
|
|
|
#endif
|
2023-10-03 20:37:00 +02:00
|
|
|
|
|
|
|
setAutomaticCulling(scene::EAC_OFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
//! returns the axis aligned bounding box of this node
|
2024-03-20 19:35:52 +01:00
|
|
|
const core::aabbox3d<f32> &CDummyTransformationSceneNode::getBoundingBox() const
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
return Box;
|
|
|
|
}
|
|
|
|
|
|
|
|
//! Returns a reference to the current relative transformation matrix.
|
|
|
|
//! This is the matrix, this scene node uses instead of scale, translation
|
|
|
|
//! and rotation.
|
2024-03-20 19:35:52 +01:00
|
|
|
core::matrix4 &CDummyTransformationSceneNode::getRelativeTransformationMatrix()
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
return RelativeTransformationMatrix;
|
|
|
|
}
|
|
|
|
|
|
|
|
//! Returns the relative transformation of the scene node.
|
|
|
|
core::matrix4 CDummyTransformationSceneNode::getRelativeTransformation() const
|
|
|
|
{
|
|
|
|
return RelativeTransformationMatrix;
|
|
|
|
}
|
|
|
|
|
|
|
|
//! Creates a clone of this scene node and its children.
|
2024-03-20 19:35:52 +01:00
|
|
|
ISceneNode *CDummyTransformationSceneNode::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
|
|
|
CDummyTransformationSceneNode *nb = new CDummyTransformationSceneNode(newParent,
|
|
|
|
newManager, ID);
|
2023-10-03 20:37:00 +02:00
|
|
|
|
|
|
|
nb->cloneMembers(this, newManager);
|
|
|
|
nb->RelativeTransformationMatrix = RelativeTransformationMatrix;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
const core::vector3df &CDummyTransformationSceneNode::getScale() const
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
os::Printer::log("CDummyTransformationSceneNode::getScale() does not contain the relative transformation.", ELL_DEBUG);
|
|
|
|
return RelativeScale;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
void CDummyTransformationSceneNode::setScale(const core::vector3df &scale)
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
os::Printer::log("CDummyTransformationSceneNode::setScale() does not affect the relative transformation.", ELL_DEBUG);
|
|
|
|
RelativeScale = scale;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
const core::vector3df &CDummyTransformationSceneNode::getRotation() const
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
os::Printer::log("CDummyTransformationSceneNode::getRotation() does not contain the relative transformation.", ELL_DEBUG);
|
|
|
|
return RelativeRotation;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
void CDummyTransformationSceneNode::setRotation(const core::vector3df &rotation)
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
os::Printer::log("CDummyTransformationSceneNode::setRotation() does not affect the relative transformation.", ELL_DEBUG);
|
|
|
|
RelativeRotation = rotation;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
const core::vector3df &CDummyTransformationSceneNode::getPosition() const
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
os::Printer::log("CDummyTransformationSceneNode::getPosition() does not contain the relative transformation.", ELL_DEBUG);
|
|
|
|
return RelativeTranslation;
|
|
|
|
}
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
void CDummyTransformationSceneNode::setPosition(const core::vector3df &newpos)
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
|
|
|
os::Printer::log("CDummyTransformationSceneNode::setPosition() does not affect the relative transformation.", ELL_DEBUG);
|
|
|
|
RelativeTranslation = newpos;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|