0
我正在使用andengine通過box2d創建物理模擬。座標系和精靈轉換
這些物體是通過PhysicsFactory使用Sprites創建的。
我的想法是程序上定位這些精靈,下面這個模式:
代表我的世界座標中心基本上是一箇中央的精靈,而且是通過繞myWorld中心基地精靈創造了一系列克隆精靈(圓圈內的「X」)。
我試圖使用OpenGL方式中andengine(平移,旋轉,後翻譯)
super(stamiRadious, 0, image); //stamiDoadious is te distance from radix (world center) and "petal" attach point
this.setRotationCenter(0, 0);
this.setRotation((float) Math.toDegrees(angleRad));
this.setPosition(this.getX()+radixX, this.getY()+radixY);
但我失敗了:結果不正確的(錯誤的最終位置,和錯誤的Box2D的身體財產,猶如該精靈比圖像大得多)
我相信部分問題依賴於我對setRotation
和setRotationCenter
的解釋,並且一般以我對andengine座標系統+ box2d座標系統的理解爲依據。
任何想法/鏈接到doc /解釋?