本文整理汇总了C++中G3D::AABox方法的典型用法代码示例。如果您正苦于以下问题:C++ G3D::AABox方法的具体用法?C++ G3D::AABox怎么用?C++ G3D::AABox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G3D
的用法示例。
在下文中一共展示了G3D::AABox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadGameObjectModelList
void LoadGameObjectModelList()
{
#ifndef NO_CORE_FUNCS
uint32 oldMSTime = getMSTime();
#endif
FILE* model_list_file = fopen((sWorld->GetDataPath() + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb");
if (!model_list_file)
{
VMAP_ERROR_LOG("misc", "Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS);
return;
}
uint32 name_length, displayId;
char buff[500];
while (true)
{
Vector3 v1, v2;
if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1)
if (feof(model_list_file)) // EOF flag is only set after failed reading attempt
break;
if (fread(&name_length, sizeof(uint32), 1, model_list_file) != 1
|| name_length >= sizeof(buff)
|| fread(&buff, sizeof(char), name_length, model_list_file) != name_length
|| fread(&v1, sizeof(Vector3), 1, model_list_file) != 1
|| fread(&v2, sizeof(Vector3), 1, model_list_file) != 1)
{
VMAP_ERROR_LOG("misc", "File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS);
break;
}
model_list.insert
(
ModelList::value_type( displayId, GameobjectModelData(std::string(buff, name_length), AABox(v1, v2)) )
);
}
fclose(model_list_file);
VMAP_INFO_LOG("server.loading", ">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime));
}
示例2: LoadGameObjectModelList
void LoadGameObjectModelList()
{
FILE* model_list_file = fopen((sWorld->GetDataPath() + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb");
if (!model_list_file)
return;
uint32 name_length, displayId;
char buff[500];
while (!feof(model_list_file))
{
fread(&displayId,sizeof(uint32),1,model_list_file);
fread(&name_length,sizeof(uint32),1,model_list_file);
if (name_length >= sizeof(buff))
{
printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS);
break;
}
fread(&buff, sizeof(char), name_length,model_list_file);
Vector3 v1, v2;
fread(&v1, sizeof(Vector3), 1, model_list_file);
fread(&v2, sizeof(Vector3), 1, model_list_file);
model_list.insert
(
ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) )
);
}
fclose(model_list_file);
}