public:
TestCAO(IGameDef *gamedef, ClientEnvironment *env);
virtual ~TestCAO();
-
+
ActiveObjectType getType() const
{
return ACTIVEOBJECT_TYPE_TEST;
}
-
+
static ClientActiveObject* create(IGameDef *gamedef, ClientEnvironment *env);
void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
{
if(m_node != NULL)
return;
-
+
//video::IVideoDriver* driver = smgr->getVideoDriver();
-
+
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
video::SColor c(255,255,255,255);
public:
ItemCAO(IGameDef *gamedef, ClientEnvironment *env);
virtual ~ItemCAO();
-
+
ActiveObjectType getType() const
{
return ACTIVEOBJECT_TYPE_ITEM;
}
-
+
static ClientActiveObject* create(IGameDef *gamedef, ClientEnvironment *env);
void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
void processMessage(const std::string &data);
void initialize(const std::string &data);
-
+
core::aabbox3d<f32>* getSelectionBox()
{return &m_selection_box;}
v3f getPosition()
{return m_position;}
-
+
std::string infoText()
{return m_infotext;}
{
if(m_node != NULL)
return;
-
+
//video::IVideoDriver* driver = smgr->getVideoDriver();
-
+
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
video::SColor c(255,255,255,255);
<<": error deSerializing itemstring \""
<<m_itemstring<<std::endl;
}
-
+
// Set meshbuffer texture
m_node->getMaterial(0).setTexture(0, texture);
}
void ItemCAO::initialize(const std::string &data)
{
infostream<<"ItemCAO: Got init data"<<std::endl;
-
+
{
std::istringstream is(data, std::ios::binary);
// version
// itemstring
m_itemstring = deSerializeString(is);
}
-
+
updateNodePos();
updateInfoText();
}
void GenericCAO::removeFromScene(bool permanent)
{
// Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
- if((m_env != NULL) && (permanent))
+ if((m_env != NULL) && (permanent))
{
for(std::vector<u16>::iterator ci = m_children.begin();
ci != m_children.end(); ci++)
}
m_env->m_attachements[getId()] = 0;
-
+
LocalPlayer* player = m_env->getLocalPlayer();
if (this == player->parent) {
player->parent = NULL;
m_meshnode = smgr->addMeshSceneNode(mesh, NULL);
m_meshnode->grab();
mesh->drop();
-
+
m_meshnode->setScale(v3f(m_prop.visual_size.X,
m_prop.visual_size.Y,
m_prop.visual_size.X));
}
}
}
-
+
void GenericCAO::step(float dtime, ClientEnvironment *env)
{
// Handel model of local player instantly to prevent lags
}
}
}
-
+
void GenericCAO::updateAttachments()
{
m_armor_groups[name] = rating;
}
} else if (cmd == GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES) {
- u8 version = readU8(is); // forward compatibility
+ //u8 version = readU8(is); // forward compatibility
m_nametag_color = readARGB8(is);
if (m_textnode != NULL) {
m_textnode->setTextColor(m_nametag_color);
}
}
}
-
+
/* \pre punchitem != NULL
*/
bool GenericCAO::directReportPunch(v3f dir, const ItemStack *punchitem,
int seed)
{
float v00, v01, v10, v11, u, v, orig_u;
- int index, i, j, x0, y0, noisex, noisey;
- int nlx, nly;
+ u32 index, i, j, x0, y0, noisex, noisey;
+ u32 nlx, nly;
bool eased = np.flags & (NOISE_FLAG_DEFAULTS | NOISE_FLAG_EASED);
Interp2dFxn interpolate = eased ?
orig_u = u;
//calculate noise point lattice
- nlx = (int)(u + sx * step_x) + 2;
- nly = (int)(v + sy * step_y) + 2;
+ nlx = (u32)(u + sx * step_x) + 2;
+ nly = (u32)(v + sy * step_y) + 2;
index = 0;
for (j = 0; j != nly; j++)
for (i = 0; i != nlx; i++)
float v000, v010, v100, v110;
float v001, v011, v101, v111;
float u, v, w, orig_u, orig_v;
- int index, i, j, k, x0, y0, z0, noisex, noisey, noisez;
- int nlx, nly, nlz;
+ u32 index, i, j, k, x0, y0, z0, noisex, noisey, noisez;
+ u32 nlx, nly, nlz;
Interp3dFxn interpolate = (np.flags & NOISE_FLAG_EASED) ?
triLinearInterpolation : triLinearInterpolationNoEase;
orig_v = v;
//calculate noise point lattice
- nlx = (int)(u + sx * step_x) + 2;
- nly = (int)(v + sy * step_y) + 2;
- nlz = (int)(w + sz * step_z) + 2;
+ nlx = (u32)(u + sx * step_x) + 2;
+ nly = (u32)(v + sy * step_y) + 2;
+ nlz = (u32)(w + sz * step_z) + 2;
index = 0;
for (k = 0; k != nlz; k++)
for (j = 0; j != nly; j++)