Remove light volume related code
This commit is contained in:
parent
111b3f6361
commit
1fb99990b4
@ -54,7 +54,6 @@ source/Irrlicht/CImageWriterJPG.cpp
|
||||
source/Irrlicht/CZipReader.cpp
|
||||
source/Irrlicht/CImageLoaderPNG.cpp
|
||||
source/Irrlicht/CImageLoaderBMP.cpp
|
||||
source/Irrlicht/CVolumeLightSceneNode.cpp
|
||||
source/Irrlicht/CDefaultSceneNodeAnimatorFactory.cpp
|
||||
source/Irrlicht/CSkyDomeSceneNode.cpp
|
||||
source/Irrlicht/CGUIFileOpenDialog.cpp
|
||||
@ -216,7 +215,6 @@ source/Irrlicht/MacOSX/OSXClipboard.h
|
||||
source/Irrlicht/CSceneManager.h
|
||||
source/Irrlicht/COpenGLDriver.h
|
||||
source/Irrlicht/CGUIComboBox.h
|
||||
source/Irrlicht/CVolumeLightSceneNode.h
|
||||
source/Irrlicht/CSceneCollisionManager.h
|
||||
source/Irrlicht/ISceneNodeAnimatorFinishing.h
|
||||
source/Irrlicht/aesGladman/pwd2key.h
|
||||
|
@ -423,28 +423,6 @@ namespace scene
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual io::IFileSystem* getFileSystem() = 0;
|
||||
|
||||
//! adds Volume Lighting Scene Node.
|
||||
/** Example Usage:
|
||||
scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1,
|
||||
32, 32, //Subdivide U/V
|
||||
video::SColor(0, 180, 180, 180), //foot color
|
||||
video::SColor(0, 0, 0, 0) //tail color
|
||||
);
|
||||
if (n)
|
||||
{
|
||||
n->setScale(core::vector3df(46.0f, 45.0f, 46.0f));
|
||||
n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
|
||||
}
|
||||
\return Pointer to the volumeLight if successful, otherwise NULL.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
|
||||
const u32 subdivU = 32, const u32 subdivV = 32,
|
||||
const video::SColor foot = video::SColor(51, 0, 230, 180),
|
||||
const video::SColor tail = video::SColor(0, 0, 0, 0),
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a cube scene node
|
||||
/** \param size: Size of the cube, uniformly in each dimension.
|
||||
\param parent: Parent of the scene node. Can be 0 if no parent.
|
||||
|
@ -109,8 +109,6 @@ ISceneNode* CDefaultSceneNodeFactory::addSceneNode(ESCENE_NODE_TYPE type, IScene
|
||||
core::vector3df(), core::vector3df(1,1,1), true);
|
||||
case ESNT_PARTICLE_SYSTEM:
|
||||
return Manager->addParticleSystemSceneNode(true, parent);
|
||||
case ESNT_VOLUME_LIGHT:
|
||||
return (ISceneNode*)Manager->addVolumeLightSceneNode(parent);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "CTerrainSceneNode.h"
|
||||
#include "CEmptySceneNode.h"
|
||||
#include "CTextSceneNode.h"
|
||||
#include "CVolumeLightSceneNode.h"
|
||||
|
||||
#include "CDefaultSceneNodeFactory.h"
|
||||
|
||||
@ -346,23 +345,6 @@ IBillboardTextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont*
|
||||
|
||||
}
|
||||
|
||||
//! adds Volume Lighting Scene Node.
|
||||
//! the returned pointer must not be dropped.
|
||||
IVolumeLightSceneNode* CSceneManager::addVolumeLightSceneNode(
|
||||
ISceneNode* parent, s32 id,
|
||||
const u32 subdivU, const u32 subdivV,
|
||||
const video::SColor foot, const video::SColor tail,
|
||||
const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale)
|
||||
{
|
||||
if (!parent)
|
||||
parent = this;
|
||||
|
||||
IVolumeLightSceneNode* node = new CVolumeLightSceneNode(parent, this, id, subdivU, subdivV, foot, tail, position, rotation, scale);
|
||||
node->drop();
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
//! adds a test scene node for test purposes to the scene. It is a simple cube of (1,1,1) size.
|
||||
//! the returned pointer must not be dropped.
|
||||
|
@ -59,16 +59,6 @@ namespace scene
|
||||
//! return the filesystem
|
||||
virtual io::IFileSystem* getFileSystem();
|
||||
|
||||
//! adds Volume Lighting Scene Node.
|
||||
//! the returned pointer must not be dropped.
|
||||
virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
|
||||
const u32 subdivU = 32, const u32 subdivV = 32,
|
||||
const video::SColor foot = video::SColor(51, 0, 230, 180),
|
||||
const video::SColor tail = video::SColor(0, 0, 0, 0),
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
|
||||
//! adds a cube scene node to the scene. It is a simple cube of (1,1,1) size.
|
||||
//! the returned pointer must not be dropped.
|
||||
virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
|
||||
|
@ -1,202 +0,0 @@
|
||||
// Copyright (C) 2007-2012 Dean Wadsworth
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "CVolumeLightSceneNode.h"
|
||||
#include "IVideoDriver.h"
|
||||
#include "ISceneManager.h"
|
||||
#include "S3DVertex.h"
|
||||
#include "os.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! constructor
|
||||
CVolumeLightSceneNode::CVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr,
|
||||
s32 id, const u32 subdivU, const u32 subdivV,
|
||||
const video::SColor foot,
|
||||
const video::SColor tail,
|
||||
const core::vector3df& position,
|
||||
const core::vector3df& rotation, const core::vector3df& scale)
|
||||
: IVolumeLightSceneNode(parent, mgr, id, position, rotation, scale),
|
||||
Mesh(0), LPDistance(8.0f),
|
||||
SubdivideU(subdivU), SubdivideV(subdivV),
|
||||
FootColor(foot), TailColor(tail),
|
||||
LightDimensions(core::vector3df(1.0f, 1.2f, 1.0f))
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CVolumeLightSceneNode");
|
||||
#endif
|
||||
|
||||
constructLight();
|
||||
}
|
||||
|
||||
|
||||
CVolumeLightSceneNode::~CVolumeLightSceneNode()
|
||||
{
|
||||
if (Mesh)
|
||||
Mesh->drop();
|
||||
}
|
||||
|
||||
|
||||
void CVolumeLightSceneNode::constructLight()
|
||||
{
|
||||
if (Mesh)
|
||||
Mesh->drop();
|
||||
Mesh = SceneManager->getGeometryCreator()->createVolumeLightMesh(SubdivideU, SubdivideV, FootColor, TailColor, LPDistance, LightDimensions);
|
||||
}
|
||||
|
||||
|
||||
//! renders the node.
|
||||
void CVolumeLightSceneNode::render()
|
||||
{
|
||||
if (!Mesh)
|
||||
return;
|
||||
|
||||
video::IVideoDriver* driver = SceneManager->getVideoDriver();
|
||||
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
|
||||
|
||||
driver->setMaterial(Mesh->getMeshBuffer(0)->getMaterial());
|
||||
driver->drawMeshBuffer(Mesh->getMeshBuffer(0));
|
||||
}
|
||||
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
const core::aabbox3d<f32>& CVolumeLightSceneNode::getBoundingBox() const
|
||||
{
|
||||
return Mesh->getBoundingBox();
|
||||
}
|
||||
|
||||
|
||||
void CVolumeLightSceneNode::OnRegisterSceneNode()
|
||||
{
|
||||
if (IsVisible)
|
||||
{
|
||||
SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT);
|
||||
}
|
||||
ISceneNode::OnRegisterSceneNode();
|
||||
}
|
||||
|
||||
|
||||
//! returns the material based on the zero based index i. To get the amount
|
||||
//! of materials used by this scene node, use getMaterialCount().
|
||||
//! This function is needed for inserting the node into the scene hirachy on a
|
||||
//! optimal position for minimizing renderstate changes, but can also be used
|
||||
//! to directly modify the material of a scene node.
|
||||
video::SMaterial& CVolumeLightSceneNode::getMaterial(u32 i)
|
||||
{
|
||||
return Mesh->getMeshBuffer(i)->getMaterial();
|
||||
}
|
||||
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
u32 CVolumeLightSceneNode::getMaterialCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void CVolumeLightSceneNode::setSubDivideU (const u32 inU)
|
||||
{
|
||||
if (inU != SubdivideU)
|
||||
{
|
||||
SubdivideU = inU;
|
||||
constructLight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVolumeLightSceneNode::setSubDivideV (const u32 inV)
|
||||
{
|
||||
if (inV != SubdivideV)
|
||||
{
|
||||
SubdivideV = inV;
|
||||
constructLight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVolumeLightSceneNode::setFootColor(const video::SColor inColor)
|
||||
{
|
||||
if (inColor != FootColor)
|
||||
{
|
||||
FootColor = inColor;
|
||||
constructLight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVolumeLightSceneNode::setTailColor(const video::SColor inColor)
|
||||
{
|
||||
if (inColor != TailColor)
|
||||
{
|
||||
TailColor = inColor;
|
||||
constructLight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Writes attributes of the scene node.
|
||||
void CVolumeLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
|
||||
{
|
||||
ISceneNode::serializeAttributes(out, options);
|
||||
|
||||
out->addFloat("lpDistance", LPDistance);
|
||||
out->addInt("subDivideU", SubdivideU);
|
||||
out->addInt("subDivideV", SubdivideV);
|
||||
|
||||
out->addColor("footColor", FootColor);
|
||||
out->addColor("tailColor", TailColor);
|
||||
|
||||
out->addVector3d("lightDimension", LightDimensions);
|
||||
}
|
||||
|
||||
|
||||
//! Reads attributes of the scene node.
|
||||
void CVolumeLightSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
|
||||
{
|
||||
LPDistance = in->getAttributeAsFloat("lpDistance");
|
||||
LPDistance = core::max_(LPDistance, 8.0f);
|
||||
|
||||
SubdivideU = in->getAttributeAsInt("subDivideU");
|
||||
SubdivideU = core::max_(SubdivideU, 1u);
|
||||
|
||||
SubdivideV = in->getAttributeAsInt("subDivideV");
|
||||
SubdivideV = core::max_(SubdivideV, 1u);
|
||||
|
||||
FootColor = in->getAttributeAsColor("footColor");
|
||||
TailColor = in->getAttributeAsColor("tailColor");
|
||||
|
||||
LightDimensions = in->getAttributeAsVector3d("lightDimension");
|
||||
|
||||
constructLight();
|
||||
|
||||
ISceneNode::deserializeAttributes(in, options);
|
||||
}
|
||||
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
ISceneNode* CVolumeLightSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager)
|
||||
{
|
||||
if (!newParent)
|
||||
newParent = Parent;
|
||||
if (!newManager)
|
||||
newManager = SceneManager;
|
||||
|
||||
CVolumeLightSceneNode* nb = new CVolumeLightSceneNode(newParent,
|
||||
newManager, ID, SubdivideU, SubdivideV, FootColor, TailColor, RelativeTranslation);
|
||||
|
||||
nb->cloneMembers(this, newManager);
|
||||
nb->getMaterial(0) = Mesh->getMeshBuffer(0)->getMaterial();
|
||||
|
||||
if ( newParent )
|
||||
nb->drop();
|
||||
return nb;
|
||||
}
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
@ -1,93 +0,0 @@
|
||||
// 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
|
||||
//
|
||||
// created by Dean Wadsworth aka Varmint Dec 31 2007
|
||||
|
||||
#ifndef __VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
|
||||
#define __VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
#include "IVolumeLightSceneNode.h"
|
||||
#include "IMesh.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
class CVolumeLightSceneNode : public IVolumeLightSceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
CVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const u32 subdivU = 32, const u32 subdivV = 32,
|
||||
const video::SColor foot = video::SColor(51, 0, 230, 180),
|
||||
const video::SColor tail = video::SColor(0, 0, 0, 0),
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
|
||||
virtual ~CVolumeLightSceneNode();
|
||||
|
||||
virtual void OnRegisterSceneNode();
|
||||
|
||||
//! renders the node.
|
||||
virtual void render();
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const;
|
||||
|
||||
//! returns the material based on the zero based index i.
|
||||
virtual video::SMaterial& getMaterial(u32 i);
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
virtual u32 getMaterialCount() const;
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const { return ESNT_VOLUME_LIGHT; }
|
||||
|
||||
//! Writes attributes of the scene node.
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
|
||||
|
||||
//! Reads attributes of the scene node.
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
|
||||
|
||||
virtual void setSubDivideU(const u32 inU);
|
||||
virtual void setSubDivideV(const u32 inV);
|
||||
|
||||
virtual u32 getSubDivideU() const { return SubdivideU; }
|
||||
virtual u32 getSubDivideV() const { return SubdivideV; }
|
||||
|
||||
virtual void setFootColor(const video::SColor inColor);
|
||||
virtual void setTailColor(const video::SColor inColor);
|
||||
|
||||
virtual video::SColor getFootColor() const { return FootColor; }
|
||||
virtual video::SColor getTailColor() const { return TailColor; }
|
||||
|
||||
private:
|
||||
void constructLight();
|
||||
|
||||
IMesh* Mesh;
|
||||
|
||||
f32 LPDistance; // Distance to hypothetical lightsource point -- affects fov angle
|
||||
|
||||
u32 SubdivideU; // Number of subdivisions in U and V space.
|
||||
u32 SubdivideV; // Controls the number of "slices" in the volume.
|
||||
// NOTE : Total number of polygons = 2 + ((SubdivideU + 1) + (SubdivideV + 1)) * 2
|
||||
// Each slice being a quad plus the rectangular plane at the bottom.
|
||||
|
||||
video::SColor FootColor; // Color at the source
|
||||
video::SColor TailColor; // Color at the end.
|
||||
|
||||
core::vector3df LightDimensions; // LightDimensions.Y Distance of shooting -- Length of beams
|
||||
// LightDimensions.X and LightDimensions.Z determine the size/dimension of the plane
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user