
var keine_objecte = 0;
var old_obj_count;


void update_huelle()
{
	wait(1);
	
	//set(my,POLYGON);
	//ent_fixnormals(my,1);
	//c_setminmax (my);
	ent_setskin(my,standart_object_textur,1);
}




void create_obj()
{
	ANGLE winkel;
	var counter = 0;
	Edit_Object_count = hData.object_block_count;
	Edit_object_Clone = hData.object_block_count;
	var i = 0;	
	warn_level = 0;
	collision_mode = 0;
	int listpos = 5;
		for(i = 0 ; i < hData.object_block_count; i++)
		{
			
			
			
			var vec_x = objData[i].vec_pos_x;
			var vec_y = objData[i].vec_pos_y;
			var vec_z = objData[i].vec_pos_z;
			
			VECTOR* Angel_1 = vec_normalize(vector(objData[i].vec_vel_x,objData[i].vec_vel_z,objData[i].vec_vel_y),1);
			
			vec_to_angle (winkel, Angel_1);
			
			//STRING* objname = str_create(str_for_int(NULL,0));
			STRING* objname = str_create(ObjectsDir);
			STRING* obj_test_id = str_create(str_for_int(NULL,objData[i].map_object_id));
			str_cat(objname,"0");
			str_cat(objname,str_for_int(NULL,objData[i].map_object_id));
			
			str_cat(objname,".mdl");
		
			//printf(_chr(objname));
			map_objects[i] = ent_create(objname,vector(vec_x,vec_z,vec_y),NULL);
			set(map_objects[i],POLYGON);
			map_objects[i].skill31 = objData[i].map_object_id;
//			pan_setbutton(pannelObjectEditList,0,4,5,listpos,Select,NormalS,Select,NULL,NULL,NULL,NULL); 
			
//var testdigit = pan_setstring(pannelObjectEditList,0,20,listpos+2,font_create("Arial#15"),obj_test_id);
			
//pan_setcolor(pannelObjectEditList,1,testdigit,vector(1,1,1));

//			listpos +=22;
			
			
			map_objects[i].pan = 	winkel.pan -90;
			map_objects[i].roll = 	winkel.tilt;
			map_objects[i].skill21 = i;
			
			
//			c_updatehull(map_objects[i],1);

			
//			map_objects[i].scale_x = 0.025; 
//			map_objects[i].scale_y = 0.025;
//			map_objects[i].scale_z = 0.025;
			
			
		
			


		}
		
		old_obj_count = hData.object_block_count;
	
	//warn_level = 1;	
}
