【发布时间】:2014-11-12 11:30:39
【问题描述】:
我在 Gles2 中使用 AndEngine LevelLoader 来加载构成游戏墙的矩形。
<entity x="0" y="477" width="800" height="10" type="wall"/>
<entity x="800" y="477" width="240" height="10" angle="315" type="wall"/>
并使用以下代码创建矩形
Rectangle rect = new Rectangle(x, y,
width, height, activity.getVertexBufferObjectManager());
rect.setRotation(angle);
Body block = PhysicsFactory.createBoxBody(this.mPhysicsWorld, rect,
BodyType.StaticBody, objectFixtureDef);
它有效,但我想要下面的图片演示会发生什么。是否有任何公式可以计算出矩形的起始 Y 值使其相遇,或者如何转换矩形以使其与另一个矩形相邻?
提前致谢。
【问题讨论】:
-
您使用的是 GLES 2.0 Anchor Center?
-
不,不是 Anchor Center,只是 GLES 2 分支。
标签: box2d andengine trigonometry