Changeset 1865
- Timestamp:
- 11/04/09 17:35:18 (2 months ago)
- Location:
- branches/ogre_1.7_update/Projects/Axiom
- Files:
-
- 12 modified
-
Engine/Core/BillboardSet.cs (modified) (2 diffs)
-
Engine/Core/CoreEnums.cs (modified) (1 diff)
-
Engine/Core/Entity.cs (modified) (2 diffs)
-
Engine/Core/Frustum.cs (modified) (2 diffs)
-
Engine/Core/Light.cs (modified) (4 diffs)
-
Engine/Core/MovableObject.cs (modified) (1 diff)
-
Engine/Core/SceneQuery.cs (modified) (1 diff)
-
Engine/Core/StaticGeometry/Region.cs (modified) (1 diff)
-
Engine/ParticleSystems/ParticleSystem.cs (modified) (1 diff)
-
Plugins/OctreeZone/TerrainZoneRenderable.cs (modified) (1 diff, 1 prop)
-
SceneManagers/Bsp/BspSceneManager.cs (modified) (2 diffs)
-
SceneManagers/Octree/TerrainRenderable.cs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/BillboardSet.cs
r1800 r1865 1798 1798 #endregion 1799 1799 1800 #region Implementation of SceneObject1800 #region MovableObject Implementation 1801 1801 1802 1802 public override AxisAlignedBox BoundingBox … … 2036 2036 } 2037 2037 2038 #endregion 2038 public override ulong TypeFlags 2039 { 2040 get 2041 { 2042 return (ulong)SceneQueryTypeMask.Fx; 2043 } 2044 } 2045 2046 #endregion MovableObject Implementation 2039 2047 } 2040 2048 -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/CoreEnums.cs
r1741 r1865 75 75 Overhead = 16 76 76 } 77 /// <summary> 78 /// Scene Query Type Mask values 79 /// </summary> 80 /// <seealso cref="SceneQuery"/> 81 [Flags] 82 public enum SceneQueryTypeMask : ulong 83 { 84 /// <summary>Query type mask which will be used for world geometry <see cref="SceneQuery"/></summary> 85 WorldGeometry = 0x80000000, 86 /// <summary>Query type mask which will be used for entities <see cref="SceneQuery"/></summary> 87 Entity = 0x40000000, 88 /// <summary>Query type mask which will be used for effects like billboardsets / particle systems <see cref="SceneQuery"/></summary> 89 Fx = 0x20000000, 90 /// <summary>Query type mask which will be used for StaticGeometry <see cref="SceneQuery"/></summary> 91 StaticGeometry = 0x10000000, 92 /// <summary>Query type mask which will be used for lights <see cref="SceneQuery"/></summary> 93 Light = 0x08000000, 94 /// <summary>Query type mask which will be used for frusta and cameras <see cref="SceneQuery"/></summary> 95 Frustum = 0x04000000, 96 /// <summary>User type mask limit</summary> 97 UserLimit = Frustum 98 } 77 99 78 100 /// <summary> -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/Entity.cs
r1800 r1865 1617 1617 #endregion 1618 1618 1619 #region Implementation of SceneObject1619 #region MovableObject Implementation 1620 1620 1621 1621 private static TimingMeter copyAnimationMeter = MeterManager.GetMeter( "Copy Animation", "Entity Queue" ); … … 2217 2217 } 2218 2218 2219 #endregion Methods 2219 public override ulong TypeFlags 2220 { 2221 get 2222 { 2223 return (ulong)SceneQueryTypeMask.Entity; 2224 } 2225 } 2226 2227 #endregion MovableObject Implementation 2220 2228 2221 2229 /// <summary> -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/Frustum.cs
r1800 r1865 1823 1823 #endregion 1824 1824 1825 #region SceneObject Members1825 #region MovableObject Implementation 1826 1826 1827 1827 /// <summary> … … 1866 1866 queue.AddRenderable(this); 1867 1867 } 1868 } 1869 1870 #endregion SceneObject Members 1871 1872 #region IRenderable Members 1873 1874 public bool CastsShadows 1868 } 1869 1870 public override ulong TypeFlags 1871 { 1872 get 1873 { 1874 return (ulong)SceneQueryTypeMask.Frustum; 1875 } 1876 } 1877 1878 #endregion MovableObject Implementation 1879 1880 #region IRenderable Members 1881 1882 public bool CastsShadows 1875 1883 { 1876 1884 get -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/Light.cs
r1663 r1865 162 162 protected LightType type; 163 163 164 protected Real powerScale = 1.0f; 165 protected bool ownShadowFarDistance = false; 166 protected Real shadowFarDistance = 0.0f; 167 protected Real shadowFarDistanceSquared = 0.0f; 168 164 169 #endregion 165 170 … … 440 445 get 441 446 { 442 throw new NotImplementedException(); 443 } 444 set 445 { 446 throw new NotImplementedException(); 447 return ownShadowFarDistance ? shadowFarDistance : Manager.ShadowFarDistance; 448 } 449 set 450 { 451 ownShadowFarDistance = true; 452 shadowFarDistance = value; 453 shadowFarDistanceSquared = value * value; 454 } 455 } 456 457 public float ShadowFarDistanceSquared 458 { 459 get 460 { 461 return ownShadowFarDistance ? shadowFarDistanceSquared : Manager.ShadowFarDistanceSquared; 447 462 } 448 463 } … … 452 467 get 453 468 { 454 throw new NotImplementedException();455 } 456 set 457 { 458 throw new NotImplementedException();469 return powerScale; 470 } 471 set 472 { 473 powerScale = value; 459 474 } 460 475 } … … 1227 1242 } 1228 1243 1244 public override ulong TypeFlags 1245 { 1246 get 1247 { 1248 return (ulong)SceneQueryTypeMask.Light; 1249 } 1250 } 1251 1229 1252 #endregion MovableObject Implementation 1230 1253 -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/MovableObject.cs
r1793 r1865 449 449 /// meaning of the bits is application-specific. 450 450 /// </remarks> 451 public ulong QueryFlags451 public virtual ulong QueryFlags 452 452 { 453 453 get -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/SceneQuery.cs
r1793 r1865 108 108 this.creator = creator; 109 109 110 this.queryMask = 0xFFFFFFFF; 111 112 // default type mask to everything except lights & fx (previous behaviour) 113 this.queryTypeMask = ( 0xFFFFFFFF & (ulong)~SceneQueryTypeMask.Fx ) & (ulong)~SceneQueryTypeMask.Light; 114 110 115 // default to no world fragments queried 111 116 AddWorldFragmentType( WorldFragmentType.None ); -
branches/ogre_1.7_update/Projects/Axiom/Engine/Core/StaticGeometry/Region.cs
r1793 r1865 508 508 } 509 509 510 public override ulong TypeFlags 511 { 512 get 513 { 514 return (ulong)SceneQueryTypeMask.StaticGeometry; 515 } 516 } 510 517 #endregion MovableObject Implementation 511 518 } -
branches/ogre_1.7_update/Projects/Axiom/Engine/ParticleSystems/ParticleSystem.cs
r1663 r1865 1645 1645 } 1646 1646 1647 public override ulong TypeFlags 1648 { 1649 get 1650 { 1651 return (ulong)SceneQueryTypeMask.Fx; 1652 } 1653 } 1654 1647 1655 internal ParticleSystemRenderer Renderer 1648 1656 { -
branches/ogre_1.7_update/Projects/Axiom/Plugins/OctreeZone/TerrainZoneRenderable.cs
- Property svn:mergeinfo
-
old new 1 1 /branches/crickhollow/Projects/Axiom/Source/Plugins/OctreeZone/TerrainZoneRenderable.cs:1012-1662 2 /trunk/Projects/Axiom/Plugins/OctreeZone/TerrainZoneRenderable.cs:1842-1861
-
r1800 r1865 1703 1703 } 1704 1704 1705 public override ulong TypeFlags 1706 { 1707 get 1708 { 1709 return (ulong)SceneQueryTypeMask.WorldGeometry; 1710 } 1711 } 1712 1705 1713 #endregion 1706 1714 } - Property svn:mergeinfo
-
branches/ogre_1.7_update/Projects/Axiom/SceneManagers/Bsp/BspSceneManager.cs
r1822 r1865 1343 1343 1344 1344 // check object against brushes 1345 foreach ( BspBrush brush in leaf.SolidBrushes) 1346 { 1347 if ( brush == null ) 1348 continue; 1349 1350 // test brush against object 1351 boundedVolume.planes = brush.Planes; 1352 if ( boundedVolume.Intersects( aBox ) ) 1345 if ( ( QueryTypeMask & (ulong)SceneQueryTypeMask.WorldGeometry ) != 0 ) 1346 { 1347 foreach ( BspBrush brush in leaf.SolidBrushes ) 1353 1348 { 1354 // check if this pair is already reported 1355 IList interBrushList = brushIntersections.FindBucket( aObj ); 1356 if ( interBrushList == null || interBrushList.Contains( brush ) == false) 1349 if ( brush == null ) 1350 continue; 1351 1352 // test brush against object 1353 boundedVolume.planes = brush.Planes; 1354 if ( boundedVolume.Intersects( aBox ) ) 1357 1355 { 1358 brushIntersections.Add( aObj, brush ); 1359 // report this brush as it's WorldFragment 1360 listener.OnQueryResult( aObj, brush.Fragment ); 1356 // check if this pair is already reported 1357 IList interBrushList = brushIntersections.FindBucket( aObj ); 1358 if ( interBrushList == null || interBrushList.Contains( brush ) == false ) 1359 { 1360 brushIntersections.Add( aObj, brush ); 1361 // report this brush as it's WorldFragment 1362 listener.OnQueryResult( aObj, brush.Fragment ); 1363 } 1361 1364 } 1362 1365 } … … 1466 1469 1467 1470 // Check ray against brushes 1468 for ( int brushPoint = 0; brushPoint < leaf.SolidBrushes.Length; brushPoint++ ) 1469 { 1470 BspBrush brush = leaf.SolidBrushes[ brushPoint ]; 1471 1472 if ( brush == null ) 1473 continue; 1474 1475 boundedVolume.planes = brush.Planes; 1476 1477 IntersectResult result = tracingRay.Intersects( boundedVolume ); 1478 // if the result came back positive and intersection point is inside 1479 // the node, check if this brush is closer 1480 if ( result.Hit && result.Distance <= maxDistance ) 1481 { 1482 if ( result.Distance < intersectBrushDist ) 1483 { 1484 intersectBrushDist = result.Distance; 1485 intersectBrush = brush; 1486 } 1487 } 1488 } 1489 1490 if ( intersectBrush != null ) 1491 { 1492 listener.OnQueryResult( intersectBrush.Fragment, intersectBrushDist + traceDistance ); 1493 StopRayTracing = true; 1471 if ( ( QueryTypeMask & (ulong)SceneQueryTypeMask.WorldGeometry ) != 0 ) 1472 { 1473 for ( int brushPoint = 0; brushPoint < leaf.SolidBrushes.Length; brushPoint++ ) 1474 { 1475 BspBrush brush = leaf.SolidBrushes[ brushPoint ]; 1476 1477 if ( brush == null ) 1478 continue; 1479 1480 boundedVolume.planes = brush.Planes; 1481 1482 IntersectResult result = tracingRay.Intersects( boundedVolume ); 1483 // if the result came back positive and intersection point is inside 1484 // the node, check if this brush is closer 1485 if ( result.Hit && result.Distance <= maxDistance ) 1486 { 1487 if ( result.Distance < intersectBrushDist ) 1488 { 1489 intersectBrushDist = result.Distance; 1490 intersectBrush = brush; 1491 } 1492 } 1493 } 1494 1495 if ( intersectBrush != null ) 1496 { 1497 listener.OnQueryResult( intersectBrush.Fragment, intersectBrushDist + traceDistance ); 1498 StopRayTracing = true; 1499 } 1494 1500 } 1495 1501 } -
branches/ogre_1.7_update/Projects/Axiom/SceneManagers/Octree/TerrainRenderable.cs
r1800 r1865 550 550 #endregion Methods 551 551 552 #region SceneObject Members552 #region MovableObject Implementation 553 553 554 554 public override AxisAlignedBox BoundingBox … … 567 567 } 568 568 } 569 570 public override ulong TypeFlags 571 { 572 get 573 { 574 return (ulong)SceneQueryTypeMask.WorldGeometry; 575 } 576 } 569 577 570 578 public override void NotifyCurrentCamera( Camera camera ) … … 605 613 { 606 614 queue.AddRenderable( this ); 607 }608 609 #endregion SceneObject Members 610 611 #region IRenderable Members 612 613 public bool CastsShadows615 } 616 617 #endregion MovableObject Implementation 618 619 #region IRenderable Implementation 620 621 public bool CastsShadows 614 622 { 615 623 get … … 994 1002 } 995 1003 996 #endregion 1004 #endregion IRenderable Implementation 997 1005 } 998 1006
