本文整理匯總了C#中Vector3F.Clamp方法的典型用法代碼示例。如果您正苦於以下問題:C# Vector3F.Clamp方法的具體用法?C# Vector3F.Clamp怎麽用?C# Vector3F.Clamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vector3F
的用法示例。
在下文中一共展示了Vector3F.Clamp方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Clamp2
public void Clamp2()
{
Vector3F clamped = new Vector3F(-10, 1, 100);
clamped.Clamp(-1, 0);
Assert.AreEqual(-1, clamped.X);
Assert.AreEqual(0, clamped.Y);
Assert.AreEqual(0, clamped.Z);
}
示例2: Clamp1
public void Clamp1()
{
Vector3F clamped = new Vector3F(-10f, 1f, 100f);
clamped.Clamp(-100f, 100f);
Assert.AreEqual(-10f, clamped.X);
Assert.AreEqual(1f, clamped.Y);
Assert.AreEqual(100f, clamped.Z);
}