Removing sky dome (not used anywhere + deprecated even in irrlicht)

This commit is contained in:
jean 2021-02-07 21:56:58 +01:00
parent cee3cb79a5
commit 89acc4e6a0
8 changed files with 3 additions and 131 deletions

View File

@ -741,29 +741,6 @@ namespace scene
video::ITexture* left, video::ITexture* right, video::ITexture* front,
video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
//! Adds a skydome scene node to the scene graph.
/** A skydome is a large (half-) sphere with a panoramic texture
on the inside and is drawn around the camera position.
\param texture: Texture for the dome.
\param horiRes: Number of vertices of a horizontal layer of the sphere.
\param vertRes: Number of vertices of a vertical layer of the sphere.
\param texturePercentage: How much of the height of the
texture is used. Should be between 0 and 1.
\param spherePercentage: How much of the sphere is drawn.
Value should be between 0 and 2, where 1 is an exact
half-sphere and 2 is a full sphere.
\param radius The Radius of the sphere
\param parent: Parent scene node of the dome. A dome usually has no parent,
so this should be null. Note: If a parent is set, the dome will not
change how it is drawn.
\param id: An id of the node. This id can be used to identify the node.
\return Pointer to the sky dome if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
u32 horiRes=16, u32 vertRes=8,
f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
ISceneNode* parent=0, s32 id=-1) = 0;
//! Adds a particle system scene node to the scene graph.
/** \param withDefaultEmitter: Creates a default working point emitter
which emitts some particles. Set this to true to see a particle system

View File

@ -81,8 +81,6 @@ ISceneNode* CDefaultSceneNodeFactory::addSceneNode(ESCENE_NODE_TYPE type, IScene
4, ETPS_17, 0, true);
case ESNT_SKY_BOX:
return Manager->addSkyBoxSceneNode(0,0,0,0,0,0, parent);
case ESNT_SKY_DOME:
return Manager->addSkyDomeSceneNode(0, 16, 8, 0.9f, 2.0f, 1000.0f, parent);
case ESNT_SHADOW_VOLUME:
return 0;
case ESNT_OCTREE:

View File

@ -581,24 +581,6 @@ ISceneNode* CSceneManager::addSkyBoxSceneNode(video::ITexture* top, video::IText
return node;
}
//! Adds a skydome scene node. A skydome is a large (half-) sphere with a
//! panoramic texture on it and is drawn around the camera position.
ISceneNode* CSceneManager::addSkyDomeSceneNode(video::ITexture* texture,
u32 horiRes, u32 vertRes, f32 texturePercentage,f32 spherePercentage, f32 radius,
ISceneNode* parent, s32 id)
{
if (!parent)
parent = this;
ISceneNode* node = new CSkyDomeSceneNode(texture, horiRes, vertRes,
texturePercentage, spherePercentage, radius, parent, this, id);
node->drop();
return node;
}
//! Adds a particle system scene node.
IParticleSystemSceneNode* CSceneManager::addParticleSystemSceneNode(
bool withDefaultEmitter, ISceneNode* parent, s32 id,

View File

@ -164,13 +164,6 @@ namespace scene
video::ITexture* left, video::ITexture* right, video::ITexture* front,
video::ITexture* back, ISceneNode* parent = 0, s32 id=-1);
//! Adds a skydome scene node. A skydome is a large (half-) sphere with a
//! panoramic texture on it and is drawn around the camera position.
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
u32 horiRes=16, u32 vertRes=8,
f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
ISceneNode* parent=0, s32 id=-1);
//! Adds a text scene node, which is able to display
//! 2d text at a position in three dimensional space
virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,

View File

@ -1542,30 +1542,6 @@ scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *
} // addAnimatedMesh
// ----------------------------------------------------------------------------
/** Adds a sky dome. Documentation from irrlicht:
* A skydome is a large (half-) sphere with a panoramic texture on the inside
* and is drawn around the camera position.
* \param texture: Texture for the dome.
* \param horiRes: Number of vertices of a horizontal layer of the sphere.
* \param vertRes: Number of vertices of a vertical layer of the sphere.
* \param texturePercentage: How much of the height of the texture is used.
* Should be between 0 and 1.
* \param spherePercentage: How much of the sphere is drawn. Value should be
* between 0 and 2, where 1 is an exact half-sphere and 2 is a full
* sphere.
*/
scene::ISceneNode *IrrDriver::addSkyDome(video::ITexture *texture,
int hori_res, int vert_res,
float texture_percent,
float sphere_percent)
{
Log::error("skybox", "Using deprecated SkyDome");
return m_scene_manager->addSkyDomeSceneNode(texture, hori_res, vert_res,
texture_percent,
sphere_percent);
} // addSkyDome
// ----------------------------------------------------------------------------
/** Adds a skybox using. Irrlicht documentation:
* A skybox is a big cube with 6 textures on it and is drawn around the camera

View File

@ -249,9 +249,6 @@ public:
scene::ISceneNode* parent=NULL);
scene::IParticleSystemSceneNode
*addParticleNode(bool default_emitter=true);
scene::ISceneNode *addSkyDome(video::ITexture *texture, int hori_res,
int vert_res, float texture_percent,
float sphere_percent);
scene::ISceneNode *addSkyBox(const std::vector<video::ITexture*> &texture_names,
const std::vector<video::ITexture*> &spherical_harmonics_textures);
void suppressSkyBox();

View File

@ -954,7 +954,6 @@ void Track::convertTrackToBullet(scene::ISceneNode *node)
mesh = ((scene::IAnimatedMeshSceneNode*)node)->getMesh();
break;
case scene::ESNT_SKY_BOX :
case scene::ESNT_SKY_DOME:
case scene::ESNT_PARTICLE_SYSTEM :
case scene::ESNT_TEXT:
// These are non-physical
@ -2093,30 +2092,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
// --------------------------
irr_driver->suppressSkyBox();
#ifndef SERVER_ONLY
if(!CVS->isGLSL() && m_sky_type==SKY_DOME && m_sky_textures.size() > 0)
{
scene::ISceneNode *node = irr_driver->addSkyDome(m_sky_textures[0],
m_sky_hori_segments,
m_sky_vert_segments,
m_sky_texture_percent,
m_sky_sphere_percent);
for(unsigned int i=0; i<node->getMaterialCount(); i++)
{
main_loop->renderGUI(5350, i, node->getMaterialCount());
video::SMaterial &irrMaterial=node->getMaterial(i);
for(unsigned int j=0; j<video::MATERIAL_MAX_TEXTURES; j++)
{
video::ITexture* t=irrMaterial.getTexture(j);
if(!t) continue;
core::matrix4 *m = &irrMaterial.getTextureMatrix(j);
m_animated_textures.push_back(new MovingTexture(m, m_sky_dx, m_sky_dy));
} // for j<MATERIAL_MAX_TEXTURES
} // for i<getMaterialCount
m_all_nodes.push_back(node);
}
else if(m_sky_type==SKY_BOX && m_sky_textures.size() == 6)
if(m_sky_type==SKY_BOX && m_sky_textures.size() == 6)
{
//if (m_spherical_harmonics_textures.size() > 0)
m_all_nodes.push_back(irr_driver->addSkyBox(m_sky_textures, m_spherical_harmonics_textures));
@ -2449,34 +2425,7 @@ void Track::loadObjects(const XMLNode* root, const std::string& path,
*/
void Track::handleSky(const XMLNode &xml_node, const std::string &filename)
{
if(xml_node.getName()=="sky-dome")
{
m_sky_type = SKY_DOME;
m_sky_vert_segments = 16;
m_sky_hori_segments = 16;
m_sky_sphere_percent = 1.0f;
m_sky_texture_percent = 1.0f;
std::string s;
xml_node.get("texture", &s );
video::ITexture *t = irr_driver->getTexture(s);
if (t != NULL)
{
t->grab();
m_sky_textures.push_back(t);
xml_node.get("vertical", &m_sky_vert_segments );
xml_node.get("horizontal", &m_sky_hori_segments );
xml_node.get("sphere-percent", &m_sky_sphere_percent );
xml_node.get("texture-percent", &m_sky_texture_percent);
xml_node.get("speed-x", &m_sky_dx );
xml_node.get("speed-y", &m_sky_dy);
}
else
{
Log::error("track", "Sky-dome texture '%s' not found - ignored.",
s.c_str());
}
} // if sky-dome
else if(xml_node.getName()=="sky-box")
if(xml_node.getName()=="sky-box")
{
std::string s;
xml_node.get("texture", &s);

View File

@ -246,7 +246,7 @@ private:
/** The type of sky to be used for the track. */
enum {SKY_NONE, SKY_BOX,
SKY_DOME, SKY_COLOR} m_sky_type;
SKY_COLOR} m_sky_type;
/** sky rotation speed */
float m_sky_dx, m_sky_dy;