Class Index | File Index

Classes


Class enchant.PhysicsWorld


Defined in: PhySprite.enchant.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
enchant.PhysicsWorld(gravityX, gravityY)
物理シミュレーションを行う世界のクラス
Field Summary
Field Attributes Field Name and Description
 
物理シミュレーションの精度
Method Summary
Method Attributes Method Name and Description
 
ワールドにあるすべてのジョイントを削除
 
ワールドにあるすべてのオブジェクトを削除 シーンの切り替わり時に呼んでおかないと、次のシーンでも衝突判定がおこってしまう。
 
ワールドのすべてを削除
 
contact(func)
物体の当たり判定
 
 
step(pos)
物理シミュレーション内の時間を進める
Class Detail
enchant.PhysicsWorld(gravityX, gravityY)
物理シミュレーションを行う世界のクラス
  //y軸方向へ重力加速度9.8m/s^2
  var physicsWorld = new PhysicsWorld(0, 9.8);
  //無重力
  var physicsWorld = new PhysicsWorld(0, 0);
Parameters:
{Number} gravityX Optional
x軸方向への引力.
{Number} gravityY Optional
y軸方向への引力.
Field Detail
iterations
物理シミュレーションの精度
Method Detail
cleanAllJoint()
ワールドにあるすべてのジョイントを削除

cleanAllSprite()
ワールドにあるすべてのオブジェクトを削除 シーンの切り替わり時に呼んでおかないと、次のシーンでも衝突判定がおこってしまう。

cleanUp()
ワールドのすべてを削除

contact(func)
物体の当たり判定
  //ぶつかった2つのSpriteを消す
  physicsWorld.contact(function (sprite1, sprite2) {
      sprite1.destroy();
      sprite2.destroy(); 
  });
Parameters:
{function(sprite1:enchant.PhySprite|sprite2:enchant.PhySprite)} func Optional
当たり判定時の処理

getJointImage()

step(pos)
物理シミュレーション内の時間を進める
Parameters:
{b2Vec2} pos Optional
Spriteの座標.

Documentation generated by JsDoc Toolkit 2.4.0 on Sat Mar 31 2012 19:45:18 GMT+0900 (JST)