本文整理汇总了C#中Microsoft.GetCorners方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.GetCorners方法的具体用法?C# Microsoft.GetCorners怎么用?C# Microsoft.GetCorners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft
的用法示例。
在下文中一共展示了Microsoft.GetCorners方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartFrame
public override void StartFrame(ref Microsoft.Xna.Framework.Matrix view, ref Microsoft.Xna.Framework.Matrix projection, Microsoft.Xna.Framework.BoundingFrustum frustrum)
{
rend = 0;
MaterialSortedObjects.Clear();
Vector3[] corners = new Vector3[8];
frustrum.GetCorners(corners);
List<I2DPhysicObject> objs = world.PhysicWorld.TestAABB(new Vector2(corners[0].X, corners[0].Y), new Vector2(corners[2].X, corners[2].Y));
foreach (var item in objs)
{
I2DObject obj = item.Owner;
if (!MaterialSortedObjects.ContainsKey(obj.Material.GetType()))
{
MaterialSortedObjects[obj.Material.GetType()] = new List<I2DObject>();
}
MaterialSortedObjects[obj.Material.GetType()].Add(obj);
rend++;
}
foreach (var obj in ghosts)
{
if (!MaterialSortedObjects.ContainsKey(obj.Material.GetType()))
{
MaterialSortedObjects[obj.Material.GetType()] = new List<I2DObject>();
}
MaterialSortedObjects[obj.Material.GetType()].Add(obj);
}
rend += ghosts.Count;
}
示例2: DoPreFrameWork
public override void DoPreFrameWork(Microsoft.Xna.Framework.BoundingFrustum frustum)
{
Vector3[] corners = frustum.GetCorners();
float xx = corners[6].X - corners[2].X;
float yy = corners[2].Y - corners[6].Y;
float dx = (corners[2].Y * xx) / yy;
int minx = (int)(corners[0].X - dx);
int maxx = (int)(corners[2].X + dx);
minx = (int)MathHelper.Clamp(minx / 32, 0, blocks.Length-1);
maxx = (int)MathHelper.Clamp(maxx / 32, 0, blocks.Length-1);
leftFrameBlock = minx;
rightFrameBlock = maxx;
}