您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ transmit_entity_comms_message函数代码示例

51自学网 2021-06-03 08:57:16
  C++
这篇教程C++ transmit_entity_comms_message函数代码示例写得很实用,希望能帮到您。

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

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

示例1: set_remote_float_value

static void set_remote_float_value (entity *en, float_types type, float value){	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_FLOAT_VALUE, en, type, value);	transmit_entity_comms_message (ENTITY_COMMS_FLOAT_VALUE, en, type, value);}
开发者ID:DexterWard,项目名称:comanche,代码行数:7,


示例2: update_time_of_day_resync

static void update_time_of_day_resync (entity *en){	session		*raw;			ASSERT (en);	raw = (session *) get_local_entity_data (en);	raw->time_of_day_resync += get_delta_time ();	if (raw->time_of_day_resync > SESSION_RESYNC_FREQUENCY)	{		transmit_entity_comms_message (ENTITY_COMMS_UPDATE, en);		raw->time_of_day_resync = 0.0;		#if DEBUG_MODULE		debug_log ("SS_UPDT : Weather at %f, %f - radius %f", raw->weather_position.x, raw->weather_position.z, raw->weather_radius);		#endif	}}
开发者ID:Comanche93,项目名称:eech,代码行数:25,


示例3: ASSERT

entity *create_client_server_sound_effect_entity			(				entity *parent,				entity_sides side,				entity_sub_types sub_type,				sound_channel_types channel,				sound_locality_types locality,				vec3d *position,				float amp,				int valid,				int looping,				int sample_count,				sound_sample_indices *sample_indices			){	entity		*en;	ASSERT (get_comms_model () == COMMS_MODEL_SERVER);	ASSERT (side < NUM_ENTITY_SIDES);	en = create_local_sound_effect_entity	(		ENTITY_INDEX_DONT_CARE,		parent,		side,		sub_type,		channel,		locality,		position,		amp,		valid,		looping,		sample_count,		sample_indices	);	transmit_entity_comms_message	(		ENTITY_COMMS_CREATE_SOUND_EFFECT,		NULL,		get_local_entity_safe_index (en),		parent,		side,		sub_type,		channel,		locality,		position,		amp,		valid,		looping,		sample_count,		sample_indices	);	return en;}
开发者ID:DexterWard,项目名称:comanche,代码行数:58,


示例4: destroy_client_family

static void destroy_client_family (entity *en){	#if DEBUG_MODULE >= 2	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_DESTROY_FAMILY, en);	#endif	transmit_entity_comms_message (ENTITY_COMMS_DESTROY_FAMILY, en);}
开发者ID:Comanche93,项目名称:eech,代码行数:10,


示例5: set_remote_int_value

static void set_remote_int_value (entity *en, int_types type, int value){	#if DEBUG_MODULE	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_INT_VALUE, en, type, value);	#endif	transmit_entity_comms_message (ENTITY_COMMS_INT_VALUE, en, type, value);}
开发者ID:Comanche93,项目名称:eech,代码行数:10,


示例6: destroy_remote

static void destroy_remote (entity *en){	#if DEBUG_MODULE	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_DESTROY, en);	#endif	transmit_entity_comms_message (ENTITY_COMMS_DESTROY, en);}
开发者ID:DexterWard,项目名称:comanche,代码行数:10,


示例7: kill_remote

static void kill_remote (entity *en){	#if DEBUG_MODULE	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_KILL, en);	#endif	transmit_entity_comms_message (ENTITY_COMMS_KILL, en);}
开发者ID:DexterWard,项目名称:comanche,代码行数:10,


示例8: resume_client_server_entity_sound_type

int resume_client_server_entity_sound_type (entity *en, entity_sub_types type){	int		count;	count = resume_local_entity_sound_type (en, type);	transmit_entity_comms_message (ENTITY_COMMS_RESUME_SOUND_TYPE, en, type);	return count;}
开发者ID:DexterWard,项目名称:comanche,代码行数:11,


示例9: pause_client_server_entity_sound_type

int pause_client_server_entity_sound_type (entity *en, entity_sub_types type, float delay){	int		count;			count = pause_local_entity_sound_type (en, type, delay);	transmit_entity_comms_message (ENTITY_COMMS_PAUSE_SOUND_TYPE, en, type, delay);	return count;}
开发者ID:DexterWard,项目名称:comanche,代码行数:11,


示例10: set_remote_string

static void set_remote_string (entity *en, string_types type, const char *s){	ASSERT (s);	#if DEBUG_MODULE	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_STRING, en, type, s);	#endif	transmit_entity_comms_message (ENTITY_COMMS_STRING, en, type, s);}
开发者ID:Comanche93,项目名称:eech,代码行数:12,


示例11: set_remote_vec3d

static void set_remote_vec3d (entity *en, vec3d_types type, vec3d *v){	ASSERT (v);	#if DEBUG_MODULE	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_VEC3D, en, type, v);	#endif	transmit_entity_comms_message (ENTITY_COMMS_VEC3D, en, type, v);}
开发者ID:Comanche93,项目名称:eech,代码行数:12,


示例12: pause_client_server_continuous_weapon_sound_effect

void pause_client_server_continuous_weapon_sound_effect (entity *en, entity_sub_types weapon_sub_type){	ASSERT (en);	ASSERT ((get_comms_model () == COMMS_MODEL_SERVER) || (en == get_gunship_entity ()));	if (weapon_sub_type != ENTITY_SUB_TYPE_WEAPON_NO_WEAPON)	{		pause_local_continuous_weapon_sound_effect (en, weapon_sub_type);		transmit_entity_comms_message (ENTITY_COMMS_PAUSE_WEAPON_SOUND_TYPE, en, weapon_sub_type);	}}
开发者ID:DexterWard,项目名称:comanche,代码行数:13,


示例13: validate_remote_create_entity_index

static entity *create_remote (entity_types type, int index, char *pargs){	validate_remote_create_entity_index (index);	#if DEBUG_MODULE	debug_log_entity_args (ENTITY_DEBUG_REMOTE, ENTITY_DEBUG_CREATE, NULL, type, index);	#endif	transmit_entity_comms_message (ENTITY_COMMS_CREATE, NULL, type, index, pargs);	return (NULL);}
开发者ID:DexterWard,项目名称:comanche,代码行数:14,


示例14: respond_to_player_task_assign_request

void respond_to_player_task_assign_request (entity *pilot, entity *task, entity *mobile){	entity		*group;			ASSERT (pilot);	ASSERT (mobile);	ASSERT (task);	ASSERT (get_comms_model () == COMMS_MODEL_SERVER);	group = get_local_entity_parent (mobile, LIST_TYPE_MEMBER);	if ((!get_local_entity_first_child (task, LIST_TYPE_GUIDE)) && (!get_local_group_primary_task (group)))	{		if (assign_primary_task_to_group (group, task))		{			transmit_entity_comms_message (ENTITY_COMMS_TASK_ASSIGN_RESULT, pilot, task, mobile);			return;		}	}	else	{		if (get_local_group_primary_task (group))		{			transmit_entity_comms_message (ENTITY_COMMS_TASK_ASSIGN_RESULT, pilot, task, mobile);			return;		}	}	transmit_entity_comms_message (ENTITY_COMMS_TASK_ASSIGN_RESULT, pilot, NULL, NULL);}
开发者ID:Comanche93,项目名称:eech,代码行数:36,


示例15: damage_helicopter_via_damage_level

void damage_helicopter_via_damage_level (entity *en, entity *aggressor){	int		damage;	float		en_damage_factor;	ASSERT (get_local_entity_int_value (en, INT_TYPE_PLAYER) != ENTITY_PLAYER_AI);	en_damage_factor = (float) get_local_entity_int_value (en, INT_TYPE_DAMAGE_LEVEL) / get_local_entity_int_value (en, INT_TYPE_INITIAL_DAMAGE_LEVEL);	for (damage = 0; damage < sizeof (dynamics_damage_database) / sizeof (dynamics_damage_type); damage ++)	{		if (dynamics_damage_database [damage].kickin_value >= en_damage_factor)		{			if (get_gunship_entity () == en)			{				dynamics_damage_model (1 << damage, TRUE);			}			else			{				transmit_entity_comms_message (ENTITY_COMMS_DAMAGE_PLAYER, en, 1 << damage, TRUE);			}/*			if (aggressor)			{				if (dynamics_damage_database [damage].store_aggressor_in_debrief)				{						debug_log ("CO_DMG: storing in debrief that %s %s caused damage to user",									entity_type_names [get_local_entity_type (aggressor)],									get_local_entity_string (aggressor, STRING_TYPE_FULL_NAME));	//					set_debrief_aggressor_entity (aggressor);				}			}*/		}	}}
开发者ID:DexterWard,项目名称:comanche,代码行数:47,


示例16: ASSERT

entity *push_task_onto_group_task_stack (entity *group, entity *task, unsigned int valid_members){	entity		*task_parent,		*guide;	list_types		list_type;	#ifdef DEBUG		unsigned int		total_members,		member_number;	#endif	ASSERT (get_comms_model () == COMMS_MODEL_SERVER);	ASSERT (group);	#ifdef DEBUG	total_members = 0;	//	// Check not already on stack	//	guide = get_local_entity_first_child (task, LIST_TYPE_GUIDE);	while (guide)	{		if (get_local_entity_parent (guide, LIST_TYPE_GUIDE_STACK) == group)		{			member_number = get_local_entity_int_value (guide, INT_TYPE_VALID_GUIDE_MEMBERS);			total_members |= member_number;		}		guide = get_local_entity_child_succ (guide, LIST_TYPE_GUIDE);	}	//	// A TASK may be on the stack many times, but any one member should not have the same task duplicated	// e.g. ENGAGE tasks may be duplicated many times, but their guide "valid_members" should all be exclusive	//	if (valid_members & total_members)	{		debug_filtered_log ("Trying to assign task %s (%d) to group %s - members %d",										get_local_entity_string (task, STRING_TYPE_FULL_NAME),										get_local_entity_index (task),										get_local_entity_string (group, STRING_TYPE_FULL_NAME),										valid_members);		debug_filtered_log ("");		dump_guide_stack (group);		debug_fatal ("ASSIGN: Task %s already on Group %s guide stack",								get_local_entity_string (task, STRING_TYPE_FULL_NAME),								get_local_entity_string (group, STRING_TYPE_FULL_NAME));	}	#endif	//	// create guide entity for task	//	guide = create_client_server_guide_entity (task, NULL, valid_members);	attach_group_to_guide_entity (group, guide);	//	// remove task and group from lists (must be done AFTER guide is created and attached)	//	list_type = get_local_task_list_type (task);	if (list_type == LIST_TYPE_UNASSIGNED_TASK)	{		task_parent = get_local_entity_parent (task, list_type);		if (task_parent)		{			delete_local_entity_from_parents_child_list (task, list_type);			//			// add task to assigned task list, if not already on it.			//			insert_local_entity_into_parents_child_list (task, LIST_TYPE_ASSIGNED_TASK, task_parent, NULL);			transmit_entity_comms_message (ENTITY_COMMS_SWITCH_LIST, task, LIST_TYPE_UNASSIGNED_TASK, task_parent, LIST_TYPE_ASSIGNED_TASK);		}	}	return guide;//.........这里部分代码省略.........
开发者ID:Comanche93,项目名称:eech,代码行数:101,


示例17: create_client_server_entity_weapon

//.........这里部分代码省略.........					vec3d						exhaust_offset;					num_smoke_trail_entities = count_entities_in_meta_smoke_list (smoke_trail_type);					ASSERT (num_smoke_trail_entities > 0);					smoke_trail_indices = (int *) malloc_fast_mem (sizeof (int) * num_smoke_trail_entities);					for (i = 0; i < num_smoke_trail_entities; i++)					{						smoke_trail_indices[i] = ENTITY_INDEX_DONT_CARE;					}					bounding_box = get_object_3d_bounding_box (get_local_entity_int_value (weapon, INT_TYPE_DEFAULT_3D_SHAPE));					if ((weapon_sub_type == ENTITY_SUB_TYPE_WEAPON_HOKUM_PILOT) ||(weapon_sub_type == ENTITY_SUB_TYPE_WEAPON_HOKUM_CO_PILOT))					{						exhaust_offset.x = 0.0;						exhaust_offset.y = 0.0;						exhaust_offset.z = 0.0;					}					else					{						exhaust_offset.x = 0.0;						exhaust_offset.y = 0.0;						exhaust_offset.z = bounding_box->zmin;					}					create_meta_smoke_list_specified_offset (smoke_trail_type, weapon, &exhaust_offset, smoke_trail_indices);				}				transmit_entity_comms_message				(					ENTITY_COMMS_CREATE_WEAPON,					NULL,					launcher,					weapon_sub_type,					get_local_entity_safe_index (weapon),					burst_size,					smoke_trail_indices				);				if (smoke_trail_indices)				{					free_mem (smoke_trail_indices);				}				//				// out of weapons (if infinite weapons then reload else select next weapon)				//				new_weapon_count = get_local_entity_weapon_count (launcher, weapon_sub_type);				if (new_weapon_count <= 0)				{					#if !DEMO_VERSION					if (get_local_entity_int_value (get_session_entity (), INT_TYPE_INFINITE_WEAPONS))					{						weapon_config_types							config_type;						config_type = (weapon_config_types) get_local_entity_int_value (launcher, INT_TYPE_WEAPON_CONFIG_TYPE);						set_client_server_entity_int_value (launcher, INT_TYPE_WEAPON_CONFIG_TYPE, config_type);
开发者ID:Comanche93,项目名称:eech,代码行数:67,


示例18: comms_process_data

//.........这里部分代码省略.........						int							index;						ASSERT (get_comms_model () == COMMS_MODEL_SERVER);//						#if DEBUG_MODULE						debug_log ("COMMS MAN: RECEIVED PILOT REQUEST from %d", received_id);//						#endif						//						// unpack name						//						memcpy (&pilot_data, (client_pilot_request_data *) received_data, sizeof (client_pilot_request_data));						new_pilot = create_new_pilot_entity										(											pilot_data.name,											pilot_data.side,											pilot_data.rank,											pilot_data.sub_type,											pilot_data.unique_id,											pilot_data.difficulty										);						ASSERT (new_pilot);						index = get_local_entity_safe_index (new_pilot);						new_connection = get_connection_list_item (received_id);						transmit_entity_comms_message (ENTITY_COMMS_PILOT_REQUEST_ACCEPTED, NULL, received_id, index);						new_connection->pilot_entity = new_pilot;						break;					}					case PACKET_TYPE_CLIENT_GUNSHIP_REQUEST:					{						connection_list_type							*new_connection;						client_gunship_request_data							pilot_data;						int							index_number,							buffer [2];						if (get_comms_model () == COMMS_MODEL_SERVER)						{//							#if DEBUG_MODULE							if (this_connection->pilot_entity)							{								debug_log ("COMMS MAN: RECEIVED GUNSHIP REQUEST from %s (dpid %d)",												get_local_entity_string (this_connection->pilot_entity, STRING_TYPE_PILOTS_NAME),												received_id);							}							else
开发者ID:DexterWard,项目名称:comanche,代码行数:67,


示例19: data_exchange

void data_exchange (void){	int		packet_data_size;	connection_data_type		*this_connection;	this_connection = direct_play_get_connection_data ();	if ((this_connection) && (this_connection->is_initialised))	{		#if DEBUG_MODULE >= 2		debug_log ("COMMS MAN: Data exchange");		#endif		if (get_current_pack_buffer_bit_size () > 0)		{			transmit_entity_comms_message (ENTITY_COMMS_END, NULL);		}		ASSERT (!get_pack_buffer_overflow ());		#if DEBUG_MODULE >= 2		debug_log ("COMM_MAN: closing pack buffer line.216");		#endif		packet_data_size = close_pack_buffer ();		if (packet_data_size > 0)		{			comms_record_data (tx_pack_buffer, packet_data_size);		}		#if DEBUG_MODULE >= 2		debug_log ("COMM_MAN: opening pack buffer line.224");		#endif		open_pack_buffer (tx_pack_buffer, command_line_comms_pack_buffer_size);		//		// receive all packets waiting		//		receive_packets ();		#if COMMS_STATS		debug_comms_stats ();		#endif		//		// process all data received this frame		//		comms_process_data ();		//		// send all data for this frame		//		comms_send_data ();		//		// reset the data record for next frame		//		comms_clear_data_record ();		//		// check resend list		//		update_resend_packet_list (command_line_comms_resend_list_size);	}}
开发者ID:DexterWard,项目名称:comanche,代码行数:87,


示例20: update_server

static void update_server (entity *en){	entity		*group;	helicopter		*raw;	int		loop;	aircraft_damage_types		damage_type;	raw = get_local_entity_data (en);	update_local_entity_view_interest_level (en);	update_local_helicopter_rotor_sounds (en);	damage_type = aircraft_critically_damaged (en);	if (raw->ac.mob.alive)	{		switch (raw->player)		{			////////////////////////////////////////			case ENTITY_PLAYER_AI:			////////////////////////////////////////			{				////////////////////////////////////////				for (loop = 0; loop < get_entity_movement_iterations (); loop ++)				{					if ((damage_type == AIRCRAFT_DAMAGE_CRITICAL) || (get_local_entity_int_value (en, INT_TYPE_EJECTED)))					{						helicopter_death_movement (en);					}					else					{						if (!get_local_entity_int_value (en, INT_TYPE_LANDED))						{							get_3d_terrain_point_data (raw->ac.mob.position.x, raw->ac.mob.position.z, &raw->ac.terrain_info);						}						helicopter_movement (en);					}				}				// provide resync for AI wingmen				group = get_local_entity_parent (en, LIST_TYPE_MEMBER);				if (group)				{					if ((get_local_entity_int_value (en, INT_TYPE_OPERATIONAL_STATE) != OPERATIONAL_STATE_LANDED) &&							(get_local_entity_int_value (group, INT_TYPE_MULTIPLAYER_GROUP)))					{						transmit_entity_comms_message (ENTITY_COMMS_UPDATE, en);					}				}				////////////////////////////////////////				//				// ORDER IS CRITICAL				//				if (raw->ac.mob.alive)				{					update_rotors (en);					update_aircraft_loading_doors (en);					update_aircraft_cargo_doors (en);					update_aircraft_undercarriage (en);					update_aircraft_rudder (en);					update_aircraft_target_scan (en);					update_aircraft_weapon_system_ready (en);					update_entity_weapon_systems (en);					update_entity_weapon_system_weapon_and_target_vectors (en);					update_aircraft_weapon_fire (en);					update_aircraft_decoy_release (en);				}				////.........这里部分代码省略.........
开发者ID:DexterWard,项目名称:comanche,代码行数:101,


示例21: update_client

//.........这里部分代码省略.........			////////////////////////////////////////			{				if (en != get_gunship_entity ())				{					//					// Client might be waiting for server to set old gunship to AI controlled.					//					return;				}				if (raw->invulnerable_timer > 0.0)				{					raw->invulnerable_timer -= get_delta_time ();				}				update_current_flight_dynamics_fuel_weight ();				if ((!fire_continuous_weapon) && (get_local_entity_sound_type_valid (en, weapon_database [raw->ac.selected_weapon].launch_sound_effect_sub_type)))				{					pause_client_server_continuous_weapon_sound_effect (en, raw->ac.selected_weapon);				}				//helicopter_death_movement (en);				////////////////////////////////////////				if ((!get_local_entity_int_value (en, INT_TYPE_AUTO_PILOT)) && (!get_local_entity_int_value (en, INT_TYPE_EJECTED)))				{					update_flight_dynamics ();					transmit_entity_comms_message (ENTITY_COMMS_UPDATE, en);				}				else				{					if (get_local_entity_int_value (en, INT_TYPE_LANDED))					{						if (get_local_entity_int_value (en, INT_TYPE_AUTO_PILOT))						{							set_current_flight_dynamics_rotor_brake (TRUE);							set_current_flight_dynamics_auto_pilot (FALSE);							current_flight_dynamics->input_data.collective.value = 0.0;						}					}					if ((damage_type == AIRCRAFT_DAMAGE_CRITICAL) || (get_local_entity_int_value (en, INT_TYPE_EJECTED)) || (get_local_entity_int_value (en, INT_TYPE_LANDED)))					{						set_current_flight_dynamics_auto_pilot (FALSE);					}					for (loop = 0; loop < get_entity_movement_iterations (); loop ++)					{						if ((damage_type == AIRCRAFT_DAMAGE_CRITICAL) || (get_local_entity_int_value (en, INT_TYPE_EJECTED)))						{							helicopter_death_movement (en);						}
开发者ID:DexterWard,项目名称:comanche,代码行数:67,


示例22: update_vector_altitude_dynamics

void update_vector_altitude_dynamics (void){	static float		last_ground_height = 0;	matrix3x3		attitude;	float		heading,		pitch,		roll,		ground_height,		centre_of_gravity_to_ground_distance;	vec3d		position,		*face_normal;	centre_of_gravity_to_ground_distance = get_local_entity_float_value (get_gunship_entity (), FLOAT_TYPE_CENTRE_OF_GRAVITY_TO_GROUND_DISTANCE);	get_local_entity_attitude_matrix (get_gunship_entity (), attitude);	ground_height = get_local_entity_float_value (get_gunship_entity (), FLOAT_TYPE_TERRAIN_ELEVATION);	//	// debug	//	if ((ground_height < -1000) || (ground_height > 32000))	{		debug_log ("!!!!!!!!!!!!!! GROUND HEIGHT %f", ground_height);		ground_height = last_ground_height;	}	//	// end	//	last_ground_height = ground_height;	current_flight_dynamics->altitude.value = current_flight_dynamics->position.y;	current_flight_dynamics->altitude.min = ground_height;	switch (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_OPERATIONAL_STATE))	{		case OPERATIONAL_STATE_LANDED:		{			if (current_flight_dynamics->world_velocity_y.value > 0.0)			{						#if DEBUG_DYNAMICS						debug_log ("VECTOR DYN: takeoff !");						#endif						set_local_entity_int_value (get_gunship_entity (), INT_TYPE_OPERATIONAL_STATE, OPERATIONAL_STATE_NAVIGATING);						delete_local_entity_from_parents_child_list (get_gunship_entity (), LIST_TYPE_CURRENT_WAYPOINT);						transmit_entity_comms_message (ENTITY_COMMS_MOBILE_TAKEOFF, get_gunship_entity ());			}			else			{				entity					*wp;				vec3d					wp_pos;				wp = get_local_entity_parent (get_gunship_entity (), LIST_TYPE_CURRENT_WAYPOINT);				if (wp)				{					get_local_waypoint_formation_position (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_FORMATION_POSITION), wp, &wp_pos);					ground_height = wp_pos.y;				}					current_flight_dynamics->world_velocity_y.value = max (current_flight_dynamics->world_velocity_y.value, 0.0);				current_flight_dynamics->velocity_y.value = max (current_flight_dynamics->velocity_y.value, 0.0);								memset (&current_flight_dynamics->world_motion_vector, 0, sizeof (vec3d));							current_flight_dynamics->velocity_x.value = bound (current_flight_dynamics->velocity_x.value, knots_to_metres_per_second (-10), knots_to_metres_per_second (50));				current_flight_dynamics->velocity_y.value = 0;				current_flight_dynamics->velocity_z.value = bound (current_flight_dynamics->velocity_z.value, knots_to_metres_per_second (-10), knots_to_metres_per_second (50));							current_flight_dynamics->position.y = ground_height + centre_of_gravity_to_ground_distance;			//.........这里部分代码省略.........
开发者ID:Comanche93,项目名称:eech,代码行数:101,


示例23: repair_damage_model

void repair_damage_model (unsigned int damage){	unsigned int		this_damage;	if (!get_gunship_entity ())	{		return;	}	this_damage = DYNAMICS_DAMAGE_NONE;	while (this_damage < NUM_DYNAMICS_DAMAGE_TYPES)	{		if ((damage & this_damage) && ((current_flight_dynamics->dynamics_damage & this_damage)))		{			current_flight_dynamics->dynamics_damage -= this_damage;			switch (this_damage)			{				case DYNAMICS_DAMAGE_NONE:				{					break;				}				case DYNAMICS_DAMAGE_MAIN_ROTOR:				{					#if DYNAMICS_DEBUG					debug_log ("DYNAMICS: main rotor repaired");					#endif					current_flight_dynamics->main_blade_pitch.damaged = FALSE;					current_flight_dynamics->main_rotor_roll_angle.damaged = FALSE;					current_flight_dynamics->main_rotor_pitch_angle.damaged = FALSE;					current_flight_dynamics->main_rotor_rpm.damaged = FALSE;					restore_helicopter_main_rotors (get_gunship_entity ());						transmit_entity_comms_message (ENTITY_COMMS_RESTORE_ENTITY, get_gunship_entity (), get_local_entity_vec3d_ptr (get_gunship_entity (), VEC3D_TYPE_POSITION), get_local_entity_int_value (get_gunship_entity (), INT_TYPE_OPERATIONAL_STATE));					set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_MAIN_ROTOR_DAMAGED, FALSE);					break;				}				case DYNAMICS_DAMAGE_TAIL_ROTOR:				{					#if DYNAMICS_DEBUG					debug_log ("DYNAMICS: tail rotor repaired");					#endif					current_flight_dynamics->tail_blade_pitch.damaged = FALSE;					current_flight_dynamics->tail_rotor_rpm.damaged = FALSE;					current_flight_dynamics->cross_coupling_effect.damaged = FALSE;					restore_helicopter_tail_rotors (get_gunship_entity ());					break;				}				case DYNAMICS_DAMAGE_LEFT_ENGINE:				{					current_flight_dynamics->left_engine_torque.damaged = FALSE;					current_flight_dynamics->left_engine_rpm.damaged = FALSE;					#if DYNAMICS_DEBUG					debug_log ("DYNAMICS: left engine repaired");					#endif					break;				}				case DYNAMICS_DAMAGE_RIGHT_ENGINE:				{					current_flight_dynamics->right_engine_torque.damaged = FALSE;					current_flight_dynamics->right_engine_rpm.damaged = FALSE;					#if DYNAMICS_DEBUG					debug_log ("DYNAMICS: right engine repaired");//.........这里部分代码省略.........
开发者ID:DexterWard,项目名称:comanche,代码行数:101,


示例24: update_dynamics_at_keysite

//.........这里部分代码省略.........			current_flight_dynamics->fuel_weight.value = bound (current_flight_dynamics->fuel_weight.value,																				current_flight_dynamics->fuel_weight.min,																				current_flight_dynamics->fuel_weight.max);		}		else		{			debug_log ("DYNAMICS: can't refuel till leak is fixed");		}	}	#endif	//	// Repair, only set if inside keysite	//	if (current_flight_dynamics->repairing)	{		if (current_flight_dynamics->dynamics_damage != DYNAMICS_DAMAGE_NONE)		{			current_flight_dynamics->damage_repair_time -= get_delta_time ();			current_flight_dynamics->damage_repair_time = max (current_flight_dynamics->damage_repair_time, 0.0);			#if DYNAMICS_DEBUG			debug_log ("DYNAMICS: repairing %d, repair time %f seconds", current_flight_dynamics->damage_repair_time, current_flight_dynamics->damage_repair_time);			#endif			//			// set repair timer to time to repair each part in turn			//			if (current_flight_dynamics->damage_repair_time <= 0.0)			{				// clear repaired damage				if ((current_flight_dynamics->repairing_damage != DYNAMICS_DAMAGE_NONE) &&					(current_flight_dynamics->dynamics_damage & current_flight_dynamics->repairing_damage))				{					repair_damage_model (current_flight_dynamics->repairing_damage);				}				current_flight_dynamics->repairing_damage = DYNAMICS_DAMAGE_NONE;				// start repairing next				this_damage = DYNAMICS_DAMAGE_NONE;				damage_count = 0;				model_damage = current_flight_dynamics->dynamics_damage;				while (this_damage < NUM_DYNAMICS_DAMAGE_TYPES)				{					if ((model_damage & this_damage) && (dynamics_damage_database [damage_count].repairable))					{						current_flight_dynamics->damage_repair_time = dynamics_damage_database [damage_count].repair_time;						current_flight_dynamics->repairing_damage = this_damage;						#if DEBUG_MODULE						debug_log ("DYNAMICS: repairing %s, repair time %f seconds", dynamics_damage_database [damage_count].name, current_flight_dynamics->damage_repair_time);						#endif						break;					}					damage_count ++;					this_damage = this_damage << 1;				}				if (current_flight_dynamics->repairing_damage == DYNAMICS_DAMAGE_NONE)				{					#if DEBUG_MODULE					debug_log ("DYNAMICS: model fully repaired");					#endif					restore_helicopter_entity (get_gunship_entity (), NULL, get_local_entity_int_value (get_gunship_entity (), INT_TYPE_OPERATIONAL_STATE));					set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_DAMAGE_LEVEL, get_local_entity_int_value (get_gunship_entity (), INT_TYPE_INITIAL_DAMAGE_LEVEL));					transmit_entity_comms_message (ENTITY_COMMS_RESTORE_ENTITY, get_gunship_entity (), get_local_entity_vec3d_ptr (get_gunship_entity (), VEC3D_TYPE_POSITION), get_local_entity_int_value (get_gunship_entity (), INT_TYPE_OPERATIONAL_STATE));				}			}		}	}}
开发者ID:DexterWard,项目名称:comanche,代码行数:101,



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


C++ transmit_register_setup函数代码示例
C++ transmit_chars函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。