この短い記事では、物理演算を組み込んだゲームを作成する全ての開発者にとって、本当に便利な'ツール'を紹介したいと思います。 特に不規則な形状をした独自のbody を作成する場合に役立ちます。 ご存知のように、既定ではphysics オブジェクト(bodies など)は目に見えません。 この作業を簡単に行うには、 >物理演算用のデバッグレンダー(nazgee氏が公開しているプロジェクト)を使用することができます。
これはどういったものなのでしょうか? これを使うと間単にBodyの'境界線'(同じ形状)が見れるようになるので、高度なBodyを作成する際にとても役立ちます。
DebugRenderer debug = new DebugRenderer(mPhysicsWorld, getVertexBufferObjectManager()); pScene.attachChild(debug);チェックアウト
このデバッグレンダーを有効にすると、あなたのゲームは目に見えてかなりスローダウンすることを覚えておいてください(言い換えれば、FPSにおいては比較的大きなロスになります)。 スローダウンの度合いはScene上のBodyの数に依存します。しかし、これを開発目的のみに使用すれば何の問題もありません。
Physics Debug Render:In this short article, I would like to introduce really useful 'tool' for every developer, creating game with physics involved. Especially while creating own body types with IRREGULAR BODY SHAPES. As you know, by default physics objects are invisible (bodies and so on) To make this task easier, you can use Physics Debug Renderer - project shared by nazgee. What it does? You will simply be able to view 'borders' of your bodies (with the same shape obviously) so it's really helpful while creating more advanced bodies. DebugRenderer debug = new DebugRenderer(mPhysicsWorld, getVertexBufferObjectManager()); pScene.attachChild(debug);Check out Keep in mind, that while enabling this debug render, your game may visibly and seriously slow down your game (relatively big loss in FPS in another words) obviously depends on amount of bodies on your scene. But since you will use it only for development purpose, its not a problem at all. |
注意事項
|