aboutsummaryrefslogtreecommitdiff
path: root/advtrains_train_track/models
ModeNameSize
-rw-r--r--advtrains_dtrack_bumper_st.b3d32927logplain
-rw-r--r--advtrains_dtrack_bumper_st_30.b3d48546logplain
-rw-r--r--advtrains_dtrack_bumper_st_45.b3d32926logplain
-rw-r--r--advtrains_dtrack_bumper_st_60.b3d48546logplain
-rw-r--r--advtrains_dtrack_cr.b3d28040logplain
-rw-r--r--advtrains_dtrack_cr_30.b3d28043logplain
-rw-r--r--advtrains_dtrack_cr_45.b3d34483logplain
-rw-r--r--advtrains_dtrack_cr_60.b3d34483logplain
-rw-r--r--advtrains_dtrack_s3_l.obj68938logplain
-rw-r--r--advtrains_dtrack_s3_l_30.obj55359logplain
-rw-r--r--advtrains_dtrack_s3_l_45.obj80374logplain
-rw-r--r--advtrains_dtrack_s3_l_60.obj55526logplain
-rw-r--r--advtrains_dtrack_s3_r.obj68935logplain
-rw-r--r--advtrains_dtrack_s3_r_30.obj55534logplain
-rw-r--r--advtrains_dtrack_s3_r_45.obj80390logplain
-rw-r--r--advtrains_dtrack_s3_r_60.obj55451logplain
-rw-r--r--advtrains_dtrack_s3_s.obj69013logplain
-rw-r--r--advtrains_dtrack_s3_s_30.obj55472logplain
-rw-r--r--advtrains_dtrack_s3_s_45.obj80327logplain
-rw-r--r--advtrains_dtrack_s3_s_60.obj55565logplain
-rw-r--r--advtrains_dtrack_st.b3d10712logplain
-rw-r--r--advtrains_dtrack_st_30.b3d20043logplain
-rw-r--r--advtrains_dtrack_st_45.b3d12235logplain
-rw-r--r--advtrains_dtrack_st_60.b3d20043logplain
-rw-r--r--advtrains_dtrack_swlcr.b3d36203logplain
-rw-r--r--advtrains_dtrack_swlcr_30.b3d39958logplain
-rw-r--r--advtrains_dtrack_swlcr_45.b3d41302logplain
-rw-r--r--advtrains_dtrack_swlcr_60.b3d46270logplain
-rw-r--r--advtrains_dtrack_swlst.b3d36203logplain
-rw-r--r--advtrains_dtrack_swlst_30.b3d39958logplain
-rw-r--r--advtrains_dtrack_swlst_45.b3d41302logplain
-rw-r--r--advtrains_dtrack_swlst_60.b3d46270logplain
-rw-r--r--advtrains_dtrack_swrcr.b3d36203logplain
-rw-r--r--advtrains_dtrack_swrcr_30.b3d46270logplain
-rw-r--r--advtrains_dtrack_swrcr_45.b3d41302logplain
-rw-r--r--advtrains_dtrack_swrcr_60.b3d39958logplain
-rw-r--r--advtrains_dtrack_swrst.b3d36203logplain
-rw-r--r--advtrains_dtrack_swrst_30.b3d46270logplain
-rw-r--r--advtrains_dtrack_swrst_45.b3d41302logplain
-rw-r--r--advtrains_dtrack_swrst_60.b3d39958logplain
-rw-r--r--advtrains_dtrack_sy_l.obj57232logplain
-rw-r--r--advtrains_dtrack_sy_l_30.obj41543logplain
-rw-r--r--advtrains_dtrack_sy_l_45.obj60312logplain
-rw-r--r--advtrains_dtrack_sy_l_60.obj40921logplain
-rw-r--r--advtrains_dtrack_sy_r.obj57056logplain
-rw-r--r--advtrains_dtrack_sy_r_30.obj41250logplain
-rw-r--r--advtrains_dtrack_sy_r_45.obj60419logplain
-rw-r--r--advtrains_dtrack_sy_r_60.obj41371logplain
-rw-r--r--advtrains_dtrack_vst1.obj8757logplain
-rw-r--r--advtrains_dtrack_vst1_45.obj10989logplain
-rw-r--r--advtrains_dtrack_vst2.obj9247logplain
-rw-r--r--advtrains_dtrack_vst2_45.obj11669logplain
-rw-r--r--advtrains_dtrack_vst31.obj8782logplain
-rw-r--r--advtrains_dtrack_vst32.obj9294logplain
-rw-r--r--advtrains_dtrack_vst33.obj9684logplain
-rw-r--r--advtrains_dtrack_xing4590_st.obj62131logplain
-rw-r--r--advtrains_dtrack_xing90plusx_30l.obj68085logplain
-rw-r--r--advtrains_dtrack_xing90plusx_30r.obj67039logplain
-rw-r--r--advtrains_dtrack_xing90plusx_45l.obj44540logplain
-rw-r--r--advtrains_dtrack_xing90plusx_45r.obj43597logplain
-rw-r--r--advtrains_dtrack_xing90plusx_60l.obj64979logplain
-rw-r--r--advtrains_dtrack_xing90plusx_60r.obj63643logplain
-rw-r--r--advtrains_dtrack_xing_st.obj140939logplain
-rw-r--r--advtrains_dtrack_xing_st_30.obj99140logplain
-rw-r--r--advtrains_dtrack_xing_st_45.obj90209logplain
-rw-r--r--advtrains_dtrack_xing_st_60.obj99353logplain
-rw-r--r--advtrains_dtrack_xingdiag_30l45r.obj65469logplain
-rw-r--r--advtrains_dtrack_xingdiag_30r45l.obj64072logplain
-rw-r--r--advtrains_dtrack_xingdiag_60l30l.obj73436logplain
-rw-r--r--advtrains_dtrack_xingdiag_60l30r.obj73436logplain
-rw-r--r--advtrains_dtrack_xingdiag_60l45r.obj62908logplain
-rw-r--r--advtrains_dtrack_xingdiag_60l60r.obj63876logplain
-rw-r--r--advtrains_dtrack_xingdiag_60r-46l.obj60657logplain
-rw-r--r--advtrains_dtrack_xingdiag_60r30l.obj72384logplain
-rw-r--r--advtrains_dtrack_xingdiag_60r30r.obj72384logplain
-rw-r--r--advtrains_dtrack_xingdiag_60r45l.obj62941logplain
-rw-r--r--advtrains_track_cr.b3d8023logplain
-rw-r--r--advtrains_track_st.b3d15831logplain
-rw-r--r--advtrains_track_st_45.b3d8935logplain
n class="hl opt">(1.0, 1.0, 1.0)); } // Destructor virtual ~ExtrusionMeshCache() { for (auto &extrusion_meshe : m_extrusion_meshes) { extrusion_meshe.second->drop(); } m_cube->drop(); } // Get closest extrusion mesh for given image dimensions // Caller must drop the returned pointer scene::IMesh* create(core::dimension2d<u32> dim) { // handle non-power of two textures inefficiently without cache if (!is_power_of_two(dim.Width) || !is_power_of_two(dim.Height)) { return createExtrusionMesh(dim.Width, dim.Height); } int maxdim = MYMAX(dim.Width, dim.Height); std::map<int, scene::IMesh*>::iterator it = m_extrusion_meshes.lower_bound(maxdim); if (it == m_extrusion_meshes.end()) { // no viable resolution found; use largest one it = m_extrusion_meshes.find(MAX_EXTRUSION_MESH_RESOLUTION); sanity_check(it != m_extrusion_meshes.end()); } scene::IMesh *mesh = it->second; mesh->grab(); return mesh; } // Returns a 1x1x1 cube mesh with one meshbuffer (material) per face // Caller must drop the returned pointer scene::IMesh* createCube() { m_cube->grab(); return m_cube; } private: std::map<int, scene::IMesh*> m_extrusion_meshes; scene::IMesh *m_cube; }; ExtrusionMeshCache *g_extrusion_mesh_cache = NULL; WieldMeshSceneNode::WieldMeshSceneNode(scene::ISceneManager *mgr, s32 id, bool lighting): scene::ISceneNode(mgr->getRootSceneNode(), mgr, id), m_material_type(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF), m_lighting(lighting) { m_enable_shaders = g_settings->getBool("enable_shaders"); m_anisotropic_filter = g_settings->getBool("anisotropic_filter"); m_bilinear_filter = g_settings->getBool("bilinear_filter"); m_trilinear_filter = g_settings->getBool("trilinear_filter"); // If this is the first wield mesh scene node, create a cache // for extrusion meshes (and a cube mesh), otherwise reuse it if (!g_extrusion_mesh_cache) g_extrusion_mesh_cache = new ExtrusionMeshCache(); else g_extrusion_mesh_cache->grab(); // Disable bounding box culling for this scene node // since we won't calculate the bounding box. setAutomaticCulling(scene::EAC_OFF); // Create the child scene node scene::IMesh *dummymesh = g_extrusion_mesh_cache->createCube(); m_meshnode = SceneManager->addMeshSceneNode(dummymesh, this, -1); m_meshnode->setReadOnlyMaterials(false); m_meshnode->setVisible(false); dummymesh->drop(); // m_meshnode grabbed it m_shadow = RenderingEngine::get_shadow_renderer(); } WieldMeshSceneNode::~WieldMeshSceneNode() { sanity_check(g_extrusion_mesh_cache); // Remove node from shadow casters. m_shadow might be an invalid pointer! if (auto shadow = RenderingEngine::get_shadow_renderer()) shadow->removeNodeFromShadowList(m_meshnode); if (g_extrusion_mesh_cache->drop()) g_extrusion_mesh_cache = nullptr; } void WieldMeshSceneNode::setCube(const ContentFeatures &f, v3f wield_scale) { scene::IMesh *cubemesh = g_extrusion_mesh_cache->createCube(); scene::SMesh *copy = cloneMesh(cubemesh); cubemesh->drop(); postProcessNodeMesh(copy, f, false, true, &m_material_type, &m_colors, true); changeToMesh(copy); copy->drop(); m_meshnode->setScale(wield_scale * WIELD_SCALE_FACTOR); } void WieldMeshSceneNode::setExtruded(const std::string &imagename, const std::string &overlay_name, v3f wield_scale, ITextureSource *tsrc, u8 num_frames) { video::ITexture *texture = tsrc->getTexture(imagename); if (!texture) { changeToMesh(nullptr); return; } video::ITexture *overlay_texture = overlay_name.empty() ? NULL : tsrc->getTexture(overlay_name); core::dimension2d<u32> dim = texture->getSize(); // Detect animation texture and pull off top frame instead of using entire thing if (num_frames > 1) { u32 frame_height = dim.Height / num_frames; dim = core::dimension2d<u32>(dim.Width, frame_height); } scene::IMesh *original = g_extrusion_mesh_cache->create(dim); scene::SMesh *mesh = cloneMesh(original); original->drop(); //set texture mesh->getMeshBuffer(0)->getMaterial().setTexture(0, tsrc->getTexture(imagename)); if (overlay_texture) { scene::IMeshBuffer *copy = cloneMeshBuffer(mesh->getMeshBuffer(0)); copy->getMaterial().setTexture(0, overlay_texture); mesh->addMeshBuffer(copy); copy->drop(); } changeToMesh(mesh); mesh->drop(); m_meshnode->setScale(wield_scale * WIELD_SCALE_FACTOR_EXTRUDED); // Customize materials for (u32 layer = 0; layer < m_meshnode->getMaterialCount(); layer++) { video::SMaterial &material = m_meshnode->getMaterial(layer); material.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE;