Exemple #1
0
void ProLoad(short prep, register int *ad, register int *no)
{
	switch(prep)
	{
		case 1: *ad=Me()->it_Adjective;
		        *no=Me()->it_Noun;
			break;

		case 2: *ad=ParserData[ParsingPersona].pa_It[0];
			*no=ParserData[ParsingPersona].pa_It[1];
			break;

		case 3: *ad=ParserData[ParsingPersona].pa_Them[0];
			*no=ParserData[ParsingPersona].pa_Them[1];
			break;

		case 4: *ad=ParserData[ParsingPersona].pa_Him[0];
			*no=ParserData[ParsingPersona].pa_Him[1];
			break;

		case 5: *ad=ParserData[ParsingPersona].pa_Her[0];
			*no=ParserData[ParsingPersona].pa_Her[1];
			break;

		case 6: *ad=ParserData[ParsingPersona].pa_There[0];
			*no=ParserData[ParsingPersona].pa_There[1];
			break;
		default:
			*ad=-1;
			*no=-1;
			break;
	}
}
Exemple #2
0
	/**
	 * transpose the matrix
	 */
	Matrix<N, M> transposed(void) const {
#ifdef CONFIG_ARCH_ARM
		Matrix<N, M> res;
		arm_mat_trans_f32(&this->arm_mat, &res.arm_mat);
		return res;
#else
		matrix::Matrix<float, N, M> Me(this->arm_mat.pData);
		Matrix<N, M> res(Me.transpose().data());
		return res;
#endif
	}
Exemple #3
0
	/**
	 * invert the matrix
	 */
	Matrix<M, N> inversed(void) const {
#ifdef CONFIG_ARCH_ARM
		Matrix<M, N> res;
		arm_mat_inverse_f32(&this->arm_mat, &res.arm_mat);
		return res;
#else
		matrix::Matrix<float, M, N> Me(this->arm_mat.pData);
		matrix::Matrix<float, M, N> MyInverse = Me.inverse(); //not sure if A = A.inverse() is a good idea
		Matrix<M, N> res(MyInverse.data());
		return res;
#endif
	}
Exemple #4
0
moGLMatrixf&
moGLMatrixf::Scale( float sx, float sy, float sz ) {

  moGLMatrixf& Me( *this );
  moGLMatrixf Result = moMatrix4f::IDENTITY;
  Result[0][0] = sx;
  Result[1][1] = sy;
  Result[2][2] = sz;
  Me = Me*Result.Transpose();

  return (*this);
}
Exemple #5
0
	Matrix<M, P> operator *(const Matrix<N, P> &m) const {
#ifdef CONFIG_ARCH_ARM
		Matrix<M, P> res;
		arm_mat_mult_f32(&arm_mat, &m.arm_mat, &res.arm_mat);
		return res;
#else
		matrix::Matrix<float, M, N> Me(this->arm_mat.pData);
		matrix::Matrix<float, N, P> Him(m.arm_mat.pData);
		matrix::Matrix<float, M, P> Product = Me * Him;
		Matrix<M, P> res(Product.data());
		return res;
#endif
	}
Exemple #6
0
moGLMatrixf&
moGLMatrixf::Rotate( float angle, float rx, float ry, float rz ) {

  moGLMatrixf& Me( *this );
  moGLMatrixf Result;
  Result.MakeIdentity();

  moVector3f rotAxe3D( rx, ry, rz );
  rotAxe3D.Normalize();
  rx = rotAxe3D.X();
  ry = rotAxe3D.Y();
  rz = rotAxe3D.Z();
  float c = moMathf::Cos( angle );
  float s = moMathf::Sin( angle );

  if (rz!=0.0 && rx==0.0 && ry==0.0) {

    Result[0][0] = moMathf::Cos( angle );
    Result[0][1] = -moMathf::Sin( angle );
    Result[1][0] = moMathf::Sin( angle );
    Result[1][1] = moMathf::Cos( angle );
    Me = Me*Result.Transpose();

  } else {
    Result[0][0] = rx*rx*(1-c) + c;
    Result[0][1] = rx*ry*(1-c) - rz*s;
    Result[0][2] = rx*rz*(1-c) + ry*s;
    Result[0][3] = 0.0;

    Result[1][0] = rx*ry*(1-c) + rz*s;
    Result[1][1] = ry*ry*(1-c) + c;
    Result[1][2] = ry*rz*(1-c) - rx*s;
    Result[1][3] = 0.0;

    Result[2][0] = rx*rz*(1-c) - ry*s;
    Result[2][1] = ry*rz*(1-c) + rx*s;
    Result[2][2] = rz*rz*(1-c) + c;
    Result[2][3] = 0.0;

    Result[3][0] = 0.0;
    Result[3][1] = 0.0;
    Result[3][2] = 0.0;
    Result[3][3] = 1.0;
    Me = Me*Result.Transpose();
  }

  return (*this);
}
Exemple #7
0
moGLMatrixf&
moGLMatrixf::Translate( float x, float y, float z ) {

  //moVector3f tr = moVector3f( x, y, z);
  moGLMatrixf& Me( *this );
  moGLMatrixf Result;
  Result.MakeIdentity();
  //const moGLMatrixf& m

  Result[0][3] = x;
  Result[1][3] = y;
  Result[2][3] = z;

  Me = Me*Result.Transpose();

	return (*this);
}
Exemple #8
0
moGLMatrixf&
moGLMatrixf::MakeOrthographic( float left, float right, float bottom, float top, float znear, float zfar  ) {
  float r_l = right - left;
  float t_b = top - bottom;
  float f_n = zfar - znear;
  float tx = -(right + left)/r_l;
  float ty = -(top + bottom)/t_b;
  float tz = -(zfar + znear)/f_n;
  MakeIdentity();
  moGLMatrixf& Me( *this );
  moGLMatrixf Result = moMatrix4f::IDENTITY;
  Result.SetRow( 0, moVector4f(   2.0 / r_l,  0.0,        0.0,        tx ) );
  Result.SetRow( 1, moVector4f(   0.0,        2.0 / t_b,  0.0,        ty ) );
  Result.SetRow( 2, moVector4f(   0.0,        0.0,        -2.0 / f_n, tz ) );

  Me = Me * (Result.Transpose());
  return (*this);
}
Exemple #9
0
moGLMatrixf&
moGLMatrixf::MakeFrustrum( float left, float right, float bottom, float top, float znear, float zfar  ) {
  float r_l = right - left;
  float t_b = top - bottom;
  float f_n = zfar - znear;
  float A = (right + left)/r_l;
  float B = (top + bottom)/t_b;
  float C = -(zfar + znear)/f_n;
  float D = -2*(zfar*znear)/f_n;

  MakeIdentity();
  moGLMatrixf& Me( *this );
  moGLMatrixf Result = moMatrix4f::IDENTITY;
  Result.SetRow( 0, moVector4f(   2.0 * znear / r_l,  0.0,                A,        0.0 ) );
  Result.SetRow( 1, moVector4f(   0.0,                2.0 * znear / t_b,  B,        0.0 ) );
  Result.SetRow( 2, moVector4f(   0.0,                0.0,                C,        D ) );
  Result.SetRow( 3, moVector4f(   0.0,                0.0,              -1.0,       0.0 ) );

  Me = Me * (Result.Transpose());
  return (*this);
}
Exemple #10
0
void SetItData(short u, ITEM *x, short a, short n)
{
	if(u==-1)
		u=ParsingPersona;
	if((IsPlayer(x))&&(x!=Me()))
	{
		ParserData[u].pa_Them[0]=a;
		ParserData[u].pa_Them[1]=n;
		if(PlayerOf(x)->pl_Flags&PL_MALE)
		{
			ParserData[u].pa_Him[0]=a;
			ParserData[u].pa_Him[1]=n;
			return;
		}
		if(PlayerOf(x)->pl_Flags&PL_FEMALE)
		{
			ParserData[u].pa_Her[0]=a;
			ParserData[u].pa_Her[1]=n;
			return;
		}
		ParserData[u].pa_It[0]=a;
		ParserData[u].pa_It[1]=n;
		return;
	}
	if(IsObject(x))
	{
		if((ObjectOf(x)->ob_Flags&OB_NOIT)==0)
		{
			ParserData[u].pa_It[0]=a;
			ParserData[u].pa_It[1]=n;
		}
	}
	if(IsRoom(x))
	{
		ParserData[u].pa_There[0]=a;
		ParserData[u].pa_There[1]=n;
	}
}
Exemple #11
0
 Me retVal(void)
 {
     return Me(1);
 }
Exemple #12
0
int Disintegrate(ITEM *i)
{
	SUB *s;
	if(!Duped(i))
		return(-1);
	Place(i,NULL);
	while((s=i->it_Properties)!=NULL)
	{
		switch(s->pr_Key)
		{
		case KEY_ROOM:
			UnRoom(i);
			break;
		case KEY_OBJECT:
			UnObject(i);
			break;
		case KEY_PLAYER:
			UnPlayer(i);
			break;
		case KEY_GENEXIT:
			UnGenExit(i);
			break;
		case KEY_MSGEXIT:
			UnMsgExit(i,(MSGEXIT *)s);
			break;
		case KEY_CHAIN:
			RemoveChain(i,((CHAIN *)(s))->ch_Chained);
			break;
		case KEY_USERFLAG:
		case KEY_USERFLAG2:
			UnUserFlag(i);
			break;
		case KEY_CONDEXIT:
			UnCondExit(i,(CONDEXIT *)s);
			break;
		case KEY_CONTAINER:
			UnContainer(i);
			break;
		case KEY_INHERIT:
			UnInherit(i);
			break;
		case KEY_SNOOP:;
		case KEY_SNOOPBACK:
			StopAllSnoops(i);
			StopSnoopsOn(i);
			break;
		case KEY_DUPED:
			UnlockItem(((DUP *)(s))->du_Master);
			FreeSub(i,s);
			break;
		case KEY_USERTEXT:
			UnUserText(i);
			break;
		case KEY_INOUTHERE:
			KillIOH(i);
			break;
			
		default:fprintf(stderr,"SUBID=%d\n",s->pr_Key);
			Error("Disintegrate: Prop Problem");
		}
	}
	KillEventQueue(i);
	if(FreeItem(i)<0)
	{
		i->it_Perception=-1;	/* Queue deletion */
		return(-1);
	}
	if(i==Me())
		SetMe(NULL);
	if(i==Item1)
		Item1=NULL;
	if(i==Item2)
		Item2=NULL;
	return(0);
}
Exemple #13
0
 Me retValOptimization(void)
 {
     return Me(1);
 }