Use a custom stk mesh
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14997 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
9b1853ef21
commit
c3a4f7d8ce
1330
sources.cmake
1330
sources.cmake
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,7 @@
|
||||
#include "graphics/referee.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
#include "graphics/shadow_importance.hpp"
|
||||
#include "graphics/stkmesh.hpp"
|
||||
#include "graphics/sun.hpp"
|
||||
#include "graphics/rtts.hpp"
|
||||
#include "graphics/water.hpp"
|
||||
@ -902,7 +903,16 @@ scene::IParticleSystemSceneNode *IrrDriver::addParticleNode(bool default_emitter
|
||||
scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
|
||||
scene::ISceneNode *parent)
|
||||
{
|
||||
return m_scene_manager->addMeshSceneNode(mesh, parent);
|
||||
if (!isGLSL())
|
||||
return m_scene_manager->addMeshSceneNode(mesh, parent);
|
||||
|
||||
if (!parent)
|
||||
parent = m_scene_manager->getRootSceneNode();
|
||||
|
||||
scene::IMeshSceneNode* node = new STKMesh(mesh, parent, m_scene_manager, -1);
|
||||
node->drop();
|
||||
|
||||
return node;
|
||||
} // addMesh
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
15
src/graphics/stkmesh.cpp
Normal file
15
src/graphics/stkmesh.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "stkmesh.hpp"
|
||||
|
||||
STKMesh::STKMesh(irr::scene::IMesh* mesh, ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
const irr::core::vector3df& position,
|
||||
const irr::core::vector3df& rotation,
|
||||
const irr::core::vector3df& scale) :
|
||||
CMeshSceneNode(mesh, parent, mgr, id, position, rotation, scale)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void STKMesh::render()
|
||||
{
|
||||
CMeshSceneNode::render();
|
||||
}
|
19
src/graphics/stkmesh.hpp
Normal file
19
src/graphics/stkmesh.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef STKMESH_H
|
||||
#define STKMESH_H
|
||||
|
||||
|
||||
#include <IMeshSceneNode.h>
|
||||
#include <IMesh.h>
|
||||
#include "../lib/irrlicht/source/Irrlicht/CMeshSceneNode.h"
|
||||
|
||||
class STKMesh : public irr::scene::CMeshSceneNode
|
||||
{
|
||||
public:
|
||||
STKMesh(irr::scene::IMesh* mesh, ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
const irr::core::vector3df& position = irr::core::vector3df(0,0,0),
|
||||
const irr::core::vector3df& rotation = irr::core::vector3df(0,0,0),
|
||||
const irr::core::vector3df& scale = irr::core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
virtual void render();
|
||||
};
|
||||
|
||||
#endif // STKMESH_H
|
@ -818,8 +818,8 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
|
||||
// The merged mesh is grabbed by the octtree, so we don't need
|
||||
// to keep a reference to it.
|
||||
//scene::ISceneNode *scene_node = irr_driver->addMesh(merged_mesh);
|
||||
scene::IMeshSceneNode *scene_node = irr_driver->addOctTree(merged_mesh);
|
||||
scene::ISceneNode *scene_node = irr_driver->addMesh(merged_mesh);
|
||||
//scene::IMeshSceneNode *scene_node = irr_driver->addOctTree(merged_mesh);
|
||||
// We should drop the merged mesh (since it's now referred to in the
|
||||
// scene node), but then we need to grab it since it's in the
|
||||
// m_all_cached_meshes.
|
||||
|
Loading…
Reference in New Issue
Block a user