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


C# CollisionObject.GetInternalType方法代码示例

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


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

示例1: Upcast

        //
        // internal cast
        //

        public static GhostObject Upcast(CollisionObject colObj)
        {
            if (colObj.GetInternalType() == CollisionObjectTypes.CO_GHOST_OBJECT)
            {
                return (GhostObject)colObj;
            }
            return null;
        }
开发者ID:JohnLouderback,项目名称:illuminati-engine-xna,代码行数:12,代码来源:GhostObject.cs

示例2: UpdateSingleAabb

        public void UpdateSingleAabb(CollisionObject colObj)
        {
            IndexedVector3 minAabb;
            IndexedVector3 maxAabb;
            IndexedMatrix wt = colObj.GetWorldTransform();
            colObj.GetCollisionShape().GetAabb(ref wt, out minAabb, out maxAabb);
            //need to increase the aabb for contact thresholds
            IndexedVector3 contactThreshold = new IndexedVector3(BulletGlobals.gContactBreakingThreshold);
            minAabb -= contactThreshold;
            maxAabb += contactThreshold;

            if (GetDispatchInfo().m_useContinuous && colObj.GetInternalType() == CollisionObjectTypes.CO_RIGID_BODY && !colObj.IsStaticOrKinematicObject())
	        {
		        IndexedVector3 minAabb2,maxAabb2;
		        colObj.GetCollisionShape().GetAabb(colObj.GetInterpolationWorldTransform(),out minAabb2 ,out maxAabb2);
		        minAabb2 -= contactThreshold;
		        maxAabb2 += contactThreshold;
		        MathUtil.VectorMin(ref minAabb2,ref minAabb);
                MathUtil.VectorMax(ref maxAabb2, ref maxAabb);
            }

            if (BulletGlobals.g_streamWriter != null && BulletGlobals.debugCollisionWorld)
            {
                MathUtil.PrintVector3(BulletGlobals.g_streamWriter, "updateSingleAabbMin", minAabb);
                MathUtil.PrintVector3(BulletGlobals.g_streamWriter, "updateSingleAabbMax", maxAabb);
            }


            IBroadphaseInterface bp = m_broadphasePairCache as IBroadphaseInterface;

            //moving objects should be moderately sized, probably something wrong if not
            if (colObj.IsStaticObject() || ((maxAabb - minAabb).LengthSquared() < 1e12f))
            {
                bp.SetAabb(colObj.GetBroadphaseHandle(), ref minAabb, ref maxAabb, m_dispatcher1);
            }
            else
            {
                //something went wrong, investigate
                //this assert is unwanted in 3D modelers (danger of loosing work)
                colObj.SetActivationState(ActivationState.DISABLE_SIMULATION);

                //static bool reportMe = true;
                bool reportMe = true;
                if (reportMe && m_debugDrawer != null)
                {
                    reportMe = false;
                    m_debugDrawer.ReportErrorWarning("Overflow in AABB, object removed from simulation");
                    m_debugDrawer.ReportErrorWarning("If you can reproduce this, please email [email protected]\n");
                    m_debugDrawer.ReportErrorWarning("Please include above information, your Platform, version of OS.\n");
                    m_debugDrawer.ReportErrorWarning("Thanks.\n");
                }
            }
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:53,代码来源:CollisionWorld.cs

示例3: Upcast

	    ///to keep collision detection and dynamics separate we don't store a rigidbody pointer
	    ///but a rigidbody is derived from btCollisionObject, so we can safely perform an upcast
	    public static RigidBody	Upcast(CollisionObject colObj)
	    {
		    if ((colObj.GetInternalType()&CollisionObjectTypes.CO_RIGID_BODY) != 0)
            {
			    return colObj as RigidBody;
            }
		    return null;
	    }
开发者ID:bsamuels453,项目名称:BulletXNA,代码行数:10,代码来源:RigidBody.cs


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