亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? movemethods.java

?? 一個由c轉成java的3D robot 仿真平臺
?? JAVA
字號:
/************************************************************************//* File: ~/sopra/RoboPackII/MoveMethods.java                              *//* This file consists of the methods which make the robot move around.  *//************************************************************************/package RoboPackII;final class AllAboutMoving{	/* This class provides the 'main class' with the needed        */	/* move and move-supporting methods.		               */	public static void calculateAngle(double[] input, double[] aB,		double[] aE, RefInt stepsB, RefInt stepsE, RoboProto rob)	   /* stepsB and -E should be call-by-reference arguments, so it   */	   /* is sensible to declare them as RefInt (see SmallClasses.     */	   /* java). That means that a reference to the object is passed.  */	{	   double angleMax, angleDiffB, angleDiffE;	   double a, b, v;	   int iMax, i;	   int X;           for (i = 0; i < 6; i++)             {               aE[i] = 0.0;               aB[i] = 0.0;             }                              /* Determination of the largest angle */           iMax = 0;           angleMax = Math.abs(input[0]);           for (i = 1; i < 6; i++)             {               if ( angleMax < Math.abs(input[i]) )		 {                   iMax = i;                   angleMax = Math.abs( input[i]);                 }              }              if ( angleMax != 0.0 )             {               /* Determination of angleDiffB. */               angleDiffB = (( rob.power[iMax] * ( rob.power[iMax] + 1 )) 				/ 2.0 ) * ( Math.PI / 180.0 );                /* Case decision */               if ( (angleDiffB * 2.0) >= Math.abs(input[iMax]) )                 {		   /* It doesn't exist a final speed. */                   aE[iMax] = 0.0;                   stepsE.in = 0;                   X = (int)( Math.abs(input[iMax]) / ( Math.PI/180.0));                   stepsB.in = (int)((1.0 + Math.sqrt( 1.0 + 4.0 * X)) / 2.0);                   if (stepsB.in == 0)		     stepsB.in = 1;                    aB[iMax] = input[iMax] /			 ((stepsB.in) * ((stepsB.in) + 1.0 ) );                   for ( i=0; i<6; i++ )                     {                       if ( i != iMax )                         {                           aE[i] = 0.0;                           aB[i] = input[i] / ((stepsB.in) * 					    ( (stepsB.in) + 1.0 ));                          }                     }                    }                else                  { 	            /*It exists a final speed. */                      stepsB.in = rob.power[iMax];                    angleDiffE = Math.abs(input[iMax]) - ( angleDiffB * 2.0 );                    v = angleDiffB / angleDiffE;                    for (i = 0; i < 6; i++)                      {                        if ( i != iMax )                          {                            a = input[i] / ( 2.0 + ( 2.0 / v ));                            b = input[i] - 2.0 * a;                            aB[i] = a / ((rob.power[iMax] * 					 (rob.power[iMax] + 1.0)) / 2.0);                            aE[i] = b;                          }                        else                          {                            if ( input[iMax] >= 0.0 ) 			      {                                aB[iMax] = Math.PI/180.0;                                aE[iMax] = angleDiffE;                              }                            else 			      {                                aB[iMax] = -Math.PI/180.0;                                aE[iMax] = -angleDiffE;                              }                             stepsE.in = (int)( angleDiffE /					(rob.power[iMax] * Math.PI/180.0));                                              } // else...                      } // for...                    } // else...                } // if (angleMax != 0)...	}	public static void MoveRobo (boolean showTheMove, Points[] pl, 		Points[] line, double[] moveAngle,AngleDates[] angle,		int steps, RefInt errorcode, RefDouble angleY, 		RefDouble angleX, RefDouble d, int show, RefInt indx, 		double[] location, RoboProto rob)	   /* line consists of 2 elements, angle of 6 and location of 3     */	   /* errorcode, angleY, angleX, d and indx should be of my special */	   /* types, since these variables simulate call-by-reference-      */	   /* arguments							    */	{ 	  int i,j; 	  double[] offset = new double[6]; 	  int reminder; 	  double[] input = new double[9]; 	  String[] estring = new String[2];	  reminder = 0;   	  if ( steps == 0 )	    steps = 1;	  for ( i=0 ; i<6 ; i++ ) 	    { 	      offset[i] = moveAngle[i] / steps; 	    } 	  errorcode.in = 0; 	  for (i = 0; i < steps; i++ )  	    {   	  if (errorcode.in == 0 )   	    {  	      if ( offset[0] != 0.0 )	        {   	          RotationY ( pl,offset[0],44,110, rob );                  reminder = 23;                }    	      if ( offset[1] != 0.0 ) 		{                   RotationK ( pl,offset[1],rob.el[86],66,88, rob );                  if ( reminder == 0 ) 		    reminder = 43;                }   	      if ( offset[2] != 0.0 ) 		{                  RotationK ( pl,offset[2],rob.el[128],96,58, rob );                  if ( reminder == 0 ) 		    reminder = 59;                 }   	      if ( offset[3] != 0.0 ) 		{                  RotationK ( pl,offset[3],rob.el[153],114,40, rob );                  if ( reminder == 0 ) 		    reminder = 70;                }   	      if ( offset[4] != 0.0 ) 		{                  RotationK ( pl,offset[4],rob.el[154],116,38, rob );                  if ( reminder == 0 )		     reminder = 70;                }  	      if ( offset[5] != 0.0 )		{                  RotationK ( pl,offset[5],rob.el[180],134,20, rob );                  if ( reminder == 0 )		    reminder = 84;                }     	      if ( reminder != 0 )		 Nvector (pl,rob.al,rob.apl,reminder, rob);   	      for (j=0; j < 6; j++)    	        angle[j].act = angle[j].act + offset[j];           	      if (Crash(pl,rob.rpl, rob))		{ 		  for ( j=0 ; j<6 ; j++ )		    offset[j] = -offset[j];                  PosRobo(pl,offset,angle, rob);                  errorcode.in = 1;                  }	      if ( show == 1 )    		{   		  if ( rob.fFile == 2 && rob.f_Z_B == 0 && rob.f_Z_R == 0)   		    {     		      if ( !((rob.akt) < indx.in))     			{      			  // file_handle (&j,input,estring,rob.BListe,indx,1,			  //	location,angleY,angleX,d);not available   		        }     		      if ( rob.f_Z_B == 0 && rob.f_Z_R == 0)     			{      			  angleY.in = rob.BListe[rob.akt].y;      			  angleX.in = rob.BListe[rob.akt].x;      			  d.in = rob.BListe[rob.akt].z;   			  rob.akt++;     			}   		    }    		  if (showTheMove)		    rob.repaint();		} // if (show == 1)...   	    } // if (errorcode == 0)... 	    } 	}	public static void RotationY(Points[] pl, double angle, int start,				     int number, RoboProto rob)	{	  int i;	  double x, z;	  double cosinus, sinus;		  cosinus = Math.cos(angle);	  sinus = Math.sin(angle);		  for (i = start; i < start + number; i++)	    {	      x = cosinus * pl[i].x + sinus * pl[i].z;	      z = cosinus * pl[i].z - sinus * pl[i].x;	      pl[i].x = x;	      pl[i].z = z;	      rob.animation.setVert(i, pl[i]);// the new coordinates are					      // set in the drawing class	    }	}	public static void RotationK (Points[] pl, double angle, Edges axis,			int start, int number, RoboProto rob )	{	  int i;	  double cosinus,sinus,v0; 	  double r00,r01,r02,r03,   	         r10,r11,r12,r13,     	         r20,r21,r22,r23; 	  double kx,ky,kz,px,py,pz;	  double kxx,kxy,kxz,kyy,kyz,kzz;	  cosinus = Math.cos(angle);	  sinus = Math.sin(angle); 	  v0 = 1 - cosinus;	  px = pl[axis.p1].x;	  py = pl[axis.p1].y;	  pz = pl[axis.p1].z; 	  kx = pl[axis.p2].x - px; 	  ky = pl[axis.p2].y - py; 	  kz = pl[axis.p2].z - pz; 	  kxx = kx * kx * v0; 	  kxy = kx * ky * v0; 	  kxz = kx * kz * v0; 	  kyz = ky * kz * v0;	  kyy = ky * ky * v0; 	  kzz = kz * kz * v0;  	  r00 = kxx + cosinus;	  r10 = kxy + kz * sinus; 	  r20 = kxz - ky *sinus;	  r01 = kxy - kz * sinus; 	  r11 = kyy + cosinus;	  r21 = kyz + kx * sinus;	  r02 = kxy + ky * sinus;	  r12 = kyz - kx * sinus;	  r22 = kzz + cosinus; 	  r03 = r00 * (-px) - r01 * py - r02 * pz + px;	  r13 = r10 * (-px) - r11 * py - r12 * pz + py;	  r23 = r20 * (-px) - r21 * py - r22 * pz + pz; 	  for ( i = start; i < start + number; i++ ) 	    {  	      kx = r00 * pl[i].x + r01 * pl[i].y + r02 * pl[i].z + r03; 	      ky = r10 * pl[i].x + r11 * pl[i].y + r12 * pl[i].z + r13;  	      kz = r20 * pl[i].x + r21 * pl[i].y + r22 * pl[i].z + r23; 	      pl[i].x = kx;  	      pl[i].y = ky;  	      pl[i].z = kz;	      rob.animation.setVert(i, pl[i]);// the new coordinates are					      // set in the drawing class  	    }	}	public static void Nvector (Points[] pl, Areas[] al,		AreasPointsList[] apl, int start, RoboProto rob )	{	  double hilf;	  int i; 	  double hx,hy,hz;	     /* Calculation of the areas parameters */	  for ( i=start; i < rob.numberOfAreas; i++ ) 	    {  	      hx = pl[al[i].p1].y * ( pl[al[i].p2].z - pl[al[i].p3].z )    		  +pl[al[i].p2].y * ( pl[al[i].p3].z - pl[al[i].p1].z )    		  +pl[al[i].p3].y * ( pl[al[i].p1].z - pl[al[i].p2].z );   	      hy = pl[al[i].p1].z * ( pl[al[i].p2].x - pl[al[i].p3].x )    	   	  +pl[al[i].p2].z * ( pl[al[i].p3].x - pl[al[i].p1].x )    		  +pl[al[i].p3].z * ( pl[al[i].p1].x - pl[al[i].p2].x );  	      hz = pl[al[i].p1].x * ( pl[al[i].p2].y - pl[al[i].p3].y )   		   +pl[al[i].p2].x * ( pl[al[i].p3].y - pl[al[i].p1].y )   		   +pl[al[i].p3].x * ( pl[al[i].p1].y - pl[al[i].p2].y );	 	      hilf = Math.sqrt( (hx) * (hx) + (hy) * (hy) + (hz) * (hz) );  	      apl[i].nx = hx / hilf;  	      apl[i].ny = hy / hilf;	      apl[i].nz = hz / hilf;	    }	}	public static boolean Crash(Points[] pl, int[] rpl, RoboProto rob)   	{ 	  int i; 	  /* --------------------------------    	     Tests, if crash with socket and   	     area happens    	    -------------------------------- */ 	  for (i=0; i < 14 ;i++)  	    {    	      if (( Math.abs(pl[rpl[i]].x) < 4.5 &&                    Math.abs(pl[rpl[i]].y) < 3.0 &&                    Math.abs(pl[rpl[i]].z) < 4.5 ) ||                  pl[rpl[i]].y < -0.05   ) 	      return true;   	    } 	  /* ---------------------------------   	   Tests, if robot crashes against link1.   	     --------------------------------- */  	  for ( i=2 ; i<14 ; i++ ) 	    {  	      if ( Math.abs(pl[rpl[i]].x) <= 1.3 &&    	           Math.abs(pl[rpl[i]].z) <= 1.3 &&      		   pl[rpl[i]].y <= rob.linkLengths[0] + 0.5 )	      return true; 	    }	  return false;	}	public static void PosRobo (Points[] pl,double[] turnangle,			AngleDates[] angle, RoboProto rob)	{ 	  int j;  	  if ( turnangle[0] != 0.0 ) 	    RotationY ( pl,turnangle[0],44,110, rob );  	  if ( turnangle[1] != 0.0 ) 	    RotationK ( pl,turnangle[1],rob.el[86],66,88, rob );   	  if ( turnangle[2] != 0.0 )	    RotationK ( pl,turnangle[2],rob.el[128],96,58, rob );   	  if ( turnangle[3] != 0.0 ) 	    RotationK ( pl,turnangle[3],rob.el[153],114,40, rob );  	  if ( turnangle[4] != 0.0 ) 	    RotationK ( pl,turnangle[4],rob.el[154],116,38, rob);  	  if ( turnangle[5] != 0.0 ) 	    RotationK ( pl,turnangle[5],rob.el[180],134,20, rob );    	  for ( j=0 ; j<6 ; j++ )   	   angle[j].act = angle[j].act + turnangle[j];      	}	public static void angleCalculation(double x, double y, double z,			RefDouble angleY, RefDouble angleX, RefDouble d )	    // x:      new projection center	    // angleY: Rotation angle around y-axis	    // angleX: Rotation angle around x-axis	    // d:      Position on the z-axis	{ 	  double amount;	  double hx,hy,hz; 	  amount = Math.sqrt ( x*x + z*z ); 	  /* Calculation of the angle amount of  angleY */ 	  if ( amount == 0 ) 	    {              angleY.in = 0.0;            }	  else             {              angleY.in = Math.acos( z / amount );            } 	  /* Calculation of the sign of angleY */	  if (  x > 0 )	    angleY.in = -angleY.in; 	  /* Rotation around the y-axis */	  hx = Math.cos(angleY.in)*x + Math.sin(angleY.in)*z; 	  hy = y; 	  hz = Math.cos(angleY.in)*z - Math.sin(angleY.in)*x; 	  amount = Math.sqrt ( hx*hx + hy*hy + hz*hz ); 	  /* Calculation of the angle amount of angleX */ 	  angleX.in = Math.acos( hz/amount ); 	  /* Calculation of the sign of angleX */ 	  if ( hy < 0 ) 	    angleX.in = -angleX.in; 	  /* Rotation around the x-axis */ 	  x = hx; 	  y = Math.cos(angleX.in)*hy - Math.sin(angleX.in)*hz; 	  z = Math.sin(angleX.in)*hy + Math.cos(angleX.in)*hz; 	  /* Test, if the new projection center is close enough 	     to the z-axis					*/ 	  if ((Math.abs(x)<0.01)&&(Math.abs(y)<0.01))               d.in = z; 	  else                       {              System.exit(1);            }      	}	public static void copyPointList (Points[] PL, Points[] pl, 								RoboProto rob )	{	  int i; 	  for (i=0; i < rob.numberOfPoints; i++ ) 	    {  	      pl[i].x = PL[i].x;  	      pl[i].y = PL[i].y;  	      pl[i].z = PL[i].z; 	    }	}	public static void calculateLocation(double[] location,			double angleY, double angleX )	{	  double x,y,z; 	  x = Math.cos(angleY) * location[0] + 	      Math.sin(angleY) * Math.sin(angleX) * location[1] +	      Math.sin(angleY) * Math.cos(angleX) * location[2]; 	  y = Math.cos(angleX) * location[1] - Math.sin(angleX) * location[2]; 	  z = -Math.sin(angleY) * location[0] + 	      Math.cos(angleY) * Math.sin(angleX) * location[1] + 	      Math.cos(angleY) * Math.cos(angleX) * location[2]; 	  location[0] = x; 	  location[1] = y; 	  location[2] = z;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区中文字幕电影| 成人一级黄色片| 国产在线视频一区二区| 99re6这里只有精品视频在线观看| 欧美日韩成人在线一区| 日本一区二区免费在线观看视频| 亚洲男同性视频| 国产精品1区2区| 日韩三级在线观看| 亚洲亚洲人成综合网络| 成人黄色电影在线| 久久综合久久综合亚洲| 婷婷一区二区三区| 在线精品视频免费播放| 一色桃子久久精品亚洲| 九一久久久久久| 制服.丝袜.亚洲.另类.中文| 亚洲精品乱码久久久久久久久 | 欧美成人高清电影在线| 亚洲午夜精品17c| 日本精品一级二级| 国产精品五月天| 国产麻豆9l精品三级站| 欧美夫妻性生活| 午夜精品福利一区二区蜜股av| 色噜噜狠狠成人中文综合 | 一区二区三区蜜桃网| 不卡一区二区在线| 国产精品毛片久久久久久| 国产一区二区调教| 久久久久久亚洲综合| 国产一区二区精品在线观看| 久久综合色婷婷| 久草这里只有精品视频| 久久蜜桃av一区二区天堂| 国产呦精品一区二区三区网站| 欧美大片免费久久精品三p| 美女视频黄免费的久久| 欧美videos中文字幕| 国产乱码精品一区二区三区忘忧草 | 精品国产不卡一区二区三区| 麻豆精品蜜桃视频网站| 精品处破学生在线二十三| 国产精一品亚洲二区在线视频| 精品国产伦一区二区三区观看体验 | 色偷偷成人一区二区三区91| 一区二区三区久久| 欧美高清视频在线高清观看mv色露露十八| 亚洲一区在线观看免费| 6080亚洲精品一区二区| 精品一区二区久久| 亚洲欧美综合色| 欧美在线影院一区二区| 麻豆国产精品官网| 国产精品毛片久久久久久久| 日本福利一区二区| 蜜臀av一区二区三区| 国产精品天天看| 欧美中文字幕不卡| 日本女人一区二区三区| 久久久久国产成人精品亚洲午夜| 成人看片黄a免费看在线| 亚洲国产综合在线| www国产精品av| 一本色道a无线码一区v| 免费在线观看精品| 成人免费在线播放视频| 91精品国产综合久久久久久| 国产精品一区在线| 亚洲18影院在线观看| 久久综合久久久久88| 色8久久精品久久久久久蜜| 蜜桃视频在线观看一区二区| 国产视频在线观看一区二区三区| 欧洲亚洲国产日韩| 国产精品99久久久久久宅男| 亚洲国产精品久久不卡毛片| 久久网站热最新地址| 欧美日韩国产成人在线免费| 成人污污视频在线观看| 麻豆一区二区在线| 亚洲综合色区另类av| 欧美激情一区二区| 欧美α欧美αv大片| 精品国产乱码久久久久久免费| 91亚洲精华国产精华精华液| 狠狠色伊人亚洲综合成人| 亚洲靠逼com| 国产欧美精品一区二区三区四区 | 成人sese在线| 国产精品影视天天线| 日韩电影在线免费观看| 亚洲欧美综合在线精品| 久久九九99视频| 日韩一级完整毛片| 欧美日韩国产美| 色婷婷亚洲精品| 成人黄色在线看| 国产成人综合网| 国内外成人在线| 麻豆精品一二三| 青青草原综合久久大伊人精品 | 中文字幕制服丝袜成人av | 成人午夜在线免费| 黄色成人免费在线| 久久精品二区亚洲w码| 视频一区视频二区中文字幕| 亚洲欧美日韩人成在线播放| 中文字幕一区二区三区精华液| 久久久国产精品午夜一区ai换脸| www一区二区| 国产视频一区在线播放| 国产区在线观看成人精品 | 日韩黄色片在线观看| 午夜影院久久久| 午夜国产精品一区| 日韩中文字幕一区二区三区| 亚洲成av人片一区二区梦乃 | 国产传媒欧美日韩成人| 国产不卡高清在线观看视频| 国产一二精品视频| 国产91清纯白嫩初高中在线观看 | 久久成人免费日本黄色| 久久99这里只有精品| 狠狠色丁香九九婷婷综合五月| 国产乱码精品一品二品| 福利一区在线观看| 色综合视频在线观看| 欧美日韩国产在线观看| 日韩一区二区在线观看视频播放| 欧美大片日本大片免费观看| 国产午夜精品久久| 亚洲免费看黄网站| 亚洲国产欧美另类丝袜| 久久激情综合网| 国产精品原创巨作av| 91美女在线视频| 91精品综合久久久久久| 久久久国产精品麻豆| 亚洲摸摸操操av| 久久国产精品区| 波多野结衣中文字幕一区| 在线观看国产精品网站| 91精品国产色综合久久久蜜香臀| 久久无码av三级| 亚洲一区二区三区四区五区黄| 蜜桃久久久久久久| 91一区二区在线| 日韩精品一区二区三区四区 | 久久激五月天综合精品| eeuss鲁片一区二区三区在线观看| 欧美系列日韩一区| 久久精品网站免费观看| 亚洲一区免费视频| 国产九色精品成人porny| 欧美色电影在线| 国产欧美日产一区| 日韩av中文字幕一区二区 | 国产91在线看| 制服丝袜日韩国产| 亚洲三级电影网站| 国产精品综合在线视频| 欧美人与性动xxxx| 中文字幕在线播放不卡一区| 激情综合网天天干| 欧美怡红院视频| 国产精品久久久久久久久久久免费看 | 亚洲成人福利片| 成人av资源在线| 欧美变态tickling挠脚心| 亚洲综合久久av| jlzzjlzz亚洲女人18| 国产偷v国产偷v亚洲高清| 日韩精品乱码免费| 91久久一区二区| 国产精品护士白丝一区av| 国产在线精品国自产拍免费| 欧美日韩一区成人| 亚洲欧美日韩电影| 成人免费观看男女羞羞视频| 精品理论电影在线观看| 蜜臀久久99精品久久久久久9| 欧美日韩国产大片| 亚洲成人激情社区| 在线观看www91| 亚洲精品一二三| 91丨九色丨尤物| 亚洲欧美区自拍先锋| 91在线云播放| 日韩美女视频一区| 91影院在线免费观看| 国产精品久久久久久久久久久免费看 | 中文字幕乱码亚洲精品一区| 国产乱人伦偷精品视频免下载| 日韩欧美精品在线| 麻豆一区二区在线| 欧美mv日韩mv国产网站app| 日韩电影免费在线| 欧美一区二区日韩| 久久国产精品色|