当前位置: 首页>>代码示例>>C#>>正文


C# btVector3.Div方法代码示例

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


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

示例1: setGravity

		public void setGravity( ref btVector3 acceleration )
		{
			if( m_inverseMass != btScalar.BT_ZERO )
			{
				acceleration.Div( m_inverseMass, out m_gravity );
				//m_gravity = acceleration * ( (double)( 1.0 ) / m_inverseMass );
			}
			m_gravity_acceleration = acceleration;
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:9,代码来源:RigidBody.cs

示例2: calculateDiffAxisAngle

		internal static void calculateDiffAxisAngle( ref btTransform transform0, ref btTransform transform1, out btVector3 axis, out double angle )
		{
			btMatrix3x3 tmp_m;
			transform0.m_basis.inverse( out tmp_m );
			btMatrix3x3 dmat;
			transform1.m_basis.Mult( ref tmp_m, out dmat );
			btQuaternion dorn;
			dmat.getRotation( out dorn );

			///floating point inaccuracy can lead to w component > 1..., which breaks 
			dorn.normalize();

			angle = dorn.getAngle();
			axis.x = dorn.x; axis.y = dorn.y; axis.z = dorn.z; axis.w = 0;
			//check for axis length
			double len = axis.length2();
			if( len < btScalar.SIMD_EPSILON * btScalar.SIMD_EPSILON )
				axis = btVector3.xAxis;
			else
				axis.Div( btScalar.btSqrt( len ), out axis );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:21,代码来源:TransformUtil.h.cs

示例3: calculateDiffAxisAngleQuaternion

		internal static void calculateDiffAxisAngleQuaternion( ref btQuaternion orn0, ref btQuaternion orn1a, out btVector3 axis, out double angle )
		{
			btQuaternion orn1;
			orn0.nearest( ref orn1a, out orn1 );
			btQuaternion dorn;
			btQuaternion tmp;
			orn0.inverse( out tmp );
			orn1.Mult( ref tmp, out dorn );
			angle = dorn.getAngle();
			axis.x = dorn.x; axis.y = dorn.y; axis.z = dorn.z; axis.w = 0;
			//check for axis length
			double len = axis.length2();
			if( len < btScalar.SIMD_EPSILON * btScalar.SIMD_EPSILON )
				axis = btVector3.xAxis;
			else
				axis.Div( btScalar.btSqrt( len ), out axis );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:17,代码来源:TransformUtil.h.cs

示例4: calculateVelocity

		internal static void calculateVelocity( ref btTransform transform0, ref btTransform transform1, double timeStep, out btVector3 linVel, out btVector3 angVel )
		{
			transform1.m_origin.Sub( ref transform0.m_origin, out linVel );
			linVel.Div( timeStep, out linVel );
			btVector3 axis;
			double angle;
			calculateDiffAxisAngle( ref transform0, ref transform1, out axis, out angle );
			axis.Mult( angle, out angVel );
			angVel.Div( timeStep, out angVel );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:10,代码来源:TransformUtil.h.cs


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