Add debug name to meshes and mesh buffers, helps debugging
This commit is contained in:
parent
759182bb68
commit
047c6fc760
@ -578,7 +578,8 @@ void IrrDriver::initDevice()
|
||||
mb->getMaterial().setTexture(0, getUnicolorTexture(video::SColor(255, 255, 255, 255)));
|
||||
mb->getMaterial().setTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
|
||||
}
|
||||
m_sun_interposer = new STKMeshSceneNode(sphere, m_scene_manager->getRootSceneNode(), NULL, -1);
|
||||
m_sun_interposer = new STKMeshSceneNode(sphere, m_scene_manager->getRootSceneNode(), NULL, -1, "sun_interposer");
|
||||
|
||||
m_sun_interposer->grab();
|
||||
m_sun_interposer->setParent(NULL);
|
||||
m_sun_interposer->setScale(core::vector3df(20));
|
||||
@ -1077,6 +1078,7 @@ scene::IParticleSystemSceneNode *IrrDriver::addParticleNode(bool default_emitter
|
||||
* \param mesh The mesh to add.
|
||||
*/
|
||||
scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
|
||||
const std::string& debug_name,
|
||||
scene::ISceneNode *parent)
|
||||
{
|
||||
if (!isGLSL())
|
||||
@ -1085,7 +1087,7 @@ scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
|
||||
if (!parent)
|
||||
parent = m_scene_manager->getRootSceneNode();
|
||||
|
||||
scene::IMeshSceneNode* node = new STKMeshSceneNode(mesh, parent, m_scene_manager, -1);
|
||||
scene::IMeshSceneNode* node = new STKMeshSceneNode(mesh, parent, m_scene_manager, -1, debug_name);
|
||||
node->drop();
|
||||
|
||||
return node;
|
||||
@ -1261,21 +1263,25 @@ void IrrDriver::removeTexture(video::ITexture *t)
|
||||
/** Adds an animated mesh to the scene.
|
||||
* \param mesh The animated mesh to add.
|
||||
*/
|
||||
scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *mesh, scene::ISceneNode* parent)
|
||||
scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *mesh,
|
||||
const std::string& debug_name, scene::ISceneNode* parent)
|
||||
{
|
||||
if (!isGLSL())
|
||||
{
|
||||
return m_scene_manager->addAnimatedMeshSceneNode(mesh, parent, -1,
|
||||
core::vector3df(0,0,0),
|
||||
core::vector3df(0,0,0),
|
||||
core::vector3df(1,1,1),
|
||||
/*addIfMeshIsZero*/true);
|
||||
core::vector3df(0, 0, 0),
|
||||
core::vector3df(0, 0, 0),
|
||||
core::vector3df(1, 1, 1),
|
||||
/*addIfMeshIsZero*/true);
|
||||
}
|
||||
|
||||
if (!parent)
|
||||
parent = m_scene_manager->getRootSceneNode();
|
||||
scene::IAnimatedMeshSceneNode* node =
|
||||
new STKAnimatedMesh(mesh, parent, m_scene_manager, -1, core::vector3df(0,0,0), core::vector3df(0,0,0), core::vector3df(1,1,1));
|
||||
node->drop();
|
||||
return node;
|
||||
if (!parent)
|
||||
parent = m_scene_manager->getRootSceneNode();
|
||||
scene::IAnimatedMeshSceneNode* node =
|
||||
new STKAnimatedMesh(mesh, parent, m_scene_manager, -1, debug_name,
|
||||
core::vector3df(0, 0, 0), core::vector3df(0, 0, 0), core::vector3df(1, 1, 1));
|
||||
node->drop();
|
||||
return node;
|
||||
} // addAnimatedMesh
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -453,6 +453,7 @@ public:
|
||||
scene::IMeshSceneNode*addSphere(float radius,
|
||||
const video::SColor &color=video::SColor(128, 255, 255, 255));
|
||||
scene::IMeshSceneNode*addMesh(scene::IMesh *mesh,
|
||||
const std::string& debug_name,
|
||||
scene::ISceneNode *parent=NULL);
|
||||
PerCameraNode *addPerCameraNode(scene::ISceneNode* node,
|
||||
scene::ICameraSceneNode* cam,
|
||||
@ -473,7 +474,7 @@ public:
|
||||
void removeMeshFromCache(scene::IMesh *mesh);
|
||||
void removeTexture(video::ITexture *t);
|
||||
scene::IAnimatedMeshSceneNode
|
||||
*addAnimatedMesh(scene::IAnimatedMesh *mesh, scene::ISceneNode* parent=NULL);
|
||||
*addAnimatedMesh(scene::IAnimatedMesh *mesh, const std::string& debug_name, scene::ISceneNode* parent = NULL);
|
||||
scene::ICameraSceneNode
|
||||
*addCameraSceneNode();
|
||||
Camera *addCamera(unsigned int index, AbstractKart *kart);
|
||||
|
@ -139,7 +139,7 @@ Referee::Referee()
|
||||
// mesh. ATM it doesn't make any difference, but if we ever should
|
||||
// decide to use more than one referee model at startup we only
|
||||
// have to change the textures once, and all models will be in synch.
|
||||
m_scene_node = irr_driver->addAnimatedMesh(NULL);
|
||||
m_scene_node = irr_driver->addAnimatedMesh(NULL, "referee");
|
||||
m_scene_node->setReadOnlyMaterials(true);
|
||||
m_scene_node->setMesh(m_st_referee_mesh);
|
||||
m_scene_node->grab();
|
||||
@ -175,7 +175,7 @@ Referee::Referee(const AbstractKart &kart)
|
||||
// mesh. ATM it doesn't make any difference, but if we ever should
|
||||
// decide to use more than one referee model at startup we only
|
||||
// have to change the textures once, and all models will be in synch.
|
||||
m_scene_node = irr_driver->addAnimatedMesh(NULL);
|
||||
m_scene_node = irr_driver->addAnimatedMesh(NULL, "referee");
|
||||
m_scene_node->setReadOnlyMaterials(true);
|
||||
m_scene_node->setMesh(m_st_referee_mesh);
|
||||
m_scene_node->grab();
|
||||
|
@ -50,7 +50,7 @@ Shadow::Shadow(video::ITexture *texture, scene::ISceneNode *node,
|
||||
v[3].Normal = normal;
|
||||
buffer->recalculateBoundingBox();
|
||||
|
||||
m_node = irr_driver->addMesh(m_mesh);
|
||||
m_node = irr_driver->addMesh(m_mesh, "shadow");
|
||||
#ifdef DEBUG
|
||||
m_node->setName("shadow");
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ ShowCurve::ShowCurve(float width, float height,
|
||||
{
|
||||
m_color = color;
|
||||
addEmptyMesh();
|
||||
m_scene_node = irr_driver->addMesh(m_mesh);
|
||||
m_scene_node = irr_driver->addMesh(m_mesh, "showcurve");
|
||||
// After addMesh ref count is 1 (for the attachment to the
|
||||
// scene). We keep a copy here, so increase the ref count.
|
||||
m_scene_node->grab();
|
||||
|
@ -190,7 +190,7 @@ void SkidMarks::update(float dt, bool force_skid_marks,
|
||||
new SkidMarkQuads(raycast_right-delta, raycast_right+delta,
|
||||
m_material, m_avoid_z_fighting, custom_color);
|
||||
new_mesh->addMeshBuffer(smq_right);
|
||||
scene::IMeshSceneNode *new_node = irr_driver->addMesh(new_mesh);
|
||||
scene::IMeshSceneNode *new_node = irr_driver->addMesh(new_mesh, "skidmark");
|
||||
if (STKMeshSceneNode* stkm = dynamic_cast<STKMeshSceneNode*>(new_node))
|
||||
stkm->setReloadEachFrame(true);
|
||||
#ifdef DEBUG
|
||||
|
@ -55,7 +55,7 @@ SlipStream::SlipStream(AbstractKart* kart) : MovingTexture(0, 0), m_kart(kart)
|
||||
m.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR;
|
||||
|
||||
createMesh(m);
|
||||
m_node = irr_driver->addMesh(m_mesh);
|
||||
m_node = irr_driver->addMesh(m_mesh, "splistream");
|
||||
m_mesh->drop();
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -101,7 +101,7 @@ SlipStream::SlipStream(AbstractKart* kart) : MovingTexture(0, 0), m_kart(kart)
|
||||
}
|
||||
buffer->recalculateBoundingBox();
|
||||
m_mesh->setBoundingBox(buffer->getBoundingBox());
|
||||
m_debug_node = irr_driver->addMesh(m_debug_mesh, m_kart->getNode());
|
||||
m_debug_node = irr_driver->addMesh(m_debug_mesh, "splistream_debug", m_kart->getNode());
|
||||
m_debug_node->grab();
|
||||
}
|
||||
else
|
||||
|
@ -20,7 +20,7 @@ STKTextBillboard::STKTextBillboard(core::stringw text, gui::ScalableFont* font,
|
||||
irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
const irr::core::vector3df& position, const irr::core::vector3df& size) :
|
||||
STKMeshSceneNode(new scene::SMesh(),
|
||||
parent, irr_driver->getSceneManager(), -1,
|
||||
parent, irr_driver->getSceneManager(), -1, "text_billboard",
|
||||
position, core::vector3df(0.0f, 0.0f, 0.0f), size, false)
|
||||
{
|
||||
m_color_top = color_top;
|
||||
|
@ -15,7 +15,7 @@
|
||||
using namespace irr;
|
||||
|
||||
STKAnimatedMesh::STKAnimatedMesh(irr::scene::IAnimatedMesh* mesh, irr::scene::ISceneNode* parent,
|
||||
irr::scene::ISceneManager* mgr, s32 id,
|
||||
irr::scene::ISceneManager* mgr, s32 id, const std::string& debug_name,
|
||||
const core::vector3df& position,
|
||||
const core::vector3df& rotation,
|
||||
const core::vector3df& scale) :
|
||||
@ -23,6 +23,9 @@ const core::vector3df& scale) :
|
||||
{
|
||||
isGLInitialized = false;
|
||||
isMaterialInitialized = false;
|
||||
#ifdef DEBUG
|
||||
m_debug_name = debug_name;
|
||||
#endif
|
||||
}
|
||||
|
||||
STKAnimatedMesh::~STKAnimatedMesh()
|
||||
@ -77,7 +80,7 @@ void STKAnimatedMesh::updateNoGL()
|
||||
for (u32 i = 0; i < m->getMeshBufferCount(); ++i)
|
||||
{
|
||||
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
|
||||
GLmeshes.push_back(allocateMeshBuffer(mb));
|
||||
GLmeshes.push_back(allocateMeshBuffer(mb, m_debug_name));
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < m->getMeshBufferCount(); ++i)
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
virtual void updateNoGL();
|
||||
virtual void updateGL();
|
||||
STKAnimatedMesh(irr::scene::IAnimatedMesh* mesh, irr::scene::ISceneNode* parent,
|
||||
irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
irr::scene::ISceneManager* mgr, irr::s32 id, const std::string& debug_name,
|
||||
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));
|
||||
|
@ -121,13 +121,17 @@ GLuint createVAO(GLuint vbo, GLuint idx, video::E_VERTEX_TYPE type)
|
||||
return vao;
|
||||
}
|
||||
|
||||
GLMesh allocateMeshBuffer(scene::IMeshBuffer* mb)
|
||||
GLMesh allocateMeshBuffer(scene::IMeshBuffer* mb, const std::string& debug_name)
|
||||
{
|
||||
GLMesh result = {};
|
||||
if (!mb)
|
||||
return result;
|
||||
result.mb = mb;
|
||||
|
||||
#ifdef DEBUG
|
||||
result.debug_name = debug_name;
|
||||
#endif
|
||||
|
||||
result.IndexCount = mb->getIndexCount();
|
||||
switch (mb->getIndexType())
|
||||
{
|
||||
|
@ -36,9 +36,12 @@ struct GLMesh {
|
||||
video::E_VERTEX_TYPE VAOType;
|
||||
uint64_t TextureHandles[6];
|
||||
scene::IMeshBuffer *mb;
|
||||
#ifdef DEBUG
|
||||
std::string debug_name;
|
||||
#endif
|
||||
};
|
||||
|
||||
GLMesh allocateMeshBuffer(scene::IMeshBuffer* mb);
|
||||
GLMesh allocateMeshBuffer(scene::IMeshBuffer* mb, const std::string& debug_name);
|
||||
void fillLocalBuffer(GLMesh &, scene::IMeshBuffer* mb);
|
||||
video::E_VERTEX_TYPE getVTXTYPEFromStride(size_t stride);
|
||||
GLuint createVAO(GLuint vbo, GLuint idx, video::E_VERTEX_TYPE type);
|
||||
@ -54,6 +57,8 @@ protected:
|
||||
bool m_culledForPlayerCam;
|
||||
bool m_culledForShadowCam[4];
|
||||
bool m_culledForRSMCam;
|
||||
std::string m_debug_name;
|
||||
|
||||
public:
|
||||
PtrVector<GLMesh, REF> MeshSolidMaterial[Material::SHADERTYPE_COUNT];
|
||||
PtrVector<GLMesh, REF> TransparentMesh[TM_COUNT];
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "utils/tuple.hpp"
|
||||
#include "utils/cpp2011.hpp"
|
||||
|
||||
STKMeshSceneNode::STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
STKMeshSceneNode::STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent, irr::scene::ISceneManager* mgr,
|
||||
irr::s32 id, const std::string& debug_name,
|
||||
const irr::core::vector3df& position,
|
||||
const irr::core::vector3df& rotation,
|
||||
const irr::core::vector3df& scale, bool createGLMeshes) :
|
||||
@ -25,6 +26,8 @@ STKMeshSceneNode::STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent,
|
||||
update_each_frame = false;
|
||||
isGlow = false;
|
||||
|
||||
m_debug_name = debug_name;
|
||||
|
||||
if (createGLMeshes)
|
||||
this->createGLMeshes();
|
||||
}
|
||||
@ -41,7 +44,7 @@ void STKMeshSceneNode::createGLMeshes()
|
||||
for (u32 i = 0; i<Mesh->getMeshBufferCount(); ++i)
|
||||
{
|
||||
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
|
||||
GLmeshes.push_back(allocateMeshBuffer(mb));
|
||||
GLmeshes.push_back(allocateMeshBuffer(mb, m_debug_name));
|
||||
}
|
||||
isMaterialInitialized = false;
|
||||
isGLInitialized = false;
|
||||
|
@ -29,7 +29,8 @@ public:
|
||||
virtual void updateNoGL();
|
||||
virtual void updateGL();
|
||||
void setReloadEachFrame(bool);
|
||||
STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
STKMeshSceneNode(irr::scene::IMesh* mesh, ISceneNode* parent, irr::scene::ISceneManager* mgr,
|
||||
irr::s32 id, const std::string& debug_name,
|
||||
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),
|
||||
|
@ -208,7 +208,7 @@ void ModelViewWidget::setupRTTScene(PtrVector<scene::IMesh, REF>& mesh,
|
||||
else
|
||||
{
|
||||
scene::IAnimatedMeshSceneNode* node =
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)mesh.get(0), NULL);
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)mesh.get(0), "rtt_mesh", NULL);
|
||||
node->setPosition(mesh_location[0].toIrrVector());
|
||||
node->setFrameLoop(model_frames[0], model_frames[0]);
|
||||
node->setAnimationSpeed(0);
|
||||
@ -228,7 +228,7 @@ void ModelViewWidget::setupRTTScene(PtrVector<scene::IMesh, REF>& mesh,
|
||||
if (model_frames[n] == -1)
|
||||
{
|
||||
scene::ISceneNode* node =
|
||||
irr_driver->addMesh(mesh.get(n), m_rtt_main_node);
|
||||
irr_driver->addMesh(mesh.get(n), "rtt_node", m_rtt_main_node);
|
||||
node->setPosition(mesh_location[n].toIrrVector());
|
||||
node->updateAbsolutePosition();
|
||||
node->setScale(mesh_scale[n].toIrrVector());
|
||||
@ -237,7 +237,7 @@ void ModelViewWidget::setupRTTScene(PtrVector<scene::IMesh, REF>& mesh,
|
||||
{
|
||||
scene::IAnimatedMeshSceneNode* node =
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)mesh.get(n),
|
||||
m_rtt_main_node);
|
||||
"modelviewrtt", m_rtt_main_node);
|
||||
node->setPosition(mesh_location[n].toIrrVector());
|
||||
node->setFrameLoop(model_frames[n], model_frames[n]);
|
||||
node->setAnimationSpeed(0);
|
||||
|
@ -59,7 +59,7 @@ Attachment::Attachment(AbstractKart* kart)
|
||||
// If we attach a NULL mesh, we get a NULL scene node back. So we
|
||||
// have to attach some kind of mesh, but make it invisible.
|
||||
m_node = irr_driver->addAnimatedMesh(
|
||||
attachment_manager->getMesh(Attachment::ATTACH_BOMB));
|
||||
attachment_manager->getMesh(Attachment::ATTACH_BOMB), "bomb");
|
||||
#ifdef DEBUG
|
||||
std::string debug_name = kart->getIdent()+" (attachment)";
|
||||
m_node->setName(debug_name.c_str());
|
||||
@ -113,7 +113,7 @@ void Attachment::set(AttachmentType type, float time,
|
||||
bomb_scene_node = m_node;
|
||||
|
||||
m_node = irr_driver->addAnimatedMesh(
|
||||
attachment_manager->getMesh(Attachment::ATTACH_BOMB));
|
||||
attachment_manager->getMesh(Attachment::ATTACH_BOMB), "bomb");
|
||||
#ifdef DEBUG
|
||||
std::string debug_name = m_kart->getIdent() + " (attachment)";
|
||||
m_node->setName(debug_name.c_str());
|
||||
|
@ -74,7 +74,7 @@ Flyable::Flyable(AbstractKart *kart, PowerupManager::PowerupType type,
|
||||
m_max_lifespan = -1;
|
||||
|
||||
// Add the graphical model
|
||||
setNode(irr_driver->addMesh(m_st_model[type]));
|
||||
setNode(irr_driver->addMesh(m_st_model[type], StringUtils::insertValues("flyable_%i", (int)type)));
|
||||
irr_driver->applyObjectPassShader(getNode());
|
||||
#ifdef DEBUG
|
||||
std::string debug_name("flyable: ");
|
||||
|
@ -48,12 +48,12 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
|
||||
LODNode* lodnode = new LODNode("item",
|
||||
irr_driver->getSceneManager()->getRootSceneNode(),
|
||||
irr_driver->getSceneManager());
|
||||
scene::IMeshSceneNode* meshnode = irr_driver->addMesh(mesh);
|
||||
scene::IMeshSceneNode* meshnode = irr_driver->addMesh(mesh, StringUtils::insertValues("item_%i", (int)type));
|
||||
|
||||
if (lowres_mesh != NULL)
|
||||
{
|
||||
lodnode->add(35, meshnode, true);
|
||||
scene::IMeshSceneNode* meshnode = irr_driver->addMesh(lowres_mesh);
|
||||
scene::IMeshSceneNode* meshnode = irr_driver->addMesh(lowres_mesh, StringUtils::insertValues("item_lo_%i", (int)type));
|
||||
lodnode->add(100, meshnode, true);
|
||||
}
|
||||
else
|
||||
|
@ -75,7 +75,7 @@ RubberBand::RubberBand(Plunger *plunger, AbstractKart *kart)
|
||||
// Gloss
|
||||
mb->getMaterial().setTexture(1, getUnicolorTexture(video::SColor(0, 0, 0, 0)));
|
||||
updatePosition();
|
||||
m_node = irr_driver->addMesh(m_mesh);
|
||||
m_node = irr_driver->addMesh(m_mesh, "rubberband");
|
||||
irr_driver->applyObjectPassShader(m_node);
|
||||
if (STKMeshSceneNode *stkm = dynamic_cast<STKMeshSceneNode *>(m_node))
|
||||
stkm->setReloadEachFrame(true);
|
||||
|
@ -336,7 +336,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
|
||||
irr_driver->getSceneManager() );
|
||||
|
||||
|
||||
node = irr_driver->addAnimatedMesh(m_mesh);
|
||||
node = irr_driver->addAnimatedMesh(m_mesh, "kartmesh");
|
||||
// as animated mesh are not cheap to render use frustum box culling
|
||||
if (irr_driver->isGLSL())
|
||||
node->setAutomaticCulling(scene::EAC_OFF);
|
||||
@ -407,17 +407,24 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
|
||||
scene::IMesh* main_frame = m_mesh->getMesh(straight_frame);
|
||||
main_frame->setHardwareMappingHint(scene::EHM_STATIC);
|
||||
|
||||
node = irr_driver->addMesh(main_frame);
|
||||
std::string debug_name;
|
||||
|
||||
#ifdef DEBUG
|
||||
debug_name = m_model_filename + " (kart-model)";
|
||||
#endif
|
||||
|
||||
node = irr_driver->addMesh(main_frame, debug_name);
|
||||
|
||||
#ifdef DEBUG
|
||||
std::string debug_name = m_model_filename+" (kart-model)";
|
||||
node->setName(debug_name.c_str());
|
||||
#endif
|
||||
|
||||
|
||||
// Attach the wheels
|
||||
for(unsigned int i=0; i<4; i++)
|
||||
{
|
||||
if(!m_wheel_model[i]) continue;
|
||||
m_wheel_node[i] = irr_driver->addMesh(m_wheel_model[i], node);
|
||||
m_wheel_node[i] = irr_driver->addMesh(m_wheel_model[i], "wheel", node);
|
||||
Vec3 wheel_min, wheel_max;
|
||||
MeshTools::minMax3D(m_wheel_model[i], &wheel_min, &wheel_max);
|
||||
m_wheel_graphics_radius[i] = 0.5f*(wheel_max.getY() - wheel_min.getY());
|
||||
@ -438,7 +445,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
|
||||
obj.m_node = NULL;
|
||||
if(obj.m_model)
|
||||
{
|
||||
obj.m_node = irr_driver->addAnimatedMesh(obj.m_model, node);
|
||||
obj.m_node = irr_driver->addAnimatedMesh(obj.m_model, "speedweighted", node);
|
||||
obj.m_node->grab();
|
||||
|
||||
obj.m_node->setFrameLoop(m_animation_frame[AF_SPEED_WEIGHTED_START], m_animation_frame[AF_SPEED_WEIGHTED_END]);
|
||||
@ -892,7 +899,7 @@ void KartModel::attachHat(){
|
||||
scene::IMesh *hat_mesh =
|
||||
irr_driver->getAnimatedMesh(
|
||||
file_manager->getAsset(FileManager::MODEL, m_hat_name));
|
||||
m_hat_node = irr_driver->addMesh(hat_mesh);
|
||||
m_hat_node = irr_driver->addMesh(hat_mesh, "hat");
|
||||
bone->addChild(m_hat_node);
|
||||
m_animated_node->setCurrentFrame((float)m_animation_frame[AF_STRAIGHT]);
|
||||
m_animated_node->OnAnimate(0);
|
||||
|
@ -144,13 +144,13 @@ void ThreeStrikesBattle::kartAdded(AbstractKart* kart, scene::ISceneNode* node)
|
||||
{
|
||||
float coord = -kart->getKartLength()*0.5f;
|
||||
|
||||
scene::IMeshSceneNode* tire_node = irr_driver->addMesh(m_tire, node);
|
||||
scene::IMeshSceneNode* tire_node = irr_driver->addMesh(m_tire, "3strikestire", node);
|
||||
tire_node->setPosition(core::vector3df(-0.16f, 0.3f, coord - 0.25f));
|
||||
tire_node->setScale(core::vector3df(0.4f, 0.4f, 0.4f));
|
||||
tire_node->setRotation(core::vector3df(90.0f, 0.0f, 0.0f));
|
||||
tire_node->setName("tire1");
|
||||
|
||||
tire_node = irr_driver->addMesh(m_tire, node);
|
||||
tire_node = irr_driver->addMesh(m_tire, "3strikestire", node);
|
||||
tire_node->setPosition(core::vector3df(0.16f, 0.3f, coord - 0.25f));
|
||||
tire_node->setScale(core::vector3df(0.4f, 0.4f, 0.4f));
|
||||
tire_node->setRotation(core::vector3df(90.0f, 0.0f, 0.0f));
|
||||
|
@ -286,7 +286,8 @@ void FeatureUnlockedCutScene::init()
|
||||
{
|
||||
if (m_unlocked_stuff[n].m_unlock_model.size() > 0)
|
||||
{
|
||||
m_unlocked_stuff[n].m_root_gift_node = irr_driver->addMesh( irr_driver->getMesh(m_unlocked_stuff[n].m_unlock_model) );
|
||||
m_unlocked_stuff[n].m_root_gift_node = irr_driver->addMesh(
|
||||
irr_driver->getMesh(m_unlocked_stuff[n].m_unlock_model), "unlocked_model");
|
||||
m_unlocked_stuff[n].m_scale = 0.7f;
|
||||
//m_unlocked_stuff[n].m_root_gift_node->setScale(core::vector3df(0.2f, 0.2f, 0.2f));
|
||||
}
|
||||
@ -336,13 +337,13 @@ void FeatureUnlockedCutScene::init()
|
||||
m_unlocked_stuff[n].m_w,
|
||||
m_unlocked_stuff[n].m_h);
|
||||
m_unlocked_stuff[n].m_root_gift_node = irr_driver->getSceneManager()->addEmptySceneNode();
|
||||
m_unlocked_stuff[n].m_side_1 = irr_driver->addMesh(mesh, m_unlocked_stuff[n].m_root_gift_node);
|
||||
m_unlocked_stuff[n].m_side_1 = irr_driver->addMesh(mesh, "unlocked_picture", m_unlocked_stuff[n].m_root_gift_node);
|
||||
//mesh->drop();
|
||||
|
||||
mesh = irr_driver->createTexturedQuadMesh(&m,
|
||||
m_unlocked_stuff[n].m_w,
|
||||
m_unlocked_stuff[n].m_h);
|
||||
m_unlocked_stuff[n].m_side_2 = irr_driver->addMesh(mesh, m_unlocked_stuff[n].m_root_gift_node);
|
||||
m_unlocked_stuff[n].m_side_2 = irr_driver->addMesh(mesh, "unlocked_picture", m_unlocked_stuff[n].m_root_gift_node);
|
||||
m_unlocked_stuff[n].m_side_2->setRotation(core::vector3df(0.0f, 180.0f, 0.0f));
|
||||
//mesh->drop();
|
||||
#ifdef DEBUG
|
||||
|
@ -99,7 +99,7 @@ CheckLine::CheckLine(const XMLNode &node, unsigned int index)
|
||||
}
|
||||
buffer->recalculateBoundingBox();
|
||||
mesh->setBoundingBox(buffer->getBoundingBox());
|
||||
m_debug_node = irr_driver->addMesh(mesh);
|
||||
m_debug_node = irr_driver->addMesh(mesh, "checkdebug");
|
||||
mesh->drop();
|
||||
}
|
||||
else
|
||||
|
@ -89,7 +89,7 @@ LODNode* ModelDefinitionLoader::instanciateAsLOD(const XMLNode* node, scene::ISc
|
||||
//cache.push_back(a_mesh);
|
||||
irr_driver->grabAllTextures(a_mesh);
|
||||
m_track->addCachedMesh(a_mesh);
|
||||
scene::IMeshSceneNode* scene_node = irr_driver->addMesh(a_mesh);
|
||||
scene::IMeshSceneNode* scene_node = irr_driver->addMesh(a_mesh, group[m].m_model_file);
|
||||
|
||||
m_track->handleAnimatedTextures( scene_node, *group[m].m_xml );
|
||||
|
||||
@ -135,4 +135,4 @@ void ModelDefinitionLoader::cleanLibraryNodesAfterLoad()
|
||||
file_manager->popTextureSearchPath();
|
||||
file_manager->popModelSearchPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ void QuadGraph::createDebugMesh()
|
||||
c.setBlue((i%2) ? 0 : 255);
|
||||
v[i].Color = c;
|
||||
}
|
||||
m_node = irr_driver->addMesh(m_mesh);
|
||||
m_node = irr_driver->addMesh(m_mesh, "quad_graph_debug");
|
||||
#ifdef DEBUG
|
||||
m_node->setName("track-debug-mesh");
|
||||
#endif
|
||||
@ -1006,7 +1006,7 @@ void QuadGraph::makeMiniMap(const core::dimension2du &dimension,
|
||||
/*track_color*/ &fill_color,
|
||||
/*lap line color*/ &red );
|
||||
|
||||
m_node = irr_driver->addMesh(m_mesh);
|
||||
m_node = irr_driver->addMesh(m_mesh, "mini_map");
|
||||
#ifdef DEBUG
|
||||
m_node->setName("minimap-mesh");
|
||||
#endif
|
||||
|
@ -999,7 +999,7 @@ 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(tangent_mesh);
|
||||
scene::ISceneNode *scene_node = irr_driver->addMesh(tangent_mesh, "track_main");
|
||||
//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
|
||||
@ -1213,7 +1213,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
|
||||
// create a node out of this mesh just for bullet; delete it after, normal maps are special
|
||||
// and require tangent meshes
|
||||
scene_node = irr_driver->addMesh(original_mesh);
|
||||
scene_node = irr_driver->addMesh(original_mesh, "original_mesh");
|
||||
|
||||
scene_node->setPosition(xyz);
|
||||
scene_node->setRotation(hpr);
|
||||
@ -1228,7 +1228,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
irr_driver->grabAllTextures(mesh);
|
||||
|
||||
m_all_cached_meshes.push_back(mesh);
|
||||
scene_node = irr_driver->addMesh(mesh);
|
||||
scene_node = irr_driver->addMesh(mesh, "original_mesh_with_tangents");
|
||||
scene_node->setPosition(xyz);
|
||||
scene_node->setRotation(hpr);
|
||||
scene_node->setScale(scale);
|
||||
@ -1276,7 +1276,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
m_all_cached_meshes.push_back(a_mesh);
|
||||
irr_driver->grabAllTextures(a_mesh);
|
||||
a_mesh->grab();
|
||||
scene_node = irr_driver->addMesh(a_mesh);
|
||||
scene_node = irr_driver->addMesh(a_mesh, model_name);
|
||||
scene_node->setPosition(xyz);
|
||||
scene_node->setRotation(hpr);
|
||||
scene_node->setScale(scale);
|
||||
@ -1532,7 +1532,7 @@ void Track::createWater(const XMLNode &node)
|
||||
}
|
||||
else
|
||||
{*/
|
||||
scene_node = irr_driver->addMesh(mesh);
|
||||
scene_node = irr_driver->addMesh(mesh, "water");
|
||||
//}
|
||||
|
||||
if(!mesh || !scene_node)
|
||||
|
@ -370,7 +370,7 @@ void TrackObjectPresentationMesh::init(const XMLNode* xml_node, scene::ISceneNod
|
||||
else if (animated)
|
||||
{
|
||||
scene::IAnimatedMeshSceneNode *node =
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)m_mesh, parent);
|
||||
irr_driver->addAnimatedMesh((scene::IAnimatedMesh*)m_mesh, m_model_file, parent);
|
||||
m_node = node;
|
||||
|
||||
m_frame_start = node->getStartFrame();
|
||||
@ -387,7 +387,7 @@ void TrackObjectPresentationMesh::init(const XMLNode* xml_node, scene::ISceneNod
|
||||
if (xml_node)
|
||||
xml_node->get("displacing", &displacing);
|
||||
|
||||
m_node = irr_driver->addMesh(m_mesh, parent);
|
||||
m_node = irr_driver->addMesh(m_mesh, m_model_file, parent);
|
||||
|
||||
STKMeshSceneNode* stkmesh = dynamic_cast<STKMeshSceneNode*>(m_node);
|
||||
if (displacing && stkmesh != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user