本文整理匯總了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());
}