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


C# dJointID类代码示例

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


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

示例1: UpdateODEJoint

		void UpdateODEJoint()
		{
			bool needCreate = PushedToWorld && !Broken;
			bool created = jointID != dJointID.Zero;

			if( needCreate == created )
				return;

			if( needCreate )
			{
				ODEBody odeBody1 = (ODEBody)Body1;
				ODEBody odeBody2 = (ODEBody)Body2;

				jointID = Ode.dJointCreateFixed( ( (ODEPhysicsScene)Scene ).worldID, IntPtr.Zero );
				Ode.SetJointContactsEnabled( jointID, false );//ContactsEnabled );

				Ode.dJointAttach( jointID, odeBody1.bodyID, odeBody2.bodyID );

				Ode.dJointSetFixed( jointID );

				Ode.BodyDataAddJoint( odeBody1.bodyData, jointID );
				Ode.BodyDataAddJoint( odeBody2.bodyData, jointID );
			}
			else
			{
				DestroyODEJoint();
			}
		}
开发者ID:whztt07,项目名称:SDK,代码行数:28,代码来源:ODEFixedJoint.cs

示例2: FreeJointFeedback

		internal static void FreeJointFeedback( dJointID jointID )
		{
			IntPtr jointFeedback = Ode.dJointGetFeedbackAsIntPtr( jointID );
			if( jointFeedback != IntPtr.Zero )
			{
				Ode.dFree( jointFeedback, (uint)Marshal.SizeOf( typeof( Ode.dJointFeedback ) ) );
				jointFeedback = IntPtr.Zero;
			}
		}
开发者ID:whztt07,项目名称:SDK,代码行数:9,代码来源:Utils.cs

示例3: DestroyODEJoint

		internal void DestroyODEJoint()
		{
			if( jointID != dJointID.Zero )
			{
				ODEBody odeBody1 = (ODEBody)Body1;
				ODEBody odeBody2 = (ODEBody)Body2;

				Ode.BodyDataRemoveJoint( odeBody1.bodyData, jointID );
				Ode.BodyDataRemoveJoint( odeBody2.bodyData, jointID );

				Utils.FreeJointFeedback( jointID );
				Ode.dJointDestroy( jointID );
				jointID = dJointID.Zero;
			}
		}
开发者ID:whztt07,项目名称:SDK,代码行数:15,代码来源:ODEFixedJoint.cs

示例4: UpdateJointBreakState

		internal static bool UpdateJointBreakState( Joint joint, dJointID jointID )
		{
			if( jointID == dJointID.Zero )
				return false;

			float force;
			float torque;
			CalculateJointStress( jointID, out force, out torque );

			if( joint.BreakMaxForce != 0 && force >= joint.BreakMaxForce )
				return true;
			if( joint.BreakMaxTorque != 0 && torque >= joint.BreakMaxTorque )
				return true;
			return false;
		}
开发者ID:whztt07,项目名称:SDK,代码行数:15,代码来源:Utils.cs

示例5: CalculateJointStress

		unsafe internal static void CalculateJointStress( dJointID jointID,
			out float force, out float torque )
		{
			IntPtr jointFeedback = Ode.dJointGetFeedbackAsIntPtr( jointID );

			if( jointFeedback == IntPtr.Zero )
			{
				//create jointFeedback and begin use on next simulation step

				jointFeedback = Ode.dAlloc( (uint)Marshal.SizeOf( typeof( Ode.dJointFeedback ) ) );

				//zero memory
				unsafe
				{
					Ode.dJointFeedback* p = (Ode.dJointFeedback*)jointFeedback;
					p->f1 = new Ode.dVector3();
					p->t1 = new Ode.dVector3();
					p->f2 = new Ode.dVector3();
					p->t2 = new Ode.dVector3();
				}
				Ode.dJointSetFeedbackAsIntPtr( jointID, jointFeedback );

				force = 0;
				torque = 0;
				return;
			}

			Ode.dJointFeedback* ptr = (Ode.dJointFeedback*)jointFeedback;
			Vec3 f1 = Convert.ToNet( ptr->f1 );
			Vec3 t1 = Convert.ToNet( ptr->t1 );
			Vec3 f2 = Convert.ToNet( ptr->f2 );
			Vec3 t2 = Convert.ToNet( ptr->t2 );

			// This is a simplification, but it should still work.
			force = ( f1 - f2 ).Length();
			torque = ( t1 - t2 ).Length();
		}
开发者ID:whztt07,项目名称:SDK,代码行数:37,代码来源:Utils.cs

示例6: BodyDataRemoveJoint

		public extern static void BodyDataRemoveJoint( IntPtr bodyData, dJointID jointID );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例7: dJointGetAMotorParam

		public extern static dReal dJointGetAMotorParam( dJointID joint, dJointParams parameter );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例8: dJointGetAMotorAngleRate

		public extern static dReal dJointGetAMotorAngleRate( dJointID joint, int anum );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例9: dJointGetAMotorAxisRel

		public extern static int dJointGetAMotorAxisRel( dJointID joint, int anum );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例10: dJointSetAMotorAxis

		public extern static void dJointSetAMotorAxis( dJointID joint, int anum, int rel,
			dReal x, dReal y, dReal z );
开发者ID:whztt07,项目名称:SDK,代码行数:2,代码来源:TaoWrapper.cs

示例11: dJointSetAMotorNumAxes

		public extern static void dJointSetAMotorNumAxes( dJointID joint, int num );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例12: dJointAddHinge2Torques

		public extern static void dJointAddHinge2Torques( dJointID joint, dReal torque1, dReal torque2 );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例13: dJointGetHinge2Param

		public extern static dReal dJointGetHinge2Param( dJointID joint, dJointParams parameter );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例14: dJointGetHinge2Angle2Rate

		public extern static dReal dJointGetHinge2Angle2Rate( dJointID joint );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs

示例15: dJointGetHinge2Axis2

		public extern static void dJointGetHinge2Axis2( dJointID joint, ref dVector3 result );
开发者ID:whztt07,项目名称:SDK,代码行数:1,代码来源:TaoWrapper.cs


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