示例#1
0
		public static void btCross2Del( ref btVector3 a, ref btVector3 b, ref btVector3 c, ref btVector3 d, out btVector3 result )
		{
			btVector3 tmp1;
			btVector3 tmp2;
			a.Sub( ref b, out tmp1 );
			c.Sub( ref d, out tmp2 );
			btCross( ref tmp1, ref tmp2, out result );
		}
示例#2
0
		/*@brief Return the distance between the ends of this and another vector
          This is symantically treating the vector like a point */
		public float distance( ref btVector3 v )
		{
			btVector3 tmp;
			v.Sub( ref this, out tmp );
			return tmp.length();
		}
示例#3
0
		// point fed to this is relative to the camera origin already.
		internal bool Is_PointVisible( ref btTransform TransformParam, ref btVector3 Point )
		{
			btVector3 Cv;
			btVector3 Cv2;
			bool Visible;
			Point.Sub( ref TransformParam.m_origin, out Cv2);
			TransformParam.m_basis.Apply( ref Cv2, out Cv );
			//Cv.Sub(

			// Projection
			if( Cv.z > 0 )
			{
				Cv.x = Cv.x / Cv.z * FocusDistance;  // Number replaced by FocusDistance was 50.0
				Cv.y = Cv.y / Cv.z * FocusDistance;

				// Visibility test

				Visible = ( ( Cv.x < Frustum_CullingLimit && Cv.x > -Frustum_CullingLimit ) // Number replaced by Frustum_CullingLimit was 50.0
						  && ( Cv.y < Frustum_CullingLimit && Cv.y > -Frustum_CullingLimit ) //
						);
				//Log.log( "visible: {0} {1} {2} {3}", Point.x, Point.y, Point.z, Visible );
				return ( Visible );
			}
			return false;
		}
示例#4
0
		public static float BetweenLength2( ref btVector3 min, ref btVector3 max )
		{
			btVector3 tmp;
			max.Sub( ref min, out tmp );
			return tmp.dot( ref tmp );
		}
示例#5
0
		public void invXform( ref btVector3 inVec, out btVector3 result )
		{
			btVector3 v;
			inVec.Sub( ref m_origin, out v );
			btMatrix3x3 tmp;
			m_basis.transpose( out tmp );
			tmp.Apply( ref v, out result );
		}