用户工具

站点工具


侧边栏

script:unityengine:classes:transform:transform.lossyscale

Transform.lossyScale 有损缩放

JavaScript ⇒ var lossyScale: Vector3;
C# ⇒ Vector3 lossyScale;

Description 描述

The global scale of the object (Read Only).

该对象的整体缩放(只读)。

Please note that if you have a parent transform with scale and a child that is arbitrarily rotated, the scale will be skewed. Thus scale can not be represented correctly in a 3 component vector but only a 3×3 matrix. Such a representation is quite inconvenient to work with however. lossyScale is a convenience property that attempts to match the actual world scale as much as it can. If your objects are not skewed the value will be completely correct and most likely the value will not be very different if it contains skew too.

请注意如果你有一个带有缩放的父变换和有任意旋转的子变换,此缩放将有偏差。因此缩放不能正确的表示在3组件的向量,而是一个3×3矩阵。这样表示工作十分不方便,lossyScale是个很方便的属性,它尽量匹配实际世界缩放,如果你的物体不是有偏差的,这个值将是完全正确的,如果物体包含偏差,这个值也不会有很大的不同。

JavaScript:

print (transform.lossyScale);

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Example() {
        print(transform.lossyScale);
    }
}

Transform

script/unityengine/classes/transform/transform.lossyscale.txt · 最后更改: 2016/08/02 05:37 (外部编辑)