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


C# Bounds.Add方法代码示例

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


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

示例1: OnCalculateMapBounds

        protected override void OnCalculateMapBounds( ref Bounds bounds )
        {
            base.OnCalculateMapBounds( ref bounds );

            Bounds b = new Bounds( Position );
            b.Expand( new Vec3( .5f, .5f, .1f ) );
            bounds.Add( b );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:8,代码来源:JigsawPuzzlePiece.cs

示例2: OnCalculateMapBounds

 protected override void OnCalculateMapBounds( ref Bounds bounds )
 {
     base.OnCalculateMapBounds( ref bounds );
     bounds.Add( GetBox().ToBounds() );
 }
开发者ID:whztt07,项目名称:SDK,代码行数:5,代码来源:WaterPlaneClipVolume.cs

示例3: Item

            //
            public Item( SubMesh subMesh )
            {
                this.subMesh = subMesh;

                subMesh.GetSomeGeometry( out positions, out indices );

                Bounds bounds = Bounds.Cleared;
                foreach( Vec3 pos in positions )
                    bounds.Add( pos );
                bounds.Expand( bounds.GetSize() * .001f );

                OctreeContainer.InitSettings initSettings = new OctreeContainer.InitSettings();
                initSettings.InitialOctreeBounds = bounds;
                initSettings.OctreeBoundsRebuildExpand = Vec3.Zero;
                initSettings.MinNodeSize = bounds.GetSize() / 50;
                octreeContainer = new OctreeContainer( initSettings );

                for( int nTriangle = 0; nTriangle < indices.Length / 3; nTriangle++ )
                {
                    Vec3 vertex0 = positions[ indices[ nTriangle * 3 + 0 ] ];
                    Vec3 vertex1 = positions[ indices[ nTriangle * 3 + 1 ] ];
                    Vec3 vertex2 = positions[ indices[ nTriangle * 3 + 2 ] ];

                    Bounds triangleBounds = new Bounds( vertex0 );
                    triangleBounds.Add( vertex1 );
                    triangleBounds.Add( vertex2 );

                    int octreeIndex = octreeContainer.AddObject( triangleBounds, 1 );
                }
            }
开发者ID:whztt07,项目名称:SDK,代码行数:31,代码来源:MeshRayIntersectionOctreeManager.cs

示例4: OnCalculateMapBounds

        protected override void OnCalculateMapBounds( ref Bounds bounds )
        {
            base.OnCalculateMapBounds( ref bounds );

            //add gun bounds to the tank
            if( MainGun != null )
                bounds.Add( MainGun.MapBounds );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:8,代码来源:Tank.cs

示例5: GetGlobalBounds

        public override void GetGlobalBounds( out Bounds bounds )
        {
            Vec3 globalPos = Body.Position;
            Quat globalRot = Body.Rotation;
            if( !IsIdentityTransform )
            {
                globalPos += Body.Rotation * Position;
                globalRot *= Rotation;
            }
            Mat3 globalRotMat3;
            globalRot.ToMat3( out globalRotMat3 );

            Vec3 axMat0 = halfDimensions.X * globalRotMat3.Item0;
            Vec3 axMat1 = halfDimensions.Y * globalRotMat3.Item1;
            Vec3 axMat2 = halfDimensions.Z * globalRotMat3.Item2;

            Vec3 temp0 = new Vec3( globalPos - axMat0 );
            Vec3 temp1 = new Vec3( globalPos + axMat0 );
            Vec3 temp2 = new Vec3( axMat1 - axMat2 );
            Vec3 temp3 = new Vec3( axMat1 + axMat2 );

            bounds = new Bounds( temp0 - temp3 );
            bounds.Add( temp1 - temp3 );
            bounds.Add( temp1 + temp2 );
            bounds.Add( temp0 + temp2 );
            bounds.Add( temp0 - temp2 );
            bounds.Add( temp1 - temp2 );
            bounds.Add( temp1 + temp3 );
            bounds.Add( temp0 + temp3 );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:30,代码来源:_Custom1Shape.cs


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