我所处的情况是,必须能够用两个不同的名称调用对象上的方法,而我找到的最短方法如下:
var c = {
a : function() {console.log("called a!");}.
b : function() {this.a();}
};
我很希望有这样的事情:
var c = {
a,b : function() {console.log("called a!");}.
};
但到目前为止,我的研究还没有发生过类似的事情。还有更好的办法吗?
我有地形和实体(npc,house.)。
我能够用glReadPixels函数将屏幕坐标转换为世界坐标:
glReadPixels(mousePosition.x, mousePosition.y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z);
// of course its not just that...
我的角色可以在那个地形上移动,没有问题,但是当鼠标在大房子上移动时,我无法移动,我试图移动“后面”的房子。
当将屏幕坐标转换为世界坐标时,您知道如何避免实体吗?