此变量可用于获取或更改实例线性速度矢量的 X 分量,以每步像素数为单位定义 (对于每秒像素数,请参见 phy_linear_velocity_x)。对于静态实例 (即密度为 0 的实例),更改此变量将使其变为运动学实例。
phy_speed_x;
Real (single precision floating point value, or undefined if the instance is not physics enabled)
if (phy_speed_x != 0)
{
phy_speed_x = 0;
}
上述代码将检查线性速度矢量的 X 分量,如果它不是 0,则将其设置为 0。