Ejemplo n.º 1
0
void animate_person (entity *en)
{
	person
		*raw;
	
	int
		state;
			
	float
		scale,
		remainder,
		position;
	
	ASSERT (en);
	
	raw = (person *) get_local_entity_data (en);

	if (get_local_entity_int_value (en, INT_TYPE_ALIVE))
	{
		if (get_local_entity_int_value (en, INT_TYPE_OBJECT_DRAWN_ONCE_THIS_FRAME))
		{
			return;
		}
	
		get_keyframed_animation_state (raw->person_animation_state, &state, &remainder);
	
		scale = (person_animation_database[state].end - person_animation_database[state].start);
					
		position = (remainder * scale + person_animation_database[state].start) / PERSON_ANIMATION_TOTAL_LENGTH;
					
		#ifdef DEBUG_PERSON_ANIMATION
	
		if (en == get_external_view_entity ())
		{
			debug_log ("frame :%f", (position * PERSON_ANIMATION_TOTAL_LENGTH));
		}
	
		#endif
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_TORSO, position);
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_ARM, position);
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_HEAD, position);
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_LEG, position);
	}
	else
	{
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_TORSO, raw->person_animation_state);
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_ARM, raw->person_animation_state);
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_HEAD, raw->person_animation_state);
	
		animate_entity_simple_keyframed_sub_objects (raw->vh.inst3d, OBJECT_3D_SUB_OBJECT_TROOP_LEG, raw->person_animation_state);
	}

}
Ejemplo n.º 2
0
static void draw_local_3d_object (entity *en, float range)
{
	fixed_wing
		*raw;

	day_segment_types
		day_segment_type;

	raw = (fixed_wing *) get_local_entity_data (en);

	//
	// update viewpoint
	//

	raw->ac.inst3d->vp.position = raw->ac.mob.position;

	memcpy (&raw->ac.inst3d->vp.attitude, &raw->ac.mob.attitude, sizeof (matrix3x3));

	//
	// animate
	//

	animate_fixed_wing_afterburners (en);

	animate_fixed_wing_airbrakes (en);
	
	animate_fixed_wing_flaps (en);

	animate_fixed_wing_propellors (en);
	
	animate_aircraft_loading_doors (en);

	animate_aircraft_cargo_doors (en);

	animate_aircraft_undercarriage (en);

	animate_aircraft_weapon_system_ready (en);

	animate_aircraft_shadow (en);

	animate_aircraft_rudder (en);

	//
	// draw
	//

	day_segment_type = (day_segment_types) get_local_entity_int_value (get_session_entity (), INT_TYPE_DAY_SEGMENT_TYPE);

	raw->ac.inst3d->object_internal_lighting = ((day_segment_type == DAY_SEGMENT_TYPE_NIGHT) || (day_segment_type == DAY_SEGMENT_TYPE_DUSK));

	raw->ac.inst3d->object_sprite_lights = (raw->ac.inst3d->object_internal_lighting && sprite_light_valid (en));

	animate_and_draw_entity_muzzle_flash_effect (en);

	insert_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_OBJECT, raw->ac.inst3d);

	#if DEBUG_MODULE

	if (en == get_external_view_entity ())
	{
		vec3d
			*pos,
			wp_pos;

		draw_mobile_entity_debug_info (en);

		if (get_local_entity_primary_task (en))
		{
			fixed_wing_movement_get_waypoint_position (en, &wp_pos);
	
			pos = get_local_entity_vec3d_ptr (en, VEC3D_TYPE_POSITION);
	
			create_debug_3d_line (pos, &wp_pos, sys_col_dark_green, 0.0);
		}
	}
	
	#endif
}
Ejemplo n.º 3
0
void animate_routed_vehicle_wheels (entity *en)
{
	routed_vehicle
		*raw;

	object_3d_instance
		*inst3d;

	float
		speed,
		delta_pitch;

	int
		blurred_flag;

	ASSERT (en);

	if (get_local_entity_int_value (en, INT_TYPE_OBJECT_DRAWN_ONCE_THIS_FRAME))
	{
		return;
	}

   if (get_time_acceleration () == TIME_ACCELERATION_PAUSE)
	{
		return;
	}

	if (!get_local_entity_int_value (en, INT_TYPE_MOBILE_MOVING))
	{
		return;
	}

	raw = (routed_vehicle *) get_local_entity_data (en);

	inst3d = raw->vh.inst3d;

	if ( ( in_flight_articulation_test ) && ( get_external_view_entity() == en ) )
	{
		//
		// debug articulation test
		//

		test_speed += ( test_speed_inc * get_delta_time() );

		if ( test_speed > TEST_SPEED_MAX )
		{
			test_speed_inc = -TEST_SPEED_INC;
		}
		else if ( test_speed <= 0.0 )
		{
			test_speed_inc = TEST_SPEED_INC;
		}

		test_speed = bound( test_speed, 0.0, TEST_SPEED_MAX );

		speed = test_speed;
	}
	else
	{
		//
		// normal operation
		//

		speed = get_local_entity_float_value( en, FLOAT_TYPE_VELOCITY );
	}

	blurred_flag = ( speed > BLURRED_WHEEL_THRESHOLD );

	if ( blurred_flag )
	{
		delta_pitch = PI / 20.0;
	}
	else
	{
		delta_pitch = 2 * speed * get_delta_time ();
	}

	//
	// rotate wheel objects
	//
	// if a blurred wheel type exists on the vehicle then set the correct wheel type visible status, and rotate it
	// otherwise just rotate the standard wheel type
	//

	// fixed
	if ( activate_and_modify_sub_object_type_heading_pitch_and_roll
					(
						inst3d,
						OBJECT_3D_SUB_OBJECT_FIXED_WHEEL_MOVING,
						blurred_flag,
						0.0, delta_pitch, 0.0
					) )
	{
		activate_and_modify_sub_object_type_heading_pitch_and_roll
					(
						inst3d,
						OBJECT_3D_SUB_OBJECT_FIXED_WHEEL,
						!blurred_flag,
						0.0, delta_pitch, 0.0
					);
	}
	else
	{
		activate_and_modify_sub_object_type_heading_pitch_and_roll
					(
						inst3d,
						OBJECT_3D_SUB_OBJECT_FIXED_WHEEL,
						TRUE,
						0.0, delta_pitch, 0.0
					);
	}

	// steerable
	if ( activate_and_modify_sub_object_type_heading_pitch_and_roll
					(
						inst3d,
						OBJECT_3D_SUB_OBJECT_STEERABLE_WHEEL_MOVING,
						blurred_flag,
						0.0, delta_pitch, 0.0
					) )
	{
		activate_and_modify_sub_object_type_heading_pitch_and_roll
					(
						inst3d,
						OBJECT_3D_SUB_OBJECT_STEERABLE_WHEEL,
						!blurred_flag,
						0.0, delta_pitch, 0.0
					);
	}
	else
	{
		activate_and_modify_sub_object_type_heading_pitch_and_roll
					(
						inst3d,
						OBJECT_3D_SUB_OBJECT_STEERABLE_WHEEL,
						TRUE,
						0.0, delta_pitch, 0.0
					);
	}

	//
	// animate track textures
	//

	if ( speed > 0.0 )
	{
		//
		// debug articulation test
		//

		advance_texture_animation_frame_on_object( inst3d, TEXTURE_ANIMATION_INDEX_TRAK0 );
	}
}
Ejemplo n.º 4
0
static void draw_local_3d_object (entity *en, float range)
{
	helicopter
		*raw;

	int
		internal_view;

	raw = get_local_entity_data (en);

	//
	// the player's gunship is visible from the menus - where the in_cockpit flag is invalid
	//

	if (en == get_gunship_entity ())
	{
		internal_view = ((in_cockpit) && (get_in_flight_game_mode () == IN_FLIGHT_GAME_MODE_SIMULATOR));
	}
	else
	{
		internal_view = FALSE;
	}

	////////////////////////////////////////
	//
	// SORT COMANCHE AND HOKUM INSTANCES
	//
	// It is necessary to switch parts on and off for all Comanche and Hokum instances
	// because the player can change gunship so the instances need to be fixed up.
	//
	////////////////////////////////////////

	{
		int
			draw_virtual_cockpit_parts,
			draw_canopy_doors,
			draw_loading_doors,
			ejected;

		object_3d_sub_object_search_data
			search;

		if (raw->ac.object_3d_shape == OBJECT_3D_RAH66)
		{
			////////////////////////////////////////
			//
			// Comanche
			//
			////////////////////////////////////////

			//
			// draw 'canopy' doors on player object and 'loading' doors on AI object
			//

			draw_virtual_cockpit_parts = FALSE;

			draw_canopy_doors = FALSE;

			draw_loading_doors = FALSE;

			if (en == get_gunship_entity ())
			{
				draw_canopy_doors = TRUE;

				if (internal_view)
				{
					draw_virtual_cockpit_parts = TRUE;
				}
			}
			else
			{
				draw_loading_doors = TRUE;
			}

			//
			// fuselage
			//

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_RAH66_FUSELAGE;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = !draw_virtual_cockpit_parts;
			}

			//
			// canopy/loading doors
			//

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_CANOPY_DOORS;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_canopy_doors;
			}

			search.search_depth = 1;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_CANOPY_DOORS;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_canopy_doors;
			}

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_LOADING_DOOR;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_loading_doors;
			}

			search.search_depth = 1;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_LOADING_DOOR;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_loading_doors;
			}
		}
		else if (raw->ac.object_3d_shape == OBJECT_3D_KA_52)
		{
			////////////////////////////////////////
			//
			// Hokum
			//
			////////////////////////////////////////

			//
			// draw 'canopy' doors on player object and 'loading' doors on AI object
			//

			ejected = get_local_entity_int_value (en, INT_TYPE_EJECTED);

			draw_virtual_cockpit_parts = FALSE;

			draw_canopy_doors = FALSE;

			draw_loading_doors = FALSE;

			if (en == get_gunship_entity ())
			{
				if (!ejected)
				{
					draw_canopy_doors = TRUE;
				}

				if (internal_view)
				{
					draw_virtual_cockpit_parts = TRUE;
				}
			}
			else
			{
				if (!ejected)
				{
					draw_loading_doors = TRUE;
				}
			}

			//
			// stub wings
			//

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_KA52_WINGS;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_virtual_cockpit_parts;
			}

			//
			// fuselage
			//

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_KA52_FUSELAGE;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = !draw_virtual_cockpit_parts;
			}

			//
			// canopy/loading doors
			//

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_CANOPY_DOORS;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_canopy_doors;
			}

			search.search_depth = 1;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_CANOPY_DOORS;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_canopy_doors;
			}

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_LOADING_DOOR;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_loading_doors;
			}

			search.search_depth = 1;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_LOADING_DOOR;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = draw_loading_doors;
			}

			//
			// ejector seats & crew
			//

			search.search_depth = 0;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_KA52_EJECTOR_SEAT;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = !ejected;
			}

			search.search_depth = 1;
			search.search_object = raw->ac.inst3d;
			search.sub_object_index = OBJECT_3D_SUB_OBJECT_KA52_EJECTOR_SEAT;

			if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
			{
				search.result_sub_object->visible_object = !ejected;
			}
		}
	}

	////////////////////////////////////////

	if (en == get_gunship_entity ())
	{
		//
		// update viewpoint
		//

		raw->ac.inst3d->vp.position = raw->ac.mob.position;

		memcpy (&raw->ac.inst3d->vp.attitude, &raw->ac.mob.attitude, sizeof (matrix3x3));

		//
		// animate
		//

		if (!internal_view)
		{
			if (raw->main_rotor_damaged)
			{
				animate_damaged_helicopter_main_rotors (en, TRUE);
			}
			else
			{
				animate_helicopter_main_rotors (en, TRUE, FALSE);
			}
		}

		animate_helicopter_tail_rotor (en);

		animate_helicopter_wipers (en);

		animate_helicopter_eo (en);

		animate_aircraft_loading_doors (en);

		animate_aircraft_cargo_doors (en);

		animate_aircraft_undercarriage (en);

		animate_aircraft_weapon_system_ready (en);

		animate_aircraft_shadow (en);

		animate_aircraft_rudder (en);

		raw->ac.inst3d->object_internal_lighting = object_internal_lighting_valid (en);

		raw->ac.inst3d->object_sprite_lights = (raw->ac.inst3d->object_internal_lighting && sprite_light_valid (en));

		//
		// draw
		//

		if (!internal_view)
		{
			if (!in_flight_invisible_object)
			{
				animate_and_draw_entity_muzzle_flash_effect (en);

				insert_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_OBJECT, raw->ac.inst3d);
			}
		}
		else
		{
			if (get_comanche_hokum_gunship ())
			{
				if (get_global_draw_cockpit_graphics ())
				{
					if (!get_global_glass_cockpit ())
					{
						if
						(
							(get_view_mode () == VIEW_MODE_VIRTUAL_COCKPIT_CREW) ||
							(get_global_cockpit_detail_level () == COCKPIT_DETAIL_LEVEL_HIGH)
						)
						{
							animate_and_draw_entity_muzzle_flash_effect (en);

							raw->ac.inst3d->vp.position = virtual_cockpit_inst3d->vp.position;

							memcpy (&raw->ac.inst3d->vp.attitude, &virtual_cockpit_inst3d->vp.attitude, sizeof (matrix3x3));

							insert_relative_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_ZBUFFERED_OBJECT, &raw->ac.inst3d->vp.position, raw->ac.inst3d);
						}
					}
				}
			}
		}
	}
	else
	{
		//
		// update viewpoint
		//

		raw->ac.inst3d->vp.position = raw->ac.mob.position;

		memcpy (&raw->ac.inst3d->vp.attitude, &raw->ac.mob.attitude, sizeof (matrix3x3));

		//
		// animate
		//

		if (get_local_entity_int_value (en, INT_TYPE_ALIVE))
		{
			animate_helicopter_main_rotors (en, FALSE, FALSE);
		}
		else
		{
			animate_damaged_helicopter_main_rotors (en, FALSE);
		}

		animate_helicopter_tail_rotor (en);

		animate_aircraft_loading_doors (en);

		animate_aircraft_cargo_doors (en);

		animate_aircraft_undercarriage (en);

		animate_aircraft_weapon_system_ready (en);

		animate_aircraft_shadow (en);

		animate_and_draw_entity_muzzle_flash_effect (en);

		raw->ac.inst3d->object_internal_lighting = object_internal_lighting_valid (en);

		raw->ac.inst3d->object_sprite_lights = (raw->ac.inst3d->object_internal_lighting && sprite_light_valid (en));

		//
		// draw
		//

		insert_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_OBJECT, raw->ac.inst3d);
	}

	////////////////////////////////////////
	//
	// draw comanche and hokum shadows
	//
	////////////////////////////////////////

	if (raw->ac.object_3d_shape == OBJECT_3D_RAH66)
	{
		object_3d_instance
			*shadow_object;

		shadow_object = construct_temporary_3d_object (OBJECT_3D_RAH66_FUSELAGE, FALSE);

		shadow_object->vp = raw->ac.inst3d->vp;

		insert_object_shadow_into_3d_scene (shadow_object);
	}
	else if (raw->ac.object_3d_shape == OBJECT_3D_KA_52)
	{
		object_3d_instance
			*shadow_object;

		shadow_object = construct_temporary_3d_object (OBJECT_3D_KA_52_FUSELAGE, FALSE);

		shadow_object->vp = raw->ac.inst3d->vp;

		insert_object_shadow_into_3d_scene (shadow_object);
	}

	////////////////////////////////////////

	#if DEBUG_MODULE

	if (en == get_external_view_entity ())
	{
		draw_mobile_entity_debug_info (en);
	}

	#endif
}
Ejemplo n.º 5
0
static entity *create_local (entity_types type, int index, char *pargs)
{
	entity
		*en;

	weapon
		*raw;

	int
		seed;

	viewpoint
		vp;

	////////////////////////////////////////
  	//
  	// VALIDATE
  	//
	////////////////////////////////////////

	validate_local_create_entity_index (index);

	#if DEBUG_MODULE

	debug_log_entity_args (ENTITY_DEBUG_LOCAL, ENTITY_DEBUG_CREATE, NULL, type, index);

	#endif

	en = get_free_entity (index);

	if (en)
	{
		float dispersion;

		////////////////////////////////////////
   	//
   	// MALLOC ENTITY DATA
   	//
		////////////////////////////////////////

		set_local_entity_type (en, type);

		raw = (weapon *) malloc_fast_mem (sizeof (weapon));

		set_local_entity_data (en, raw);

		////////////////////////////////////////
   	//
   	// INITIALISE ALL ENTITY DATA TO 'WORKING' DEFAULT VALUES
		//
		// DO NOT USE ACCESS FUNCTIONS
		//
		// DO NOT USE RANDOM VALUES
		//
		////////////////////////////////////////

		memset (raw, 0, sizeof (weapon));

		//
		// mobile
		//

		raw->mob.sub_type = ENTITY_SUB_TYPE_UNINITIALISED;

		raw->mob.position.x = MID_MAP_X;
		raw->mob.position.y = MID_MAP_Y;
		raw->mob.position.z = MID_MAP_Z;

		get_identity_matrix3x3 (raw->mob.attitude);

		raw->mob.alive = TRUE;

		//
		// weapon
		//

		raw->kill_code = WEAPON_KILL_CODE_OK;

		////////////////////////////////////////
		//
		// OVERWRITE DEFAULT VALUES WITH GIVEN ATTRIBUTES
		//
		////////////////////////////////////////

		set_local_entity_attributes (en, pargs);

		////////////////////////////////////////
		//
		// CHECK MANDATORY ATTRIBUTES HAVE BEEN GIVEN
		//
		////////////////////////////////////////

		ASSERT (entity_sub_type_weapon_valid (raw->mob.sub_type));

		ASSERT (raw->launched_weapon_link.parent);

		ASSERT (raw->burst_size > 0);

		////////////////////////////////////////
		//
		// RESOLVE DEFAULT VALUES
		//
		////////////////////////////////////////

		if (weapon_database[raw->mob.sub_type].acquire_parent_forward_velocity)
		{
			raw->mob.velocity = get_local_entity_float_value (raw->launched_weapon_link.parent, FLOAT_TYPE_VELOCITY);
		}
		else
		{
			//
			// overwrite attribute
			//

			raw->mob.velocity = 0.0;
		}

		raw->mob.velocity += weapon_database[raw->mob.sub_type].muzzle_velocity;

		seed = get_client_server_entity_random_number_seed (en);

		raw->mob.velocity += weapon_database[raw->mob.sub_type].muzzle_velocity_max_error * frand1x (&seed);

		raw->weapon_lifetime = weapon_database[raw->mob.sub_type].burn_time;

		raw->decoy_timer = get_decoy_timer_start_value (weapon_database[raw->mob.sub_type].decoy_type);

		//
		// detach weapon from launcher (get position and attitude)
		//

		detach_local_entity_weapon (raw->launched_weapon_link.parent, raw->mob.sub_type, raw->burst_size, &vp);

		raw->mob.position = vp.position;

		// arneh - add dispersion as random rotation in heading and pitch up to max error angle
		dispersion = weapon_database[raw->mob.sub_type].max_range_error_ratio;
		if (dispersion > 0.0)
		{
			matrix3x3
				m;

			float
				heading = dispersion * sfrand1norm(),
				pitch = dispersion * sfrand1norm();

			get_3d_transformation_matrix(m, heading, pitch, 0.0);
			multiply_matrix3x3_matrix3x3(raw->mob.attitude, vp.attitude, m);
		}
		else
			memcpy (raw->mob.attitude, vp.attitude, sizeof (matrix3x3));

		//
		// interest level
		//

		set_local_entity_float_value (raw->launched_weapon_link.parent, FLOAT_TYPE_VIEW_INTEREST_LEVEL, DEFAULT_VIEW_INTEREST_LEVEL);

		////////////////////////////////////////
		//
		// LINK INTO SYSTEM
		//
		////////////////////////////////////////

		insert_local_entity_into_parents_child_list (en, LIST_TYPE_LAUNCHED_WEAPON, raw->launched_weapon_link.parent, NULL);

		if (raw->mob.target_link.parent)
		{
			insert_local_entity_into_parents_child_list (en, LIST_TYPE_TARGET, raw->mob.target_link.parent, NULL);
		}

		insert_local_entity_into_parents_child_list (en, LIST_TYPE_SECTOR, get_local_sector_entity (&raw->mob.position), NULL);

		insert_local_entity_into_parents_child_list (en, LIST_TYPE_UPDATE, get_update_entity (), NULL);

		if (tacview_is_logging())
			write_tacview_new_unit(en);

		//
		// check if the weapon camera is primed and this weapon has been launched by the external view entity
		//

		if (get_camera_entity ())
		{
			if (get_local_entity_int_value (get_camera_entity (), INT_TYPE_WEAPON_CAMERA_PRIMED))
			{
				if (raw->launched_weapon_link.parent == get_external_view_entity ())
				{
					if (get_local_entity_int_value (en, INT_TYPE_VIEWABLE_WEAPON))
					{
						notify_local_entity (ENTITY_MESSAGE_SET_CAMERA_ACTION, get_camera_entity (), NULL, CAMERA_ACTION_WEAPON);

						set_local_entity_int_value (get_camera_entity (), INT_TYPE_WEAPON_CAMERA_PRIMED, FALSE);
					}
				}
			}
		}
	}

	return (en);
}