m_view_bobbing_anim(0),
m_view_bobbing_state(0),
- m_view_bobbing_speed(0)
+ m_view_bobbing_speed(0),
+
+ m_digging_anim(0),
+ m_digging_speed(0)
{
//dstream<<__FUNCTION_NAME<<std::endl;
m_headnode = smgr->addEmptySceneNode(m_playernode);
m_cameranode = smgr->addCameraSceneNode(smgr->getRootSceneNode());
m_cameranode->bindTargetAndRotation(true);
- m_wieldnode = new ExtrudedSpriteSceneNode(smgr->getRootSceneNode(), smgr, -1, v3f(0, 120, 10), v3f(0, 0, 0), v3f(100, 100, 100));
- //m_wieldnode = new ExtrudedSpriteSceneNode(smgr->getRootSceneNode(), smgr, -1);
+ m_wieldnode = new ExtrudedSpriteSceneNode(m_headnode, smgr, -1, v3f(1.3, -1, 2), v3f(-20, -100, 20), v3f(1));
updateSettings();
}
// A block-type material
MaterialItem* mat_item = (MaterialItem*) item;
content_t content = mat_item->getMaterial();
- if (content_features(content).solidness)
+ if (content_features(content).solidness || content_features(content).visual_solidness)
{
m_wieldnode->setCube(content_features(content).tiles);
+ m_wieldnode->setScale(v3f(0.9));
isCube = true;
}
}
if (!isCube)
{
m_wieldnode->setSprite(item->getImageRaw());
+ m_wieldnode->setScale(v3f(1.2));
}
m_wieldnode->setVisible(true);
for (int i = 0; i < 6; ++i)
{
// Get the tile texture and atlas transformation
- u32 texture_id = tiles[i].texture.id;
- video::ITexture* atlas = NULL;
- v2f pos(0,0);
- v2f size(1,1);
- if (g_texturesource)
- {
- AtlasPointer ap = g_texturesource->getTexture(texture_id);
- atlas = ap.atlas;
- pos = ap.pos;
- size = ap.size;
- }
+ video::ITexture* atlas = tiles[i].texture.atlas;
+ v2f pos = tiles[i].texture.pos;
+ v2f size = tiles[i].texture.size;
// Set material flags and texture
video::SMaterial& material = m_meshnode->getMaterial(i);
s32 m_view_bobbing_state;
// Speed of view bobbing animation
f32 m_view_bobbing_speed;
+
+ // Digging animation
+ s32 m_digging_anim;
+ // Speed of digging animation
+ s32 m_digging_speed;
};
s32 id = -1,
const v3f& position = v3f(0,0,0),
const v3f& rotation = v3f(0,0,0),
- const v3f& scale = v3f(0,0,0));
+ const v3f& scale = v3f(1,1,1));
~ExtrudedSpriteSceneNode();
void setSprite(video::ITexture* texture);
if(new_style_leaves)
{
f->solidness = 0; // drawn separately, makes no faces
+ f->visual_solidness = 1;
+ f->setAllTextures("leaves.png");
f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png");
}
else
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
+ f->visual_solidness = 1;
+ f->setAllTextures("glass.png");
f->setInventoryTextureCube("glass.png", "glass.png", "glass.png");
setWoodLikeDiggingProperties(f->digging_properties, 0.15);