本文整理汇总了C#中System.Vector4.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Vector4.ToString方法的具体用法?C# Vector4.ToString怎么用?C# Vector4.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector4
的用法示例。
在下文中一共展示了Vector4.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OverrideLoadedProperties
public override void OverrideLoadedProperties()
{
base.OverrideLoadedProperties();
/* should be set by engine, so reset properties works as expected */
_alphaAnimationComponent = Components.First(c => c.Id == AlphaAnimationComponentId) as PropertyAnimationComponent;
_alphaAnimationComponent.Property = "StarColor";
_alphaAnimationComponent.StartValue = StarColor.ToString().Replace("(", string.Empty).Replace(")", string.Empty);
var stopColor = new Vector4(StarColor.X, StarColor.Y, StarColor.Z, 0);
_alphaAnimationComponent.StopValue = stopColor.ToString().Replace("(", string.Empty).Replace(")", string.Empty);
_alphaAnimationComponent.DurationSeconds = 0.5f;
_rotationAnimationComponent = Components.First(c => c.Id == RotationAnimationComponentId) as PropertyAnimationComponent;
_rotationAnimationComponent.Property = "Rotation";
_rotationAnimationComponent.StartValue = new Vector3(0, 0, this.Rotation.Z).ToString().Replace("(", string.Empty).Replace(")", string.Empty);
_rotationAnimationComponent.StopValue = new Vector3(0, 6.28f / 2f, this.Rotation.Z).ToString().Replace("(", string.Empty).Replace(")", string.Empty);
_rotationAnimationComponent.DurationSeconds = 0.5f;
DistanceSorting = true;
_grabbed = false;
_flare.Position = this.WorldPosition;
}
示例2: Vector4ToStringTest
public void Vector4ToStringTest()
{
Vector4 target = new Vector4(-1.0f, 2.2f, 3.3f, -4.4f);
string expected = "{X:-1 Y:2.2 Z:3.3 W:-4.4}";
string actual;
actual = target.ToString();
Assert.AreEqual(expected, actual, "Vector4.ToString did not return the expected value.");
}
示例3: TestMemberFn_ToString_i
public void TestMemberFn_ToString_i ()
{
Vector4 a = new Vector4(42, -17, 13, 44);
String result = a.ToString();
String expected = "{X:42 Y:-17 Z:13 W:44}";
Assert.That(result, Is.EqualTo(expected));
}
示例4: GetShapeArray
public float[] GetShapeArray(string filename, Vector4 color, bool inverted)
{
if (!shapeArrayDict.ContainsKey(filename + color.ToString()))
{
shapeArrayDict[filename + color.ToString()] = modelReader.GetFloatArray(filename, color, inverted);
//Debug.WriteLine("Made a dict entry: " + filename+color.ToString());
}
return shapeArrayDict[filename + color.ToString()];
}
示例5: ColorVec4ToVector4
public static Vector4 ColorVec4ToVector4(Vector4 color)
{
#if DEBUG
Console.WriteLine(color.ToString() + " -> " + new Vector4((color.X / 255), (color.Y / 255), (color.Z / 255), (color.W / 255)).ToString());
#endif
return new Vector4((color.X / 255), (color.Y / 255), (color.Z / 255), (color.W / 255));
}