Exemple #1
0
        public float GetMarginNonVirtual()
        {
            switch (m_shapeType)
            {
            case BroadphaseNativeTypes.SPHERE_SHAPE_PROXYTYPE:
            {
                SphereShape sphereShape = this as SphereShape;
                return(sphereShape.GetRadius());
            }

            case BroadphaseNativeTypes.BOX_SHAPE_PROXYTYPE:
            {
                BoxShape convexShape = this as BoxShape;
                return(convexShape.GetMarginNV());
            }

            case BroadphaseNativeTypes.TRIANGLE_SHAPE_PROXYTYPE:
            {
                TriangleShape triangleShape = this as TriangleShape;
                return(triangleShape.GetMarginNV());
            }

            case BroadphaseNativeTypes.CYLINDER_SHAPE_PROXYTYPE:
            {
                CylinderShape cylShape = this as CylinderShape;
                return(cylShape.GetMarginNV());
            }

            case BroadphaseNativeTypes.CAPSULE_SHAPE_PROXYTYPE:
            {
                CapsuleShape capsuleShape = this as CapsuleShape;
                return(capsuleShape.GetMarginNV());
            }

            case BroadphaseNativeTypes.CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
            /* fall through */
            case BroadphaseNativeTypes.CONVEX_HULL_SHAPE_PROXYTYPE:
            {
                PolyhedralConvexShape convexHullShape = this as PolyhedralConvexShape;
                return(convexHullShape.GetMarginNV());
            }

            default:
                return(this.GetMargin());
            }

            // should never reach here
            Debug.Assert(false);
            return(0.0f);
        }