• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# btVector3类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中btVector3的典型用法代码示例。如果您正苦于以下问题:C# btVector3类的具体用法?C# btVector3怎么用?C# btVector3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



btVector3类属于命名空间,在下文中一共展示了btVector3类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: batchedUnitVectorGetSupportingVertexWithoutMargin

		public override void batchedUnitVectorGetSupportingVertexWithoutMargin( btVector3[] vectors, btVector3[] supportVerticesOut, int numVectors )
		{
			for( int i = 0; i < numVectors; i++ )
			{
				localGetSupportingVertexWithoutMargin( ref vectors[i], out supportVerticesOut[i] );
			}
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:7,代码来源:Box2dShape.cs


示例2: drawContactPoint

		public override void drawContactPoint( ref btVector3 PointOnB, ref btVector3 normalOnB, double distance, int lifeTime, ref btVector3 color )
		{
			btVector3 tmpD;
			PointOnB.Add( ref normalOnB, out tmpD );
			drawLine( ref PointOnB, ref tmpD, ref color, ref color );

		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:7,代码来源:BulletDebugDrawer.cs


示例3: Multiply

 public static void Multiply(ref btTransform t, ref btVector3 x, out btVector3 result)
 {
     result.X = t.Basis.el0.dot(x) + t.Origin.X;
     result.Y = t.Basis.el1.dot(x) + t.Origin.Y;
     result.Z = t.Basis.el2.dot(x) + t.Origin.Z;
     result.W = 0;
 }
开发者ID:himapo,项目名称:ccm,代码行数:7,代码来源:btTransform.cs


示例4: SegmentSqrDistance

		// See also geometrictools.com
		// Basic idea: D = |p - (lo + t0*lv)| where t0 = lv . (p - lo) / lv . lv
		double SegmentSqrDistance( ref btVector3 from, ref btVector3 to, ref btVector3 p, out btVector3 nearest )
		{
			btVector3 diff = p - from;
			btVector3 v = to - from;
			double t = v.dot( diff );

			if( t > 0 )
			{
				double dotVV = v.dot( v );
				if( t < dotVV )
				{
					t /= dotVV;
					diff.AddScale( ref v, -t, out diff );
					//diff -= t * v;
				}
				else
				{
					t = 1;
					diff.Sub( ref v, out diff );
					//diff -= v;
				}
			}
			else
				t = 0;

			from.AddScale( ref v, t, out nearest );
			//nearest = from + t * v;
			return diff.dot( ref diff );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:31,代码来源:SphereTriangleDetector.h.cs


示例5: addContactPoint

			public void addContactPoint( ref btVector3 normalOnBInWorld, ref btVector3 pointInWorld, double depth )
			{
				m_normalOnBInWorld = normalOnBInWorld;
				m_pointInWorld = pointInWorld;
				m_depth = depth;
				m_hasResult = true;
			}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:7,代码来源:MinkowskiPenetrationDepthSolver.h.cs


示例6: addPoint

		public void addPoint( ref btVector3 point, bool recalculateLocalAabb = true )
		{
			m_unscaledPoints.Add( point );
			if( recalculateLocalAabb )
				recalcLocalAabb();

		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:7,代码来源:ConvexHullShape.cs


示例7: project

		public virtual void project( ref btTransform trans, ref btVector3 dir
			, ref double min, ref double max
			, out btVector3 witnesPtMin, out btVector3 witnesPtMax )
		{
			btVector3 localAxis; trans.m_basis.ApplyInverse( ref dir, out localAxis );
			btVector3 tmpv;
			localGetSupportingVertex( ref localAxis, out tmpv );
			btVector3 vtx1; trans.Apply( ref tmpv, out vtx1 );
			localAxis.Invert( out localAxis );
			localGetSupportingVertex( ref localAxis, out tmpv );

			btVector3 vtx2; trans.Apply( ref tmpv, out vtx2 );

			min = vtx1.dot( ref dir );
			max = vtx2.dot( ref dir );
			witnesPtMax = vtx2;
			witnesPtMin = vtx1;

			if( min > max )
			{
				double tmp = min;
				min = max;
				max = tmp;
				witnesPtMax = vtx1;
				witnesPtMin = vtx2;
			}
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:27,代码来源:ConvexShape.cs


示例8: setSafeMargin

		public void setSafeMargin( ref btVector3 halfExtents, double defaultMarginMultiplier = 0.1f )
		{
			//see http://code.google.com/p/bullet/issues/detail?id=349
			//this margin check could could be added to other collision shapes too,
			//or add some assert/warning somewhere
			double minDimension = halfExtents[halfExtents.minAxis()];
			setSafeMargin( minDimension, defaultMarginMultiplier );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:8,代码来源:ConvexInternalShape.cs


示例9: btStaticPlaneShape

		btStaticPlaneShape( ref btVector3 planeOrigin, ref btVector3 planeNormal ) : base()
		{
			planeNormal.normalized( out m_planeNormal );
			m_planeConstant = planeOrigin.dot( ref planeNormal );
			m_localScaling = btVector3.Zero;
			m_shapeType = BroadphaseNativeTypes.STATIC_PLANE_PROXYTYPE;
			//	Debug.Assert( btFuzzyZero(m_planeNormal.length() - btScalar.BT_ONE) );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:8,代码来源:StaticPlaneShape.cs


示例10: localGetSupportingVertexWithoutMargin

		public override void localGetSupportingVertexWithoutMargin( ref btVector3 vec, out btVector3 result )
		{
			btVector3 halfExtents; getHalfExtentsWithoutMargin( out halfExtents );

			result = new btVector3( btScalar.btFsels( vec.x, halfExtents.x, -halfExtents.x ),
				btScalar.btFsels( vec.y, halfExtents.y, -halfExtents.y ),
				btScalar.btFsels( vec.z, halfExtents.z, -halfExtents.z ) );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:8,代码来源:Box2dShape.cs


示例11: AabbExpand

		public static void AabbExpand( ref btVector3 aabbMin,
										   ref btVector3 aabbMax,
										   ref btVector3 expansionMin,
										   ref btVector3 expansionMax )
		{
			aabbMin.Add( ref expansionMin, out aabbMin );
			aabbMin.Add( ref expansionMax, out aabbMin );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:8,代码来源:AabbUtil2.h.cs


示例12: btTriangleRaycastCallback

		public btTriangleRaycastCallback( ref btVector3 from, ref btVector3 to, EFlags flags = EFlags.kF_None )
		{
			m_from = ( from );
			m_to = ( to );
			//@BP Mod
			m_flags = ( flags );
			m_hitFraction = ( btScalar.BT_ONE );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:8,代码来源:RaycastCallback.cs


示例13: convexHullSupport

		static void convexHullSupport( ref btVector3 localDirOrg, btVector3[] points, int numPoints, ref btVector3 localScaling, out btVector3 result )
		{
			btVector3 vec; localDirOrg.Mult( ref localScaling, out vec );
			double maxDot;
			long ptIndex = vec.maxDot( points, numPoints, out maxDot );
			Debug.Assert( ptIndex >= 0 );
			points[ptIndex].Mult( ref localScaling, out result );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:8,代码来源:ConvexShape.cs


示例14: setPoints

		public void setPoints( btVector3[] points, int numPoints, bool computeAabb, ref btVector3 localScaling )
		{
			m_unscaledPoints = points;
			m_numPoints = numPoints;
			m_localScaling = localScaling;

			if( computeAabb )
				recalcLocalAabb();
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:9,代码来源:ConvexPointCloudShape.cs


示例15: TestAabbAgainstAabb2

        public static bool TestAabbAgainstAabb2(btVector3 aabbMin1, btVector3 aabbMax1,
								btVector3 aabbMin2, btVector3 aabbMax2)
        {
	        bool overlap = true;
	        overlap = (aabbMin1.X > aabbMax2.X || aabbMax1.X < aabbMin2.X) ? false : overlap;
	        overlap = (aabbMin1.Z > aabbMax2.Z || aabbMax1.Z < aabbMin2.Z) ? false : overlap;
	        overlap = (aabbMin1.Y > aabbMax2.Y || aabbMax1.Y < aabbMin2.Y) ? false : overlap;
	        return overlap;
        }
开发者ID:himapo,项目名称:ccm,代码行数:9,代码来源:AabbUtil2.cs


示例16: addContactPoint

		public virtual void addContactPoint( ref btVector3 normalOnBInWorld, ref btVector3 pointInWorld, double depth )
		{
			if( depth < m_distance )
			{
				m_normalOnSurfaceB = normalOnBInWorld;
				m_closestPointInB = pointInWorld;
				m_distance = depth;
			}
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:9,代码来源:DiscreteCollisionDetectorInterface.cs


示例17: btOutcode

		public static int btOutcode( ref btVector3 p, ref btVector3 halfExtent )
		{
			return ( p.x < -halfExtent.x ? 0x01 : 0x0 ) |
				   ( p.x > halfExtent.x ? 0x08 : 0x0 ) |
				   ( p.y < -halfExtent.y ? 0x02 : 0x0 ) |
				   ( p.y > halfExtent.y ? 0x10 : 0x0 ) |
				   ( p.z < -halfExtent.z ? 0x4 : 0x0 ) |
				   ( p.z > halfExtent.z ? 0x20 : 0x0 );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:9,代码来源:AabbUtil2.h.cs


示例18: TestAabbAgainstAabb2

		/// conservative test for overlap between two aabbs
		public static bool TestAabbAgainstAabb2( ref btVector3 aabbMin1, ref btVector3 aabbMax1,
										ref btVector3 aabbMin2, ref btVector3 aabbMax2 )
		{
			bool overlap = true;
			overlap = ( aabbMin1.x > aabbMax2.x || aabbMax1.x < aabbMin2.x ) ? false : overlap;
			overlap = ( aabbMin1.z > aabbMax2.z || aabbMax1.z < aabbMin2.z ) ? false : overlap;
			overlap = ( aabbMin1.y > aabbMax2.y || aabbMax1.y < aabbMin2.y ) ? false : overlap;
			return overlap;
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:10,代码来源:AabbUtil2.h.cs


示例19: TestPointAgainstAabb2

		/// conservative test for overlap between two aabbs
		public static bool TestPointAgainstAabb2( ref btVector3 aabbMin1, ref btVector3 aabbMax1,
										ref btVector3 point )
		{
			bool overlap = true;
			overlap = ( aabbMin1.x > point.x || aabbMax1.x < point.x ) ? false : overlap;
			overlap = ( aabbMin1.z > point.z || aabbMax1.z < point.z ) ? false : overlap;
			overlap = ( aabbMin1.y > point.y || aabbMax1.y < point.y ) ? false : overlap;
			return overlap;
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:10,代码来源:AabbUtil2.h.cs


示例20: drawLine

		public override void drawLine( ref btVector3 from, ref btVector3 to, ref btVector3 fromColor, ref btVector3 toColor )
		{

			GL.Begin( PrimitiveType.Lines );
			GL.Color4( fromColor.ToFloat4() );
			GL.Vertex3( from.ToFloat4() );
			GL.Color4( toColor.ToFloat4() );
			GL.Vertex3( to.ToFloat4() );
			GL.End();
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:10,代码来源:BulletDebugDrawer.cs



注:本文中的btVector3类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# cExtendedTable类代码示例发布时间:2022-05-24
下一篇:
C# boolean类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap