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

C# BulletSharp.CollisionObjectWrapper类代码示例

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

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



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

示例1: CustomMaterialCombinerCallback

 static void CustomMaterialCombinerCallback(ManifoldPoint cp,
     CollisionObjectWrapper colObj0Wrap, int partId0, int index0,
     CollisionObjectWrapper colObj1Wrap, int partId1, int index1)
 {
     // Apply material properties
     if (colObj0Wrap.CollisionShape.ShapeType == BroadphaseNativeType.TriangleShape)
     {
         CollisionShape parent0 = colObj0Wrap.CollisionObject.CollisionShape;
         if (parent0 != null && parent0.ShapeType == BroadphaseNativeType.MultiMaterialTriangleMesh)
         {
             MultimaterialTriangleMeshShape shape = parent0 as MultimaterialTriangleMeshShape;
             BulletMaterial props = shape.GetMaterialProperties(partId0, index0);
             cp.CombinedFriction = CalculateCombinedFriction(props.Friction, colObj1Wrap.CollisionObject.Friction);
             cp.CombinedRestitution = props.Restitution * colObj1Wrap.CollisionObject.Restitution;
         }
     }
     else if (colObj1Wrap.CollisionShape.ShapeType == BroadphaseNativeType.TriangleShape)
     {
         CollisionShape parent1 = colObj1Wrap.CollisionObject.CollisionShape;
         if (parent1 != null && parent1.ShapeType == BroadphaseNativeType.MultiMaterialTriangleMesh)
         {
             MultimaterialTriangleMeshShape shape = parent1 as MultimaterialTriangleMeshShape;
             BulletMaterial props = shape.GetMaterialProperties(partId1, index1);
             cp.CombinedFriction = CalculateCombinedFriction(props.Friction, colObj0Wrap.CollisionObject.Friction);
             cp.CombinedRestitution = props.Restitution * colObj0Wrap.CollisionObject.Restitution;
         }
     }
 }
开发者ID:rhynodegreat,项目名称:BulletSharp,代码行数:28,代码来源:Physics.cs


示例2: ConvexPlaneCollisionAlgorithm

		public ConvexPlaneCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
			CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, bool isSwapped,
			int numPerturbationIterations, int minimumPointsPerturbationThreshold)
			: base(btConvexPlaneCollisionAlgorithm_new(mf._native, ci._native, body0Wrap._native,
				body1Wrap._native, isSwapped, numPerturbationIterations, minimumPointsPerturbationThreshold))
		{
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:7,代码来源:ConvexPlaneCollisionAlgorithm.cs


示例3: GetSphereDistance

		public bool GetSphereDistance(CollisionObjectWrapper boxObjWrap, out Vector3 v3PointOnBox,
			out Vector3 normal, out float penetrationDepth, Vector3 v3SphereCenter,
			float fRadius, float maxContactDistance)
		{
			return btSphereBoxCollisionAlgorithm_getSphereDistance(_native, boxObjWrap._native,
				out v3PointOnBox, out normal, out penetrationDepth, ref v3SphereCenter,
				fRadius, maxContactDistance);
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:8,代码来源:SphereBoxCollisionAlgorithm.cs


示例4: AddSingleResult

 public override float AddSingleResult(ManifoldPoint cp,
     CollisionObjectWrapper colObj0Wrap, int partId0, int index0,
     CollisionObjectWrapper colObj1Wrap, int partId1, int index1)
 {
     Vector3 ptA = cp.PositionWorldOnA;
     Vector3 ptB = cp.PositionWorldOnB;
     world.DebugDrawer.DrawLine(ref ptA, ref ptB, System.Drawing.Color.Blue);
     return 0;
 }
开发者ID:rhynodegreat,项目名称:BulletSharp,代码行数:9,代码来源:CollisionInterfaceDemo.cs


示例5: GetSphereDistance

		public unsafe static bool GetSphereDistance(this SphereBoxCollisionAlgorithm obj, CollisionObjectWrapper boxObjWrap, ref OpenTK.Vector3 v3PointOnBox, ref OpenTK.Vector3 normal, out float penetrationDepth, ref OpenTK.Vector3 v3SphereCenter, float fRadius, float maxContactDistance)
		{
			fixed (OpenTK.Vector3* v3PointOnBoxPtr = &v3PointOnBox)
			{
				fixed (OpenTK.Vector3* normalPtr = &normal)
				{
					fixed (OpenTK.Vector3* v3SphereCenterPtr = &v3SphereCenter)
					{
						return obj.GetSphereDistance(boxObjWrap, ref *(BulletSharp.Math.Vector3*)v3PointOnBoxPtr, ref *(BulletSharp.Math.Vector3*)normalPtr, out penetrationDepth, ref *(BulletSharp.Math.Vector3*)v3SphereCenterPtr, fRadius, maxContactDistance);
					}
				}
			}
		}
开发者ID:sinkingsugar,项目名称:BulletSharpPInvoke,代码行数:13,代码来源:SphereBoxCollisionAlgorithmExtensions.cs


示例6: MyContactCallback

        // MyContactCallback is just an example to show how to get access to the child shape that collided
        void MyContactCallback(ManifoldPoint cp, CollisionObjectWrapper colObj0Wrap, int partId0, int index0, CollisionObjectWrapper colObj1Wrap, int partId1, int index1)
        {
            if (colObj0Wrap.CollisionObject.CollisionShape.ShapeType == BroadphaseNativeType.CompoundShape)
            {
                CompoundShape compound = colObj0Wrap.CollisionObject.CollisionShape as CompoundShape;
                CollisionShape childShape = compound.GetChildShape(index0);
            }

            if (colObj1Wrap.CollisionObject.CollisionShape.ShapeType == BroadphaseNativeType.CompoundShape)
            {
                CompoundShape compound = colObj1Wrap.CollisionObject.CollisionShape as CompoundShape;
                CollisionShape childShape = compound.GetChildShape(index1);
            }
        }
开发者ID:sinkingsugar,项目名称:BulletSharpPInvoke,代码行数:15,代码来源:ConvexDecompositionDemo.cs


示例7: AddSingleResult

        //! Called with each contact for your own processing (e.g. test if contacts fall in within sensor parameters)
        public override float AddSingleResult(ManifoldPoint cp,
            CollisionObjectWrapper colObj0, int partId0, int index0,
            CollisionObjectWrapper colObj1, int partId1, int index1)
        {
            Vector3 pt; // will be set to point of collision relative to body
            if (colObj0.CollisionObject == body)
            {
                pt = cp.LocalPointA;
                //Console.WriteLine("ContactSensorCallback");
            }
            else
            {
                System.Diagnostics.Debug.Assert(colObj1.CollisionObject == body);
                pt = cp.LocalPointB;
            }

            // do stuff with the collision point
            return 0; // not actually sure if return value is used for anything...?
        }
开发者ID:jdoyle1983,项目名称:BulletSharp,代码行数:20,代码来源:ContactSensorCallback.cs


示例8: AddSingleResult

 public override float AddSingleResult(ManifoldPoint cp,
     CollisionObjectWrapper colObj0Wrap, int partId0, int index0,
     CollisionObjectWrapper colObj1Wrap, int partId1, int index1)
 {
     Vector3 ptA = cp.PositionWorldOnA;
     Vector3 ptB = cp.PositionWorldOnB;
     UnityEngine.Debug.Log("Contact!");
     world.DebugDrawer.DrawLine(ref ptA, ref ptB, ref ptA);
     return 0;
 }
开发者ID:RatherGood1,项目名称:BulletSharpUnity3d,代码行数:10,代码来源:CollisionInterfaceDemo.cs


示例9: RayTestSingleInternal

		public static void RayTestSingleInternal(Matrix rayFromTrans, Matrix rayToTrans,
			CollisionObjectWrapper collisionObjectWrap, RayResultCallback resultCallback)
		{
			btCollisionWorld_rayTestSingleInternal(ref rayFromTrans, ref rayToTrans,
				collisionObjectWrap._native, resultCallback._native);
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:6,代码来源:CollisionWorld.cs


示例10: CreateCollisionAlgorithm

		public virtual CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo __unnamed0,
			CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
		{
            return null;
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:5,代码来源:CollisionCreateFunc.cs


示例11: CreateCollisionAlgorithm

 public CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo __unnamed0, CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
 {
     return new CollisionAlgorithm(btCollisionAlgorithmCreateFunc_CreateCollisionAlgorithm(_native, __unnamed0._native, body0Wrap._native, body1Wrap._native));
 }
开发者ID:Cyberbanan,项目名称:BulletSharpUnity3d,代码行数:4,代码来源:CollisionCreateFunc.cs


示例12: FindAlgorithm

 public CollisionAlgorithm FindAlgorithm(CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
 {
     return new CollisionAlgorithm(btDispatcher_findAlgorithm(_native, body0Wrap._native, body1Wrap._native));
 }
开发者ID:Cyberbanan,项目名称:BulletSharpUnity3d,代码行数:4,代码来源:Dispatcher.cs


示例13: GImpactVsShape

		public void GImpactVsShape(CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap,
			GImpactShapeInterface shape0, CollisionShape shape1, bool swapped)
		{
			btGImpactCollisionAlgorithm_gimpact_vs_shape(_native, body0Wrap._native,
				body1Wrap._native, shape0._native, shape1._native, swapped);
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:6,代码来源:GImpactCollisionAlgorithm.cs


示例14: GImpactVsGImpact

		public void GImpactVsGImpact(CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap,
			GImpactShapeInterface shape0, GImpactShapeInterface shape1)
		{
			btGImpactCollisionAlgorithm_gimpact_vs_gimpact(_native, body0Wrap._native,
				body1Wrap._native, shape0._native, shape1._native);
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:6,代码来源:GImpactCollisionAlgorithm.cs


示例15: GImpactCollisionAlgorithm

		public GImpactCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObjectWrapper body0Wrap,
			CollisionObjectWrapper body1Wrap)
			: base(btGImpactCollisionAlgorithm_new(ci._native, body0Wrap._native,
				body1Wrap._native))
		{
		}
开发者ID:rhynodegreat,项目名称:BulletSharpPInvoke,代码行数:6,代码来源:GImpactCollisionAlgorithm.cs


示例16: SoftBodyConcaveCollisionAlgorithm

		public SoftBodyConcaveCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, bool isSwapped)
			: base(btSoftBodyConcaveCollisionAlgorithm_new(ci._native, body0Wrap._native, body1Wrap._native, isSwapped))
		{
		}
开发者ID:sinkingsugar,项目名称:BulletSharpPInvoke,代码行数:4,代码来源:SoftBodyConcaveCollisionAlgorithm.cs


示例17: SoftRigidCollisionAlgorithm

		public SoftRigidCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObjectWrapper col0, CollisionObjectWrapper col1Wrap, bool isSwapped)
			: base(btSoftRigidCollisionAlgorithm_new(mf._native, ci._native, col0._native, col1Wrap._native, isSwapped))
		{
		}
开发者ID:sinkingsugar,项目名称:BulletSharpPInvoke,代码行数:4,代码来源:SoftRigidCollisionAlgorithm.cs


示例18: OnContactAdded

        private void OnContactAdded(ManifoldPoint cp, CollisionObjectWrapper colObj0Wrap, int partId0, int index0,
            CollisionObjectWrapper colObj1Wrap, int partId1, int index1)
        {
            //Debug.WriteLine("OnContactAdded");
            int numManifolds = BtWorld.Dispatcher.NumManifolds;

            for (int i = 0; i < numManifolds; i++)
            {
                PersistentManifold contactManifold = BtWorld.Dispatcher.GetManifoldByIndexInternal(i);
                int numContacts = contactManifold.NumContacts;
                if (numContacts > 0)
                {
                    cp.UserPersistentData = 1;

                    CollisionObject obA = (CollisionObject) contactManifold.Body0;
                    CollisionObject obB = (CollisionObject) contactManifold.Body1;
                    RigidBody btRigidBodyA = (RigidBody) obA;
                    RigidBody btRigidBodyB = (RigidBody)obB;
                    RigidBodyImp rigidBodyA = new RigidBodyImp();
                    RigidBodyImp rigidBodyB = new RigidBodyImp();
                    rigidBodyA._rbi = btRigidBodyA;
                    rigidBodyB._rbi = btRigidBodyB;
                    rigidBodyA.OnCollision(rigidBodyB);
                }
            }
        }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:26,代码来源:DynamicWorldImp.cs


示例19: ManifoldResult

 public ManifoldResult(CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
     : base(btManifoldResult_new2(body0Wrap._native, body1Wrap._native))
 {
 }
开发者ID:Cyberbanan,项目名称:BulletSharpUnity3d,代码行数:4,代码来源:ManifoldResult.cs


示例20: ConvexConvexAlgorithm

		public ConvexConvexAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, VoronoiSimplexSolver simplexSolver, ConvexPenetrationDepthSolver pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
			: base(btConvexConvexAlgorithm_new(mf._native, ci._native, body0Wrap._native, body1Wrap._native, simplexSolver._native, pdSolver._native, numPerturbationIterations, minimumPointsPerturbationThreshold))
		{
		}
开发者ID:sinkingsugar,项目名称:BulletSharpPInvoke,代码行数:4,代码来源:ConvexConvexAlgorithm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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