本文整理汇总了C#中Axiom.Math.AxisAlignedBox类的典型用法代码示例。如果您正苦于以下问题:C# AxisAlignedBox类的具体用法?C# AxisAlignedBox怎么用?C# AxisAlignedBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisAlignedBox类属于Axiom.Math命名空间,在下文中一共展示了AxisAlignedBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: FindShadowCastersForLight
/// <summary>
/// Internal method for locating a list of shadow casters which
/// could be affecting the frustum for a given light.
/// </summary>
/// <remarks>
/// Custom scene managers are encouraged to override this method to add optimizations,
/// and to add their own custom shadow casters (perhaps for world geometry)
/// </remarks>
/// <param name="light"></param>
/// <param name="camera"></param>
protected virtual IList FindShadowCastersForLight( Light light, Camera camera )
{
this.shadowCasterList.Clear();
if ( light.Type == LightType.Directional )
{
// Basic AABB query encompassing the frustum and the extrusion of it
AxisAlignedBox aabb = new AxisAlignedBox();
Vector3[] corners = camera.WorldSpaceCorners;
Vector3 min, max;
Vector3 extrude = light.DerivedDirection * -this.shadowDirLightExtrudeDist;
// do first corner
min = max = corners[ 0 ];
min.Floor( corners[ 0 ] + extrude );
max.Ceil( corners[ 0 ] + extrude );
for ( int c = 1; c < 8; ++c )
{
min.Floor( corners[ c ] );
max.Ceil( corners[ c ] );
min.Floor( corners[ c ] + extrude );
max.Ceil( corners[ c ] + extrude );
}
aabb.SetExtents( min, max );
if ( this.shadowCasterAABBQuery == null )
{
this.shadowCasterAABBQuery = this.CreateAABBRegionQuery( aabb );
}
else
{
this.shadowCasterAABBQuery.Box = aabb;
}
// Execute, use callback
this.shadowCasterQueryListener.Prepare( false,
light.GetFrustumClipVolumes( camera ),
light,
camera,
this.shadowCasterList,
light.ShadowFarDistanceSquared );
this.shadowCasterAABBQuery.Execute( this.shadowCasterQueryListener );
}
else
{
Sphere s = new Sphere( light.DerivedPosition, light.AttenuationRange );
// eliminate early if camera cannot see light sphere
if ( camera.IsObjectVisible( s ) )
{
// create or init a sphere region query
if ( this.shadowCasterSphereQuery == null )
{
this.shadowCasterSphereQuery = this.CreateSphereRegionQuery( s );
}
else
{
this.shadowCasterSphereQuery.Sphere = s;
}
// check if the light is within view of the camera
bool lightInFrustum = camera.IsObjectVisible( light.DerivedPosition );
PlaneBoundedVolumeList volumeList = null;
// Only worth building an external volume list if
// light is outside the frustum
if ( !lightInFrustum )
{
volumeList = light.GetFrustumClipVolumes( camera );
}
// prepare the query and execute using the callback
this.shadowCasterQueryListener.Prepare(
lightInFrustum,
volumeList,
light,
camera,
this.shadowCasterList,
light.ShadowFarDistanceSquared );
this.shadowCasterSphereQuery.Execute( this.shadowCasterQueryListener );
}
}
return this.shadowCasterList;
}
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:95,代码来源:SceneManager.cs
示例17: IsObjectVisible
public new bool IsObjectVisible( AxisAlignedBox box, out FrustumPlane culledBy )
{
if ( null != CullFrustum )
{
return CullFrustum.IsObjectVisible( box, out culledBy );
}
else
{
return base.IsObjectVisible( box, out culledBy );
}
}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:11,代码来源:Camera.cs
示例18: SetBounds
protected void SetBounds( AxisAlignedBox box, float radius )
{
this.aab = box;
this.boundingRadius = radius;
}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:5,代码来源:BillboardSet.cs
示例19: CreateAABBRegionQuery
/// <summary>
/// Creates a <see cref="AxisAlignedBoxRegionSceneQuery"/> for this scene manager.
/// </summary>
/// <remarks>
/// This method creates a new instance of a query object for this scene manager,
/// for querying for objects within a AxisAlignedBox region.
/// </remarks>
/// <param name="box">AxisAlignedBox to use for the region query.</param>
/// <param name="mask">Custom user defined flags to use for the query.</param>
/// <returns>A specialized implementation of AxisAlignedBoxRegionSceneQuery for this scene manager.</returns>
public virtual AxisAlignedBoxRegionSceneQuery CreateAABBRegionQuery( AxisAlignedBox box, uint mask )
{
DefaultAxisAlignedBoxRegionSceneQuery query = new DefaultAxisAlignedBoxRegionSceneQuery( this );
query.Box = box;
query.QueryMask = mask;
return query;
}
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:18,代码来源:SceneManager.cs
示例20: AxisAlignedBox
public AxisAlignedBox( AxisAlignedBox box )
{
SetExtents( box.Minimum, box.Maximum );
isNull = box.IsNull;
isInfinite = box.IsInfinite;
}
开发者ID:RainsSoft,项目名称:UAxiom3D-Lib,代码行数:6,代码来源:AxisAlignedBox.cs
注:本文中的Axiom.Math.AxisAlignedBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论