本文整理汇总了C#中UnityEngine.Matrix4x4.GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix4x4.GetPosition方法的具体用法?C# Matrix4x4.GetPosition怎么用?C# Matrix4x4.GetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Matrix4x4
的用法示例。
在下文中一共展示了Matrix4x4.GetPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessMarker
private void ProcessMarker(MarkerInfo marker)
{
var pose = marker.transform_matrix;
var transformMatrix = new Matrix4x4();
transformMatrix.m00 = pose.m00;
transformMatrix.m01 = pose.m01;
transformMatrix.m02 = pose.m02;
transformMatrix.m03 = pose.m03;
transformMatrix.m10 = pose.m10;
transformMatrix.m11 = pose.m11;
transformMatrix.m12 = pose.m12;
transformMatrix.m13 = pose.m13;
transformMatrix.m20 = pose.m20;
transformMatrix.m21 = pose.m21;
transformMatrix.m22 = pose.m22;
transformMatrix.m23 = pose.m23;
transformMatrix.m30 = 0;
transformMatrix.m31 = 0;
transformMatrix.m32 = 0;
transformMatrix.m33 = 1;
if (NewPoseDetected != null)
{
NewPoseDetected(new MarkerPose
{
Id = marker.id,
Name = marker.name,
Position = transformMatrix.GetPosition(),
Rotation = transformMatrix.GetRotation()
});
}
}
示例2: LocalFromMatrix4x4
public static void LocalFromMatrix4x4(this Transform transform, Matrix4x4 matrix)
{
transform.localScale = matrix.GetScale();
transform.localRotation = matrix.GetRotation();
transform.localPosition = matrix.GetPosition();
}
示例3: SetPosition
//TODO:fix it
internal void SetPosition(Matrix4x4 matrix)
{
this.gameObject.transform.position = matrix.GetPosition();
this.gameObject.transform.rotation = matrix.GetUnityRotation();
this.gameObject.transform.localScale = matrix.GetScale();
}