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

C# dJointID类代码示例

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

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



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


示例16: dJointSetAMotorMode

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


示例17: dJointGetAMotorMode

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


示例18: dJointSetUniversalAxis2

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


示例19: dJointGetAMotorNumAxes

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


示例20: dJointGetUniversalAxis2

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# dReal类代码示例发布时间:2022-05-24
下一篇:
C# dGeomID类代码示例发布时间: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