本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Model.GetSize方法的典型用法代码示例。如果您正苦于以下问题:C# Model.GetSize方法的具体用法?C# Model.GetSize怎么用?C# Model.GetSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Graphics.Model
的用法示例。
在下文中一共展示了Model.GetSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpatialObject
/// <summary>
/// Creates a new spatial object.
/// </summary>
/// <param name="model">Model</param>
/// <param name="position">Posistion</param>
/// <param name="azimuth">Azimuth</param>
/// <param name="worldTransform">World transform matrix</param>
public SpatialObject(Model model, PositionInTown position, double azimuth, Matrix worldTransform)
: base(position, azimuth, (model == null ? Vector2.Zero : model.GetSize(worldTransform).XZToVector2()))
{
Load(model, position, 0, azimuth, worldTransform);
}
示例2: Load
protected void Load(Model model, PositionInTown position, float verticalPosition, double azimuth, Matrix worldTransform)
{
this.model = model;
this.verticalPosition = verticalPosition;
Vector3 size = Vector3.Zero;
if (model != null)
{
size = model.GetSize(worldTransform);
verticalSize = size.Y;
}
base.Load(position, azimuth, size.XZToVector2());
}