本文整理汇总了C#中ScriptCoreLib.translate方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptCoreLib.translate方法的具体用法?C# ScriptCoreLib.translate怎么用?C# ScriptCoreLib.translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib
的用法示例。
在下文中一共展示了ScriptCoreLib.translate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application
//.........这里部分代码省略.........
return xx;
}
),
create = new Func<float[]>(
() =>
//new mat4()
new float[]
{
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
}
),
#region not used?
clone = new Func<float[], float[]>(
smat4 =>
//new mat4()
new float[]
{
smat4[0], smat4[1], smat4[2], smat4[3],
smat4[4], smat4[5], smat4[6], smat4[7],
smat4[8], smat4[9], smat4[10], smat4[11],
smat4[12], smat4[13], smat4[14], smat4[15],
}
)
#endregion
,
// X:\jsc.svn\examples\java\android\vr\OVRWindWheelNDK\OVRWindWheelNDK\References\VrApi.ovrMatrix4f.cs
translate = new Func<float[], float[], float[], float[]>(
(float[] that, float[] output, float[] xyz) =>
{
float xx = xyz[0], y = xyz[1], z = xyz[2];
if (output == that)
{
that[12] = output[0] * xx + output[4] * y + output[8] * z + output[12];
that[13] = output[1] * xx + output[5] * y + output[9] * z + output[13];
that[14] = output[2] * xx + output[6] * y + output[10] * z + output[14];
that[15] = output[3] * xx + output[7] * y + output[11] * z + output[15];
return that;
}
float a00, a01, a02, a03,
a10, a11, a12, a13,
a20, a21, a22, a23;
a00 = output[0]; a01 = output[1]; a02 = output[2]; a03 = output[3];
a10 = output[4]; a11 = output[5]; a12 = output[6]; a13 = output[7];
a20 = output[8]; a21 = output[9]; a22 = output[10]; a23 = output[11];
that[0] = a00; that[1] = a01; that[2] = a02; that[3] = a03;
that[4] = a10; that[5] = a11; that[6] = a12; that[7] = a13;
that[8] = a20; that[9] = a21; that[10] = a22; that[11] = a23;
that[12] = a00 * xx + a10 * y + a20 * z + output[12];
that[13] = a01 * xx + a11 * y + a21 * z + output[13];
that[14] = a02 * xx + a12 * y + a22 * z + output[14];
that[15] = a03 * xx + a13 * y + a23 * z + output[15];