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


C# Math.AxisAlignedBox类代码示例

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


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

示例1: PCZCamera

		public PCZCamera( string name, SceneManager sceneManager )
			: base( name, sceneManager )
		{
			this.box = new AxisAlignedBox( new Vector3( -0.1f, -0.1f, -0.1f ), new Vector3( 0.1f, 0.1f, 0.1f ) );
			this.extraCullingFrustum = new PCZFrustum();
			this.extraCullingFrustum.SetUseOriginPlane( true );
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:PCZCamera.cs

示例2: Merge

		public void Merge( AxisAlignedBox boxBounds, Sphere sphereBounds, Camera cam, bool receiver )
		{
			aabb.Merge( boxBounds );
			if ( receiver )
				receiverAabb.Merge( boxBounds );
			Real camDistToCenter = ( cam.DerivedPosition - sphereBounds.Center ).Length;
			minDistance = System.Math.Min( minDistance, System.Math.Max( (Real)0, camDistToCenter - sphereBounds.Radius ) );
			maxDistance = System.Math.Max( maxDistance, camDistToCenter + sphereBounds.Radius );
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:9,代码来源:VisibleObjectsBoundsInfo.cs

示例3: OctreeZone

		public OctreeZone( PCZSceneManager creator, string name )
			: base( creator, name )
		{
			mZoneTypeName = "ZoneType_Octree";
			// init octree
			AxisAlignedBox b = new AxisAlignedBox( new Vector3( -10000, -10000, -10000 ), new Vector3( 10000, 10000, 10000 ) );
			int depth = 8;
			rootOctree = null;
			Init( b, depth );
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:10,代码来源:OctreeZone.cs

示例4: ThingRendable

		/// <summary>
		/// Default ctor.
		/// </summary>
		/// <param name="radius">Radius of orbits</param>
		/// <param name="count">Number of quads</param>
		/// <param name="qSize">Size of quads</param>
		public ThingRendable( float radius, int count, float qSize )
		{
			this.radius = radius;
			this.count = count;
			this.qSize = qSize;

			box = new AxisAlignedBox( new Vector3( -radius, -radius, -radius ), new Vector3( radius, radius, radius ) );
			Initialize();
			FillBuffer();
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:16,代码来源:ThingRendable.cs

示例5: TestMergePoint

        public void TestMergePoint()
        {
            AxisAlignedBox actual = new AxisAlignedBox( new Vector3(0,0,0), new Vector3(50,50,50));
            AxisAlignedBox expected = new AxisAlignedBox(new Vector3(0, 0, 0), new Vector3(150, 150, 150));

            Vector3 point = new Vector3(150, 150, 150);

            actual.Merge(point);

            Assert.AreEqual(expected, actual);
        }
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:11,代码来源:AxisAlignedBoxTest.cs

示例6: VolumeRendable

		/// <summary>
		/// 
		/// </summary>
		/// <param name="slices"></param>
		/// <param name="size"></param>
		/// <param name="texture"></param>
		public VolumeRendable( int slices, int size, string texture )
		{
			this.slices = slices;
			this.size = size;
			this.texture = texture;

			this.radius = Utility.Sqrt( size*size + size*size + size*size )/2.0f;
			box = new AxisAlignedBox( new Vector3( -size, -size, -size ), new Vector3( size, size, size ) );

			CastShadows = false;

			Initialize();
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:19,代码来源:VolumeRendable.cs

示例7: Init

		public void Init( AxisAlignedBox box, int depth )
		{
			if ( null != rootOctree )
				rootOctree = null;

			rootOctree = new Octree( this, null );

			maxDepth = depth;
			this.box = box;

			rootOctree.Box = box;

			Vector3 min = box.Minimum;

			Vector3 max = box.Maximum;

			rootOctree.HalfSize = ( max - min ) / 2;
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:18,代码来源:OctreeZone.cs

示例8: IsObjectVisible

		// this version checks against extra culling planes
		public new bool IsObjectVisible( AxisAlignedBox bound, out FrustumPlane culledBy )
		{
			culledBy = FrustumPlane.None;

			// Null boxes always invisible
			if ( bound.IsNull )
			{
				return false;
			}

			// infinite boxes always visible
			if ( bound.IsInfinite )
			{
				return true;
			}

			// Make any pending updates to the calculated frustum planes
			UpdateFrustumPlanes();

			// check extra culling planes
			bool extraResults;
			extraResults = this.extraCullingFrustum.IsObjectVisible( bound );
			if ( !extraResults )
			{
				return false;
			}

			// check "regular" camera frustum
			bool regcamresults = base.IsObjectVisible( bound, out culledBy );

			if ( !regcamresults )
			{
				// culled by regular culling planes
				return regcamresults;
			}


			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:40,代码来源:PCZCamera.cs

示例9: FindNodes

		/* Functions for finding Nodes that intersect various shapes */

		public abstract void FindNodes( AxisAlignedBox t, ref List<PCZSceneNode> list, List<Portal> visitedPortals,
		                                bool includeVisitors, bool recurseThruPortals, PCZSceneNode exclude );
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:4,代码来源:PCZone.cs

示例10: FindNodes

		public void FindNodes( AxisAlignedBox box, SceneNodeCollection sceneNodeList, SceneNode exclude, bool full, Octree octant )
		{
			List<OctreeNode> localList = new List<OctreeNode>();
			if ( octant == null )
			{
				octant = this.octree;
			}

			if ( !full )
			{
				AxisAlignedBox obox = octant.CullBounds;

				Intersection isect = this.Intersect( box, obox );

				if ( isect == Intersection.Outside )
				{
					return;
				}

				full = ( isect == Intersection.Inside );
			}

			foreach ( OctreeNode node in octant.NodeList.Values )
			{
				if ( node != exclude )
				{
					if ( full )
					{
						localList.Add( node );
					}
					else
					{
						Intersection nsect = this.Intersect( box, node.WorldAABB );

						if ( nsect != Intersection.Outside )
						{
							localList.Add( node );
						}
					}
				}
			}

			if ( octant.Children[ 0, 0, 0 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 0, 0 ] );

			if ( octant.Children[ 1, 0, 0 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 0, 0 ] );

			if ( octant.Children[ 0, 1, 0 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 1, 0 ] );

			if ( octant.Children[ 1, 1, 0 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 1, 0 ] );

			if ( octant.Children[ 0, 0, 1 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 0, 1 ] );

			if ( octant.Children[ 1, 0, 1 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 0, 1 ] );

			if ( octant.Children[ 0, 1, 1 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 1, 1 ] );

			if ( octant.Children[ 1, 1, 1 ] != null )
				FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 1, 1 ] );

		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:67,代码来源:OctreeSceneManager.cs

示例11: AddBoundingBox

		/// <summary>
		///		Adds a bounding box to draw if turned on.
		/// </summary>
		protected void AddBoundingBox( AxisAlignedBox aab, bool visible )
		{
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:6,代码来源:BspSceneManager.cs

示例12: Init

		public void Init( AxisAlignedBox box, int depth )
		{
			rootSceneNode = new OctreeNode( this, "SceneRoot" );
			rootSceneNode.SetAsRootNode();
			defaultRootNode = rootSceneNode;

			maxDepth = depth;

			octree = new Octree( null );

			octree.Box = box;

			Vector3 Min = box.Minimum;
			Vector3 Max = box.Maximum;

			octree.HalfSize = ( Max - Min ) / 2;

			numObjects = 0;

			Vector3 scalar = new Vector3( 1.5f, 1.5f, 1.5f );

			scaleFactor.Scale = scalar;
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:23,代码来源:OctreeSceneManager.cs

示例13: Resize

		/*public void AddOctreeNode(OctreeNode node, Octree octree)
		{


		}*/

		/** Resizes the octree to the given size */
		public void Resize( AxisAlignedBox box )
		{
			NodeCollection nodes = new NodeCollection();

			FindNodes( this.octree.Box, base.sceneNodeList, null, true, this.octree );

			octree = new Octree( null );
			octree.Box = box;

			foreach ( OctreeNode node in nodes.Values )
			{
				node.Octant = null;
				UpdateOctreeNode( node );
			}
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:22,代码来源:OctreeSceneManager.cs

示例14: Intersection

        /// <summary>
        ///		Calculate the area of intersection of this box and another
        /// </summary>
        public AxisAlignedBox Intersection( AxisAlignedBox b2 )
        {
            if( !Intersects( b2 ) )
            {
                return new AxisAlignedBox();
            }

            Vector3 intMin = Vector3.Zero;
            Vector3 intMax = Vector3.Zero;

            Vector3 b2max = b2.maxVector;
            Vector3 b2min = b2.minVector;

            if( b2max.x > maxVector.x && maxVector.x > b2min.x )
            {
                intMax.x = maxVector.x;
            }
            else
            {
                intMax.x = b2max.x;
            }
            if( b2max.y > maxVector.y && maxVector.y > b2min.y )
            {
                intMax.y = maxVector.y;
            }
            else
            {
                intMax.y = b2max.y;
            }
            if( b2max.z > maxVector.z && maxVector.z > b2min.z )
            {
                intMax.z = maxVector.z;
            }
            else
            {
                intMax.z = b2max.z;
            }

            if( b2min.x < minVector.x && minVector.x < b2max.x )
            {
                intMin.x = minVector.x;
            }
            else
            {
                intMin.x = b2min.x;
            }
            if( b2min.y < minVector.y && minVector.y < b2max.y )
            {
                intMin.y = minVector.y;
            }
            else
            {
                intMin.y = b2min.y;
            }
            if( b2min.z < minVector.z && minVector.z < b2max.z )
            {
                intMin.z = minVector.z;
            }
            else
            {
                intMin.z = b2min.z;
            }

            return new AxisAlignedBox( intMin, intMax );
        }
开发者ID:RainsSoft,项目名称:UAxiom3D-Lib,代码行数:68,代码来源:AxisAlignedBox.cs

示例15: Intersect

		public Intersection Intersect( Sphere sphere, AxisAlignedBox box )
		{
			intersect++;
			float Radius = sphere.Radius;
			Vector3 Center = sphere.Center;
			Vector3[] Corners = box.Corners;
			float s = 0;
			float d = 0;
			int i;
			bool Partial;

			Radius *= Radius;

			Vector3 MinDistance = ( Corners[ 0 ] - Center );
			Vector3 MaxDistance = ( Corners[ 4 ] - Center );

			if ( ( MinDistance.LengthSquared < Radius ) && ( MaxDistance.LengthSquared < Radius ) )
			{
				return Intersection.Inside;
			}

			//find the square of the distance
			//from the sphere to the box
			for ( i = 0; i < 3; i++ )
			{
				if ( Center[ i ] < Corners[ 0 ][ i ] )
				{
					s = Center[ i ] - Corners[ 0 ][ i ];
					d += s * s;
				}

				else if ( Center[ i ] > Corners[ 4 ][ i ] )
				{
					s = Center[ i ] - Corners[ 4 ][ i ];
					d += s * s;
				}
			}

			Partial = ( d <= Radius );

			if ( !Partial )
			{
				return Intersection.Outside;
			}
			else
			{
				return Intersection.Intersect;
			}
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:49,代码来源:OctreeSceneManager.cs


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