本文整理汇总了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 );
}
示例2: OnCalculateMapBounds
protected override void OnCalculateMapBounds( ref Bounds bounds )
{
base.OnCalculateMapBounds( ref bounds );
bounds.Add( GetBox().ToBounds() );
}
示例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 );
}
}
示例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 );
}
示例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 );
}