예제 #1
0
		public bool inSimplex( ref btVector3 w )
		{
			bool found = false;
			int i, numverts = m_numVertices;
			//double maxV = btScalar.BT_ZERO;

			//w is in the current (reduced) simplex
			for( i = 0; i < numverts; i++ )
			{
#if BT_USE_EQUAL_VERTEX_THRESHOLD
				switch( i )
				{
					case 0: found = ( m_simplexVectorW0.distance2( ref w ) <= m_equalVertexThreshold ); break;
					case 1: found = ( m_simplexVectorW1.distance2( ref w ) <= m_equalVertexThreshold ); break;
					case 2: found = ( m_simplexVectorW2.distance2( ref w ) <= m_equalVertexThreshold ); break;
					case 3: found = ( m_simplexVectorW3.distance2( ref w ) <= m_equalVertexThreshold ); break;
					case 4: found = ( m_simplexVectorW4.distance2( ref w ) <= m_equalVertexThreshold ); break;
				}
				if( found ) break;
#else
		if (m_simplexVectorW[i] == w)
						found = true;
#endif
			}

			//check in case lastW is already removed
			if( w.Equals( ref m_lastW ) )
				return true;

			return found;
		}