問題タブ [box2dweb]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
box2dweb - box2DWeb で ApplyForce を使用する方法
Box2DWeb スケッチは問題なく動作していますが、ボディで ApplyForce メソッドを使用する方法がわかりません。作業用コードペンを添付しました。85行目で、うまくいくと思った行をコメントアウトしましたが、それを含めるとすべてが消えてしまいます。
どなたか正しい使い方を教えていただけると助かります。私は RTFM を持っていて、StackO で同様の投稿を見ましたが、まだ解決できません。
http://codepen.io/anon/pen/vOJByN?editors=101
どうもありがとう、
スティーブン
phaser-framework - 2 つのスプライトが動的および静的に衝突し、動きが止まる
私は2つのスプライトを持っています
衝突検出に使用します
あなたの衝突がm_shipスプライトの動きを止めたとき、ありがとう
javascript - Box2D で接触リスナーの外側で衝突点を見つける
そのため、センサーの「目」(基本的には線) が 1 つまたは複数のオブジェクトと衝突する Box2D プロジェクトのシナリオがあり、目の底に最も近いものを見つけたいと考えています。これは、目に衝突するフィクスチャごとに、最も近い点を選択できるように、衝突のポイントを見つけたいということを意味します。
現在、私のコードは、目のリストと目と衝突するもののリストをコンタクト リスナーの に保存しBeginContact
、適切なものを で削除するように構成されていEndContact
ます。タイムステップごとにこのリストをループする予定です。
私の質問:
接触リスナーの外で衝突点を見つけるにはどうすればよいでしょうか? 私が知る限り、 と で提供されているsb2Contact
は持続しないため、それらが提供する接触マニホールドは使用できません。アイコンタクトリストをループするのが私の最善の策ですか?BeginContact
EndContact
ありがとう!
Kripken のbox2djsを使用します。
javascript - Revolute joint with box2d web, wheel not turning around own axis
I am trying to use revolute joints in node.js server, but my wheel is not turining around its own axis but around body.
Here is my code:
Then when i press button up i set motor speed like this:
And wheel start rotation around the center of the body, but i want to rotate around it's own center.
This are the settings of body and wheel :
What am i doing wrong ? Or maybe i should use different box2d implementation. I am using box2d from: https://www.npmjs.com/package/box2dweb