Made fences stick to anything

master
Joel Leclerc 2012-05-14 17:40:57 -06:00
parent 083d23d39d
commit e304ec13c4
2 changed files with 17 additions and 9 deletions

View File

@ -1342,7 +1342,8 @@ public:
//updateLegRot(dtime);
//updateNodePos();
}
else if(m_prop.visual == "cube"){
else if(m_prop.visual == "cube")
{
infostream<<"GenericCAO::addToScene(): cube"<<std::endl;
scene::IMesh *mesh = createCubeMesh(v3f(BS,BS,BS));
m_meshnode = smgr->addMeshSceneNode(mesh, NULL);
@ -1353,7 +1354,9 @@ public:
m_prop.visual_size.X));
u8 li = m_last_light;
setMeshColor(m_meshnode->getMesh(), video::SColor(255,li,li,li));
} else if(m_prop.visual == "wielditem"){
}
else if(m_prop.visual == "wielditem")
{
infostream<<"GenericCAO::addToScene(): node"<<std::endl;
infostream<<"textures: "<<m_prop.textures.size()<<std::endl;
if(m_prop.textures.size() >= 1){
@ -1362,7 +1365,7 @@ public:
ItemStack item(m_prop.textures[0], 1, 0, "", idef);
scene::IMesh *mesh = item.getDefinition(idef).wield_mesh;
m_meshnode = smgr->addMeshSceneNode(mesh, NULL);
m_meshnode->setScale(v3f(m_prop.visual_size.X/2,
m_prop.visual_size.Y/2,
m_prop.visual_size.X/2));
@ -1391,13 +1394,16 @@ public:
updateTextures("");
scene::ISceneNode *node = NULL;
if(m_spritenode){
if(m_spritenode)
{
node = m_spritenode;
}
else if(m_meshnode){
else if(m_meshnode)
{
node = m_meshnode;
}
if(m_is_player && !m_is_local_player && (m_head || node)){
if(m_is_player && !m_is_local_player && (m_head || node))
{
// Add a text node for showing the name
gui::IGUIEnvironment* gui = irr->getGUIEnvironment();
std::wstring wname = narrow_to_wide(m_name);

View File

@ -675,7 +675,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
};
v3f move_torch(0,0,0);
int xyrotation = 0;
int xyrotation = 180;
int yzrotation = 0;
for(s32 i=0; i<4; i++)
{
@ -880,7 +880,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
p2.X++;
MapNode n2 = data->m_vmanip.getNodeNoEx(blockpos_nodes + p2);
const ContentFeatures *f2 = &nodedef->get(n2);
if(f2->drawtype == NDT_FENCELIKE)
//if(f2->drawtype == NDT_FENCELIKE)
if(f2->walkable)
{
aabb3f bar(-bar_len+BS/2,-bar_rad+BS/4,-bar_rad,
bar_len+BS/2,bar_rad+BS/4,bar_rad);
@ -906,7 +907,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
p2.Z++;
n2 = data->m_vmanip.getNodeNoEx(blockpos_nodes + p2);
f2 = &nodedef->get(n2);
if(f2->drawtype == NDT_FENCELIKE)
//if(f2->drawtype == NDT_FENCELIKE)
if(f2->walkable)
{
aabb3f bar(-bar_rad,-bar_rad+BS/4,-bar_len+BS/2,
bar_rad,bar_rad+BS/4,bar_len+BS/2);