• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ R_ASSERT2函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中R_ASSERT2函数的典型用法代码示例。如果您正苦于以下问题:C++ R_ASSERT2函数的具体用法?C++ R_ASSERT2怎么用?C++ R_ASSERT2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了R_ASSERT2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PhDataUpdate

	virtual void PhDataUpdate(dReal step)
	{
		int num=dBodyGetNumJoints(m_body);
		for(int i=0;i<num;i++)
		{
			dJointID joint=dBodyGetJoint(m_body,i);
			if(dJointGetType(joint)==dJointTypeContact)
			{
				dJointFeedback* feedback=dJointGetFeedback(joint);
				R_ASSERT2(feedback,"Feedback was not set!!!");
				dxJoint* b_joint=(dxJoint*) joint;
				dBodyID other_body=b_joint->node[1].body;
				bool b_body_second=(b_joint->node[1].body==m_body);
				dReal* self_force=feedback->f1;
				dReal* self_torque=feedback->t1;
				dReal* othrers_force=feedback->f2;
				dReal* othrers_torque=feedback->t2;
				if(b_body_second)
				{
					other_body=b_joint->node[0].body;
					self_force=feedback->f2;
					self_torque=feedback->t2;
					othrers_force=feedback->f1;
					othrers_torque=feedback->t1;
				}

				save_max(m_max_force_self,_sqrt(dDOT( self_force,self_force)));
				save_max(m_max_torque_self,_sqrt(dDOT( self_torque,self_torque)));
				save_max(m_max_force_self_y,_abs(self_force[1]));
				save_max(m_max_force_self_sd,_sqrt(self_force[0]*self_force[0]+self_force[2]*self_force[2]));
				if(other_body)
				{
					dVector3 shoulder;dVectorSub(shoulder,dJointGetPositionContact(joint),dBodyGetPosition(other_body));
					dReal shoulder_lenght=_sqrt(dDOT(shoulder,shoulder));

					save_max(m_max_force_others,_sqrt(dDOT( othrers_force,othrers_force)));
					if(!fis_zero(shoulder_lenght)) 
						save_max(m_max_torque_others,_sqrt(dDOT( othrers_torque,othrers_torque))/shoulder_lenght);
				}
			}
		}
	}
开发者ID:2asoft,项目名称:xray,代码行数:42,代码来源:PHMovementDynamicActivate.cpp


示例2: ai

void CSE_ALifeInventoryBox::add_online	(const bool &update_registries)
{
	CSE_ALifeDynamicObjectVisual		*object = (this);

	NET_Packet					tNetPacket;
	ClientID					clientID;
	clientID.set				(object->alife().server().GetServerClient() ? object->alife().server().GetServerClient()->ID.value() : 0);

	ALife::OBJECT_IT			I = object->children.begin();
	ALife::OBJECT_IT			E = object->children.end();
	for ( ; I != E; ++I) {
		CSE_ALifeDynamicObject	*l_tpALifeDynamicObject = ai().alife().objects().object(*I);
		CSE_ALifeInventoryItem	*l_tpALifeInventoryItem = smart_cast<CSE_ALifeInventoryItem*>(l_tpALifeDynamicObject);
		R_ASSERT2				(l_tpALifeInventoryItem,"Non inventory item object has parent?!");
		l_tpALifeInventoryItem->base()->s_flags.or(M_SPAWN_UPDATE);
		CSE_Abstract			*l_tpAbstract = smart_cast<CSE_Abstract*>(l_tpALifeInventoryItem);
		object->alife().server().entity_Destroy(l_tpAbstract);

#ifdef DEBUG
//		if (psAI_Flags.test(aiALife))
//			Msg					("[LSS] Spawning item [%s][%s][%d]",l_tpALifeInventoryItem->base()->name_replace(),*l_tpALifeInventoryItem->base()->s_name,l_tpALifeDynamicObject->ID);
		Msg						(
			"[LSS][%d] Going online [%d][%s][%d] with parent [%d][%s] on '%s'",
			Device.dwFrame,
			Device.dwTimeGlobal,
			l_tpALifeInventoryItem->base()->name_replace(),
			l_tpALifeInventoryItem->base()->ID,
			ID,
			name_replace(),
			"*SERVER*"
		);
#endif

		l_tpALifeDynamicObject->o_Position		= object->o_Position;
		l_tpALifeDynamicObject->m_tNodeID		= object->m_tNodeID;
		object->alife().server().Process_spawn	(tNetPacket,clientID,FALSE,l_tpALifeInventoryItem->base());
		l_tpALifeDynamicObject->s_flags.and		(u16(-1) ^ M_SPAWN_UPDATE);
		l_tpALifeDynamicObject->m_bOnline		= true;
	}

	CSE_ALifeDynamicObjectVisual::add_online(update_registries);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:42,代码来源:alife_dynamic_object.cpp


示例3: R_ASSERT2

void CSE_ActorMP::UPDATE_Read	(NET_Packet &packet)
{
    flags						= 0;
    m_u16NumItems				= 1;
    velocity.set				(0.f,0.f,0.f);

    if (get_health() <= 0)
    {
        actor_mp_state_holder	tmp_state_holder;
        tmp_state_holder.read	(packet);
        return;
    }
    m_state_holder.read			(packet);
    R_ASSERT2(valid_pos(m_state_holder.state().position,phBoundaries), "read bad position");

    m_AliveState.quaternion		= m_state_holder.state().physics_quaternion;
    m_AliveState.angular_vel	= m_state_holder.state().physics_angular_velocity;
    m_AliveState.linear_vel		= m_state_holder.state().physics_linear_velocity;
    m_AliveState.force			= m_state_holder.state().physics_force;
    m_AliveState.torque			= m_state_holder.state().physics_torque;
    m_AliveState.position		= m_state_holder.state().physics_position;

    o_Position					= m_state_holder.state().position;

    accel						= m_state_holder.state().logic_acceleration;

    o_model						= m_state_holder.state().model_yaw;
    o_torso.yaw					= m_state_holder.state().camera_yaw;
    o_torso.pitch				= m_state_holder.state().camera_pitch;
    o_torso.roll				= m_state_holder.state().camera_roll;

    timestamp					= m_state_holder.state().time;

    weapon						= m_state_holder.state().inventory_active_slot;
    mstate						= m_state_holder.state().body_state_flags;
    set_health					( m_state_holder.state().health );
    fRadiation					= m_state_holder.state().radiation;
    m_AliveState.enabled		= m_state_holder.state().physics_state_enabled;

    m_ready_to_update			= true;
    //Msg("* Client 0x%08x UPDATE_Read, health is: %2.04f", this->ID, m_state_holder.state().health);
}
开发者ID:vasilenkomike,项目名称:xray,代码行数:42,代码来源:actor_mp_server_import.cpp


示例4: R_ASSERT2

void CUICaption::addCustomMessage(const shared_str& msg_name, float x, float y, float font_size, 
								  CGameFont *pFont, CGameFont::EAligment al, u32 color, LPCSTR def_str)
{
//	R_ASSERT2( (m_indices.find(msg_name) == m_indices.end()),"message already defined !!!" );
	R_ASSERT2( u32(-1)==findIndexOf_(msg_name),"message already defined !!!" );

	SinglePhrase * sp = AddPhrase();
	sp->outX = x;
	sp->outY = y;
	sp->effect.SetFontSize(font_size);
	sp->effect.SetFont(pFont);
	sp->effect.SetTextColor(color);
	sp->effect.SetFontAlignment(al);

	sp->str = *CStringTable().translate(def_str);
	sp->key = msg_name;

//	m_indices[msg_name] = m_vPhrases.size()-1;

}
开发者ID:2asoft,项目名称:xray,代码行数:20,代码来源:UIMultiTextStatic.cpp


示例5:

void CSE_ALifeInventoryItem::UPDATE_Write	(NET_Packet &tNetPacket)
{
	if (!m_u8NumItems) {
		tNetPacket.w_u8				(0);
		return;
	}

	mask_num_items					num_items;
	num_items.mask					= 0;
	num_items.num_items				= m_u8NumItems;

	R_ASSERT2						(
		num_items.num_items < (u8(1) << 5),
		make_string("%d",num_items.num_items)
	);

	if (State.enabled)									num_items.mask |= inventory_item_state_enabled;
	if (fis_zero(State.angular_vel.square_magnitude()))	num_items.mask |= inventory_item_angular_null;
	if (fis_zero(State.linear_vel.square_magnitude()))	num_items.mask |= inventory_item_linear_null;

	tNetPacket.w_u8					(num_items.common);

	tNetPacket.w_vec3				(State.position);

	tNetPacket.w_float_q8			(State.quaternion.x,0.f,1.f);
	tNetPacket.w_float_q8			(State.quaternion.y,0.f,1.f);
	tNetPacket.w_float_q8			(State.quaternion.z,0.f,1.f);
	tNetPacket.w_float_q8			(State.quaternion.w,0.f,1.f);	

	if (!check(num_items.mask,inventory_item_angular_null)) {
		tNetPacket.w_float_q8		(State.angular_vel.x,0.f,10*PI_MUL_2);
		tNetPacket.w_float_q8		(State.angular_vel.y,0.f,10*PI_MUL_2);
		tNetPacket.w_float_q8		(State.angular_vel.z,0.f,10*PI_MUL_2);
	}

	if (!check(num_items.mask,inventory_item_linear_null)) {
		tNetPacket.w_float_q8		(State.linear_vel.x,-32.f,32.f);
		tNetPacket.w_float_q8		(State.linear_vel.y,-32.f,32.f);
		tNetPacket.w_float_q8		(State.linear_vel.z,-32.f,32.f);
	}
};
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:41,代码来源:xrServer_Objects_ALife_Items.cpp


示例6: check

void CSE_ALifeInventoryItem::UPDATE_Read	(NET_Packet &tNetPacket)
{
	tNetPacket.r_u8					(m_u8NumItems);
	if (!m_u8NumItems) {
		return;
	}

	mask_num_items					num_items;
	num_items.common				= m_u8NumItems;
	m_u8NumItems					= num_items.num_items;

	R_ASSERT2						(
		m_u8NumItems < (u8(1) << 5),
		make_string("%d",m_u8NumItems)
	);

	tNetPacket.r_vec3				(State.position);

	tNetPacket.r_float_q8			(State.quaternion.x,0.f,1.f);
	tNetPacket.r_float_q8			(State.quaternion.y,0.f,1.f);
	tNetPacket.r_float_q8			(State.quaternion.z,0.f,1.f);
	tNetPacket.r_float_q8			(State.quaternion.w,0.f,1.f);	

	State.enabled					= check(num_items.mask,inventory_item_state_enabled);

	if (!check(num_items.mask,inventory_item_angular_null)) {
		tNetPacket.r_float_q8		(State.angular_vel.x,0.f,10*PI_MUL_2);
		tNetPacket.r_float_q8		(State.angular_vel.y,0.f,10*PI_MUL_2);
		tNetPacket.r_float_q8		(State.angular_vel.z,0.f,10*PI_MUL_2);
	}
	else
		State.angular_vel.set		(0.f,0.f,0.f);

	if (!check(num_items.mask,inventory_item_linear_null)) {
		tNetPacket.r_float_q8		(State.linear_vel.x,-32.f,32.f);
		tNetPacket.r_float_q8		(State.linear_vel.y,-32.f,32.f);
		tNetPacket.r_float_q8		(State.linear_vel.z,-32.f,32.f);
	}
	else
		State.linear_vel.set		(0.f,0.f,0.f);
};
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:41,代码来源:xrServer_Objects_ALife_Items.cpp


示例7: ID_to_client

void xrServer::Process_update(NET_Packet& P, ClientID sender)
{
	xrClientData* CL		= ID_to_client(sender);
	R_ASSERT2				(CL,"Process_update client not found");

	if (g_Dump_Update_Read) Msg("---- UPDATE_Read --- ");

	R_ASSERT(CL->flags.bLocal);
	// while has information
	while (!P.r_eof())
	{
		// find entity
		u16				ID;
		u8				size;

		P.r_u16			(ID);
		P.r_u8			(size);
		u32	_pos		= P.r_tell();
		CSE_Abstract	*E	= ID_to_entity(ID);
		
		if (E) {
			//Msg				("sv_import: %d '%s'",E->ID,E->name_replace());
			E->net_Ready	= TRUE;
			E->UPDATE_Read	(P);

			u32 cp = P.r_tell();
			if (g_Dump_Update_Read) Msg("* %s : %d - %d", E->name(), size, cp - _pos);

			if ((cp - _pos) != size)	{
				string16	tmp;
				CLSID2TEXT	(E->m_tClassID,tmp);
				Msg("* size = %d, start read = %d, end read = %d", size, _pos, cp);
				Debug.fatal	(DEBUG_INFO,"Beer from the creator of '%s', version of object = %d", tmp, E->m_wVersion);				
			}
		}
		else
			P.r_advance	(size);
	}
	if (g_Dump_Update_Read) Msg("-------------------- ");

}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:41,代码来源:xrServer_process_update.cpp


示例8: R_ASSERT2

void CUIGameCTA::ShowBuyMenu()
{
    if (Level().IsDemoPlay())
        return;
    R_ASSERT2(m_pCurBuyMenu, "buy menu not initialized");
    if (!m_pCurBuyMenu->IsShown())
    {
        m_pCurBuyMenu->IgnoreMoneyAndRank(m_game->InWarmUp());

        m_pCurBuyMenu->ResetItems();
        m_pCurBuyMenu->SetupPlayerItemsBegin();

        SetPlayerItemsToBuyMenu();
        SetPlayerParamsToBuyMenu();

        m_pCurBuyMenu->SetupPlayerItemsEnd();

        m_pCurBuyMenu->ShowDialog(true);
        m_game->OnBuyMenuOpen();
    }
}
开发者ID:Frankie-666,项目名称:xray-16,代码行数:21,代码来源:UIGameCTA.cpp


示例9: RunStartupAnim

void CPhysicObject::RunStartupAnim(CSE_Abstract *D)
{
	if(Visual()&&smart_cast<IKinematics*>(Visual()))
	{
		//		CSE_PHSkeleton	*po	= smart_cast<CSE_PHSkeleton*>(D);
		IKinematicsAnimated*	PKinematicsAnimated=NULL;
		R_ASSERT			(Visual()&&smart_cast<IKinematics*>(Visual()));
		PKinematicsAnimated	=smart_cast<IKinematicsAnimated*>(Visual());
		if(PKinematicsAnimated)
		{
			CSE_Visual					*visual = smart_cast<CSE_Visual*>(D);
			R_ASSERT					(visual);
			R_ASSERT2					(*visual->startup_animation,"no startup animation");
	
			VERIFY2( (!!PKinematicsAnimated->LL_MotionID( visual->startup_animation.c_str() ) .valid() ) , ( make_string(" animation %s not faund ",visual->startup_animation.c_str() ) + dbg_object_base_dump_string( this )).c_str() );
			m_anim_blend				= m_anim_script_callback.play_cycle( PKinematicsAnimated, visual->startup_animation );
		}
		smart_cast<IKinematics*>(Visual())->CalculateBones_Invalidate();
		smart_cast<IKinematics*>(Visual())->CalculateBones	(TRUE);
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:21,代码来源:PhysicObject.cpp


示例10: while

void message_filter::check_new_data	(NET_Packet & packet)
{
	u32			tmp_old_pos = packet.r_tell();
	
	msg_type_subtype_t	packet_mtype;
	packet_mtype.import	(packet);


	if (packet_mtype.msg_type == M_EVENT_PACK)
	{
		NET_Packet tmp_packet;
		while (!packet.r_eof())
		{
			tmp_packet.B.count = packet.r_u8();
			packet.r	(tmp_packet.B.data, tmp_packet.B.count);
			packet_mtype.import(tmp_packet);
			
			R_ASSERT2(packet_mtype.msg_type != M_EVENT_PACK, "M_EVENT_PACK in M_EVENT_PACK");
			dbg_print_msg	(tmp_packet, packet_mtype);

			filters_map_t::iterator tmp_iter = m_filters.find(packet_mtype);
			if (tmp_iter != m_filters.end())
			{
				tmp_iter->second(packet_mtype.msg_type,
					packet_mtype.msg_subtype,
					tmp_packet);
			}
		}
	} else {
		dbg_print_msg			(packet, packet_mtype);
		filters_map_t::iterator tmp_iter = m_filters.find(packet_mtype);
		if (tmp_iter != m_filters.end())
		{
			tmp_iter->second(packet_mtype.msg_type,
				packet_mtype.msg_subtype,
				packet);
		}
	}
	packet.r_seek	(tmp_old_pos);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:40,代码来源:Message_Filter.cpp


示例11: LoadLibrary

void CEngine::Initialize(void)
{
	// Other stuff
	string_path              fn;
    strconcat               (sizeof(fn),fn,UI->EditorName(),".log");
    FS.update_path			(fn,_local_root_,fn);

#ifdef _EDITOR
	// Bind PSGP
	ZeroMemory				(&PSGP,sizeof(PSGP));
	hPSGP		            = LoadLibrary("xrCPU_Pipe.dll");
	R_ASSERT2	            (hPSGP,"Can't find 'xrCPU_Pipe.dll'");

	xrBinder* bindCPU	    = (xrBinder*)GetProcAddress(hPSGP,"xrBind_PSGP");	R_ASSERT(bindCPU);
	bindCPU		            (&PSGP, CPU::ID.feature /*& CPU::ID.os_support*/);
    // for compliance with editor
    PSGP.skin1W				= xrSkin1W_x86;
    PSGP.skin2W				= xrSkin2W_x86;
#endif

	ReloadSettings			();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:22,代码来源:Engine.cpp


示例12: switch

void CUIBagWnd::OnBackClick(){
	int iGroup;

	switch (GetMenuLevel())
	{
	case mlRoot:
		R_ASSERT2(false,"error: CUIBagWnd on level <mlRoot> can't handle OnBackClick");
		break;
	case mlBoxes:
		ShowSectionEx(-1);
		break;
	case mlWpnSubType:		
		iGroup = GetCurrentGroupIndex();
		if (iGroup >= GROUP_31 && iGroup <= GROUP_34 )
			ShowSectionEx(GROUP_BOXES);
		else
			ShowSectionEx(-1);
		break;
	default:
		NODEFAULT;
	}
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:22,代码来源:UIBagWnd.cpp


示例13: FileDecompress

void* FileDecompress(const char* fn, const char* sign, u32* size)
{
    MARK M, F;
    mk_mark(M, sign);

    int H = open(fn, O_BINARY | O_RDONLY);
    R_ASSERT2(H > 0, fn);
    _read(H, &F, 8);
    if (strncmp(M, F, 8) != 0)
    {
        F[8] = 0;
        Msg("FATAL: signatures doesn't match, file(%s) / requested(%s)", F, sign);
    }
    R_ASSERT(strncmp(M, F, 8) == 0);

    void* ptr = 0;
    u32 SZ;
    SZ = _readLZ(H, ptr, filelength(H) - 8);
    _close(H);
    if (size) *size = SZ;
    return ptr;
}
开发者ID:BubbaXXX,项目名称:xray-16,代码行数:22,代码来源:FS.cpp


示例14: xr_delete

const CUILine* CUILine::CutWord(CGameFont* pFont, float length){
	xr_delete(m_tmpLine);
	m_tmpLine = xr_new<CUILine>();

	float len = 0;

	for (u32 i= 0; i<m_subLines[0].m_text.length(); i++)
	{
		float ll = pFont->SizeOf_(m_subLines[0].m_text[i]);
		UI()->ClientToScreenScaledWidth(ll);
		len += ll;

		if (len>length){
			m_tmpLine->AddSubLine(m_subLines[0].Cut2Pos((i?i:1)-1));
			return m_tmpLine;
		}
	}

	R_ASSERT2(false, "meaningless call of CUILine::CutWord() ):");

	return m_tmpLine;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:22,代码来源:UILine.cpp


示例15: PHGetLinearVell

void CWeaponPistol::OnShot		()
{
	PlaySound		(m_sSndShotCurrent.c_str(),get_LastFP());

	AddShotEffector	();
	
	PlayAnimShoot	();

	// Shell Drop
	Fvector vel; 
	PHGetLinearVell(vel);
	OnShellDrop					(get_LastSP(),  vel);

	// ќгонь из ствола
	
	StartFlameParticles	();
	R_ASSERT2(!m_pFlameParticles || !m_pFlameParticles->IsLooped(),
			  "can't set looped particles system for shoting with pistol");
	
	//дым из ствола
	StartSmokeParticles	(get_LastFP(), vel);
}
开发者ID:2asoft,项目名称:xray,代码行数:22,代码来源:WeaponPistol.cpp


示例16: lua_gettop

void engine::expand_class						(
		cs::lua_debugger::backend& backend,
		cs::lua_debugger::value_to_expand& value,
		lua_State* const state
	)
{
	int							start = lua_gettop(state);

	luabind::detail::class_rep	*class_object = static_cast<luabind::detail::class_rep*>(lua_touserdata(state,-1));
	R_ASSERT2					(class_object, "invalid class userdata");
	
	fill_class_data				(backend, value, state);

	luabind::detail::object_rep	*object = luabind::detail::is_class_object(state,-2);
	if (!object)
		lua_pushnil				(state);

	if (lua_gettop(state) <= start + 1)
		return;

	lua_pop_value				(state,1);
}
开发者ID:2asoft,项目名称:xray,代码行数:22,代码来源:lua_studio.cpp


示例17:

void	CPortal::Setup	(Fvector* V, int vcnt, CSector* face, CSector* back)
{
	// calc sphere
	Fbox				BB;
	BB.invalidate		();
	for (int v=0; v<vcnt; v++)
		BB.modify		(V[v]);
	BB.getsphere		(S.P,S.R);

	// 
	poly.assign			(V,vcnt);
	pFace				= face; 
	pBack				= back;
	marker				= 0xffffffff; 

	Fvector				N,T;
	N.set				(0,0,0);

	FPU::m64r();
	u32	_cnt			= 0;
	for (int i=2; i<vcnt; i++) {
		T.mknormal_non_normalized		(poly[0],poly[i-1],poly[i]);
		float		m	= T.magnitude	();
		if (m>EPS_S)	{
			N.add		(T.div(m))	;
			_cnt		++			;
		}
	}
	R_ASSERT2	(_cnt, "Invalid portal detected");
	N.div		(float(_cnt));
	P.build		(poly[0],N);
	FPU::m24r	();

	/*
	if (_abs(1-P.n.magnitude())<EPS)
	xrDebug::Fatal		(DEBUG_INFO,"Degenerated portal found at {%3.2f,%3.2f,%3.2f}.",VPUSH(poly[0]));
	*/
}
开发者ID:2asoft,项目名称:xray,代码行数:38,代码来源:r__sector.cpp


示例18: R_ASSERT2

void CObjectActionShow::initialize		()
{
	inherited::initialize			();
	
	VERIFY							(m_item);

	u32 slot = m_item->GetSlot();
	R_ASSERT2 (slot < (u8)NO_ACTIVE_SLOT, m_item->Name());

	CInventory &inv = object().inventory();
	PIItem item = inv.m_slots[slot].m_pIItem;
	if (item)
		inv.Ruck (item);

//.	object().inventory().SetActiveSlot(NO_ACTIVE_SLOT);
	inv.Slot		(m_item);
/*
	bool							result = object().inventory().Activate	(m_item->GetSlot());
	VERIFY							(result);
*/
	if (!m_weapon)
		return;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:23,代码来源:object_actions.cpp


示例19: parameters

float CGameGraphBuilder::path_distance		(const u32 &game_vertex_id0, const u32 &game_vertex_id1)
{
//	return					(graph().vertex(game_vertex_id0)->data().level_point().distance_to(graph().vertex(game_vertex_id1)->data().level_point()));

	VERIFY					(m_graph_engine);

	graph_type::CVertex		&vertex0 = *graph().vertex(game_vertex_id0);
	graph_type::CVertex		&vertex1 = *graph().vertex(game_vertex_id1);

	typedef GraphEngineSpace::CStraightLineParams	CStraightLineParams;
	CStraightLineParams		parameters(vertex0.data().level_point(),vertex1.data().level_point());

	float					pure_distance = vertex0.data().level_point().distance_to_xz(vertex1.data().level_point());
//	float					pure_distance = vertex0.data().level_point().distance_to(vertex1.data().level_point());
	VERIFY					(pure_distance < parameters.max_range);

	u32						level_vertex_id = level_graph().check_position_in_direction(vertex0.data().level_vertex_id(),vertex0.data().level_point(),vertex1.data().level_point());
	if (level_graph().valid_vertex_id(level_vertex_id))
		return				(pure_distance);

	bool					successfull = 
		m_graph_engine->search(
			level_graph(),
			vertex0.data().level_vertex_id(),
			vertex1.data().level_vertex_id(),
			&m_path,
			parameters
		);

	if (successfull)
		return				(parameters.m_distance);

	Msg						("Cannot build path from [%d] to [%d]",game_vertex_id0,game_vertex_id1);
	Msg						("Cannot build path from [%f][%f][%f] to [%f][%f][%f]",VPUSH(vertex0.data().level_point()),VPUSH(vertex1.data().level_point()));
	R_ASSERT2				(false,"Cannot build path, check AI map");
	return					(flt_max);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:37,代码来源:game_graph_builder.cpp


示例20: GetClientRect

void	CTextConsole::CreateConsoleWnd()
{
	HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(0);
	//----------------------------------
	RECT cRc;
	GetClientRect(*m_pMainWnd, &cRc);
	INT lX = cRc.left;
	INT lY = cRc.top;
	INT lWidth = cRc.right - cRc.left;
	INT lHeight = cRc.bottom - cRc.top;
	//----------------------------------
	const char*	wndclass ="TEXT_CONSOLE";

	// Register the windows class
	WNDCLASS wndClass = { 0, TextConsole_WndProc, 0, 0, hInstance,
		NULL,
		LoadCursor( hInstance, IDC_ARROW ),
		GetStockBrush(GRAY_BRUSH),
		NULL, wndclass };
	RegisterClass( &wndClass );

	// Set the window's initial style
	u32 dwWindowStyle = WS_OVERLAPPED | WS_CHILD | WS_VISIBLE;// | WS_CLIPSIBLINGS;// | WS_CLIPCHILDREN;

	// Set the window's initial width
	RECT rc;
	SetRect			( &rc, lX, lY, lWidth, lHeight );
//	AdjustWindowRect( &rc, dwWindowStyle, FALSE );

	// Create the render window
	m_hConsoleWnd = CreateWindow( wndclass, "XRAY Text Console", dwWindowStyle,
		lX, lY,
		lWidth, lHeight, *m_pMainWnd,
		0, hInstance, 0L );
	//---------------------------------------------------------------------------
	R_ASSERT2(m_hConsoleWnd, "Unable to Create TextConsole Window!");
};
开发者ID:2asoft,项目名称:xray,代码行数:37,代码来源:Text_Console.cpp



注:本文中的R_ASSERT2函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ R_ASSERT3函数代码示例发布时间:2022-05-30
下一篇:
C++ R_ASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap