當前位置: 首頁>>代碼示例>>C#>>正文


C# PNode.IsOpaque方法代碼示例

本文整理匯總了C#中UMD.HCIL.Piccolo.PNode.IsOpaque方法的典型用法代碼示例。如果您正苦於以下問題:C# PNode.IsOpaque方法的具體用法?C# PNode.IsOpaque怎麽用?C# PNode.IsOpaque使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UMD.HCIL.Piccolo.PNode的用法示例。


在下文中一共展示了PNode.IsOpaque方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DetectOcclusions

		/// <summary>
		/// Traverse from the bottom right of the scene graph (top visible node)
		/// up the tree determining which parent nodes are occluded by their children
		/// nodes.
		/// </summary>
		/// <param name="n">The node to find occlusions for.</param>
		/// <param name="pickPath">
		/// A pick path representing the bounds of <c>n</c> in parent coordinates.
		/// </param>
		/// <remarks>
		/// Note that this is only detecting a subset of occlusions (parent, child),
		/// others such as overlapping siblings or cousins are not detected.
		/// </remarks>
		public void DetectOcclusions(PNode n, PPickPath pickPath) {
			if (n.FullIntersects(pickPath.PickBounds)) {
				pickPath.PushMatrix(n.MatrixReference);
		
				int count = n.ChildrenCount;
				for (int i = count - 1; i >= 0; i--) {
					PNode each = n[i];
					if (n.Occluded) {
						// if n has been occluded by a previous decendent then
						// this child must also be occluded
						each.Occluded = true;
					} else {
						// see if child each occludes n
						DetectOcclusions(each, pickPath);
					}
				}

				// see if n occludes it's parents		
				if (!n.Occluded) {
					if (n.Intersects(pickPath.PickBounds)) {
						if (n.IsOpaque(pickPath.PickBounds)) {
							PNode p = n.Parent;
							while (p != null && !p.Occluded) {
								p.Occluded = true;
							}
						}
					}
				}
	
				pickPath.PopMatrix(n.MatrixReference);
			}				
		}
開發者ID:CreeperLava,項目名稱:ME3Explorer,代碼行數:45,代碼來源:POcclusionDetection.cs


注:本文中的UMD.HCIL.Piccolo.PNode.IsOpaque方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。