本文整理汇总了C++中xr_vector::pop_back方法的典型用法代码示例。如果您正苦于以下问题:C++ xr_vector::pop_back方法的具体用法?C++ xr_vector::pop_back怎么用?C++ xr_vector::pop_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xr_vector
的用法示例。
在下文中一共展示了xr_vector::pop_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: float
virtual void Execute()
{
CDeflector* D = 0;
for (;;)
{
// Get task
task_CS.Enter ();
thProgress = 1.f - float(task_pool.size())/float(g_deflectors.size());
if (task_pool.empty())
{
task_CS.Leave ();
return;
}
D = g_deflectors[task_pool.back()];
task_pool.pop_back ();
task_CS.Leave ();
// Perform operation
try {
D->Light (&DB,&LightsSelected,H);
} catch (...)
{
clMsg("* ERROR: CLMThread::Execute - light");
}
}
}
示例2: CreateNode
BOOL ESceneAIMapTool::CreateNode(Fvector& vAt, SAINode& N, bool bIC)
{
// *** Query and cache polygons for ray-casting
Fvector PointUp; PointUp.set(vAt); PointUp.y += RCAST_Depth; SnapXZ (PointUp,m_Params.fPatchSize);
Fvector PointDown; PointDown.set(vAt); PointDown.y -= RCAST_Depth; SnapXZ (PointDown,m_Params.fPatchSize);
Fbox BB; BB.set (PointUp,PointUp); BB.grow(m_Params.fPatchSize/2); // box 1
Fbox B2; B2.set (PointDown,PointDown); B2.grow(m_Params.fPatchSize/2); // box 2
BB.merge (B2);
if (m_CFModel)
{
/*
for(u32 i=0; i<m_CFModel->get_tris_count(); ++i)
{
CDB::TRI* tri = (m_CFModel->get_tris()+i);
if(tri->material!=0)
Msg("non-default material");
}
*/
Scene->BoxQuery(PQ,BB,CDB::OPT_FULL_TEST,m_CFModel);
}else
Scene->BoxQuery(PQ,BB,CDB::OPT_FULL_TEST,GetSnapList());
DWORD dwCount = PQ.r_count();
if (dwCount==0){
// Log("chasm1");
return FALSE; // chasm?
}
// *** Transfer triangles and compute sector
// R_ASSERT(dwCount<RCAST_MaxTris);
static xr_vector<tri> tris; tris.reserve(RCAST_MaxTris); tris.clear();
for (DWORD i=0; i<dwCount; i++)
{
SPickQuery::SResult* R = PQ.r_begin()+i;
if (R->e_obj&&R->e_mesh)
{
CSurface* surf = R->e_mesh->GetSurfaceByFaceID(R->tag);
//. SGameMtl* mtl = GMLib.GetMaterialByID(surf->_GameMtl());
//. if (mtl->Flags.is(SGameMtl::flPassable))continue;
Shader_xrLC* c_sh = Device.ShaderXRLC.Get(surf->_ShaderXRLCName());
if (!c_sh->flags.bCollision) continue;
}
/*
if(m_CFModel)
{
u16 mtl_id = R->material;
if(std::find(m_ignored_materials.begin(), m_ignored_materials.end(), mtl_id) != m_ignored_materials.end() )
{
//. Msg("--ignore");
continue;
}
}
*/
tris.push_back (tri());
tri& D = tris.back();
Fvector* V = R->verts;
D.v[0] = &V[0];
D.v[1] = &V[1];
D.v[2] = &V[2];
D.N.mknormal(*D.v[0],*D.v[1],*D.v[2]);
if (D.N.y<=0) tris.pop_back ();
}
if (tris.size()==0){
// Log("chasm2");
return FALSE; // chasm?
}
static xr_vector<Fvector> points; points.reserve(RCAST_Total); points.clear();
static xr_vector<Fvector> normals; normals.reserve(RCAST_Total);normals.clear();
Fvector P,D; D.set(0,-1,0);
float coeff = 0.5f*m_Params.fPatchSize/float(RCAST_Count);
for (int x=-RCAST_Count; x<=RCAST_Count; x++)
{
P.x = vAt.x + coeff*float(x);
for (int z=-RCAST_Count; z<=RCAST_Count; z++) {
P.z = vAt.z + coeff*float(z);
P.y = vAt.y + 10.f;
float tri_min_range = flt_max;
int tri_selected = -1;
float range,u,v;
for (i=0; i<DWORD(tris.size()); i++){
if (ETOOLS::TestRayTriA(P,D,tris[i].v,u,v,range,false)){
if (range<tri_min_range){
tri_min_range = range;
tri_selected = i;
}
}
}
if (tri_selected>=0) {
P.y -= tri_min_range;
//.........这里部分代码省略.........
示例3: sizeof
void print_free_functions (lua_State *L, const luabind::object &object, LPCSTR header, const xr_string &indent)
{
u32 count = 0;
luabind::object::iterator I = object.begin();
luabind::object::iterator E = object.end();
for ( ; I != E; ++I) {
if ((*I).type() != LUA_TFUNCTION)
continue;
(*I).pushvalue();
luabind::detail::free_functions::function_rep* rep = 0;
if (lua_iscfunction(L, -1))
{
if (lua_getupvalue(L, -1, 2) != 0)
{
// check the magic number that identifies luabind's functions
if (lua_touserdata(L, -1) == (void*)0x1337)
{
if (lua_getupvalue(L, -2, 1) != 0)
{
if (!count)
FastMsg("\n%snamespace %s {",indent.c_str(),header);
++count;
rep = static_cast<luabind::detail::free_functions::function_rep*>(lua_touserdata(L, -1));
std::vector<luabind::detail::free_functions::overload_rep>::const_iterator i = rep->overloads().begin();
std::vector<luabind::detail::free_functions::overload_rep>::const_iterator e = rep->overloads().end();
for ( ; i != e; ++i) {
xr_string S;
(*i).get_signature(L,S);
FastMsg(" %sfunction %s%s;",indent.c_str(),rep->name(), process_signature(S).c_str());
}
lua_pop(L, 1);
}
}
lua_pop(L, 1);
}
}
lua_pop(L, 1);
}
{
static xr_vector<xr_string> nesting_path;
xr_string _indent = indent;
xr_string last_key = "?";
_indent.append (" ");
object.pushvalue();
int n_table = lua_gettop(L);
// Msg("# n_table = %d ", n_table);
lua_pushnil (L);
int save_top = lua_gettop(L);
// #pragma todo("alpet : при загруженной сохраненке здесь иногда происходит сбой invalid key to 'next', а потом креш в недрах Direct3D ")
while (lua_next(L, n_table) != 0) {
last_key = "~";
int key_type = lua_type(L, -2);
if (lua_type(L, -1) == LUA_TTABLE && key_type == LUA_TSTRING && lua_objlen(L, -2) > 0) {
last_key = lua_tostring(L, -2);
LPCSTR S = last_key.c_str();
MsgCB("~#CONTEXT: last_key = %s", S);
string_path script_name;
sprintf_s(script_name, sizeof(script_name) - 1, "%s.script", S);
if (nesting_path.size() == 0 && // скан глобального пространства имен
(last_key == "" || last_key == "config" || last_key == "package" || last_key == "jit" || last_key == "loaded" || last_key == "md_list" ||
FS.exist("$game_scripts$", script_name) )) // с дампом экспортируемых luabind вещей, возникают сбои!
{
Msg("! skipping namespace %s ", last_key.c_str());
lua_pop(L, 1);
continue;
}
if (xr_strcmp("_G", S)) {
luabind::object object(L);
object.set();
// if (!xr_strcmp("security", S)) { S = S; } /// wtf?
xr_string path_dump = "";
for (u32 ns = 0; ns < nesting_path.size(); ns++)
path_dump = path_dump + nesting_path.at(ns) + ".";
path_dump = path_dump + S;
Msg("#dumping namespace %s ", path_dump.c_str());
nesting_path.push_back(S);
u32 nest_level = nesting_path.size();
// если слишком много вложений или начали повторяться строки
if (nest_level < 2 &&
!(nest_level > 1 && nesting_path.at(0) == S)
)
{
print_free_functions(L, object, S, _indent);
}
else
{
// problem detected
Msg("! WARN: to many nested levels for export = %d, or self-reference detected ", nest_level);
FlushLog();
dumper->flush();
}
nesting_path.pop_back();
}
//.........这里部分代码省略.........