phy_com_x

只读变量将返回实例质心的 X 位置。这是根据相应函数定义的实例的密度、惯性和质量自动计算的

 

语法:

phy_com_x;

 

返回:

Real (single precision floating point value, or undefined if the instance is not physics enabled)

 

例子:

xx = phy_com_x;
yy = phy_com_y;

上述代码将两个变量设置为实例质心的 X 和 Y 位置。