[LayaAir 2.0]关于2.1.0代码设计的疑问
1.关于 2.1.0版本 Vector3 的疑问
如下:2.1.0的Vector3
/**@private */
public static const _ZERO:Vector3 =/*[STATIC SAFE]*/ new Vector3(0.0, 0.0, 0.0);
/**@private */
public static const _ONE:Vector3 =/*[STATIC SAFE]*/ new Vector3(1.0, 1.0, 1.0);
/**@private */
public static const _NegativeUnitX:Vector3 =/*[STATIC SAFE]*/ new Vector3(-1, 0, 0);
/**@private */
public static const _UnitX:Vector3 =/*[STATIC SAFE]*/ new Vector3(1, 0, 0);
/**@private */
public static const _UnitY:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 1, 0);
/**@private */
public static const _UnitZ:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 0, 1);
/**@private */
public static const _ForwardRH:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 0, -1);
/**@private */
public static const _ForwardLH:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 0, 1);
/**@private */
public static const _Up:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 1, 0);
2.0.1 Vector3
/**零向量,禁止修改*/如图所示:Up 改成 _Up 这么改有什么特别意义么,如果我们升级引擎代码,只要用到的要全都改一遍,而且感觉不到有什么意义
public static const ZERO:Vector3 =/*[STATIC SAFE]*/ new Vector3(0.0, 0.0, 0.0);
/**一向量,禁止修改*/
public static const ONE:Vector3 =/*[STATIC SAFE]*/ new Vector3(1.0, 1.0, 1.0);
/**X轴单位向量,禁止修改*/
public static const NegativeUnitX:Vector3 =/*[STATIC SAFE]*/ new Vector3(-1, 0, 0);
/**X轴单位向量,禁止修改*/
public static const UnitX:Vector3 =/*[STATIC SAFE]*/ new Vector3(1, 0, 0);
/**Y轴单位向量,禁止修改*/
public static const UnitY:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 1, 0);
/**Z轴单位向量,禁止修改*/
public static const UnitZ:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 0, 1);
/**右手坐标系统前向量,禁止修改*/
public static const ForwardRH:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 0, -1);
/**左手坐标系统前向量,禁止修改*/
public static const ForwardLH:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 0, 1);
/**上向量,禁止修改*/
public static const Up:Vector3 =/*[STATIC SAFE]*/ new Vector3(0, 1, 0);
2.Transform3D 里面
2.0.1里面的_forward,_up ,_right 这几个成员在2.1.0里面也被删掉了。这也感觉很奇怪,如果要获取forward变成了自己要在外部创建变量,o(╥﹏╥)o
/** @private */能给解释一下,引擎组是怎么考虑的,然后才这么改么
private var _forward:Vector3 = new Vector3();
/** @private */
private var _up:Vector3 = new Vector3();
/** @private */
private var _right:Vector3 = new Vector3();
/** @private */
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复