detphys_body.hボディ・形・描画用の読み出し(バージョン 2)
| 関数 | 説明 |
|---|---|
detphys_body_abi_version | このヘッダーのバージョン |
detphys_shape_desc_default | 形の設定の既定値(摩擦 600・密度 1000・反発 0、×1000) |
detphys_body_desc_default | ボディの設定の既定値(動くボディ) |
detphys_world_add_mesh | .dnshape を写し取って登録する。戻り値は番号(0 から)使い方: コンセプト › 凹形状とベイカー |
detphys_world_mesh_count | 登録した形の数 |
detphys_world_mesh_info | 形の情報(凸多角形の数・頂点の数・半径・チェックサム) |
detphys_world_mesh_read | 描画用に凸多角形の頂点 [m] を読む |
detphys_world_add_body | ボディを作る。戻り値は ID(作った順の通し番号) |
detphys_world_add_shape | ボディに形を足す |
detphys_world_remove_body | ボディを消す(ID は詰めない) |
detphys_world_set_transform | 位置と角度を直接決める(mm・mrad) |
detphys_world_set_velocity | 速度を決める(mm/s・mrad/s) |
detphys_world_apply_force | 力をかける(mN。次の 1 tick だけ効く) |
detphys_world_apply_impulse | 力積をかける(mN·s。速度がすぐ変わる) |
detphys_world_body_count | 作ったボディの数(消したものも含む) |
detphys_world_awake_count | 起きている動くボディの数(0 = 落ち着いた) |
detphys_world_get_body | 1 つのボディの今の状態を読む |
detphys_world_read_bodies | 全部のボディを配列に読む(毎フレーム呼んでよい。シミュレーションに影響しない) |
detphys_world_body_shapes | ボディに付いている形を読む |
| 構造体 | 説明 |
|---|---|
detphys_shape_desc | 1 つの形(DETPHYS_ / BOX / CIRCLE・大きさ・ずらし・材質) |
detphys_body_desc | ボディの設定(種類 DETPHYS_ / KINEMATIC / DYNAMIC・位置・速度・減衰・flags〔DETPHYS_〕・tag・最初の形) |
detphys_body_view | 読み出した状態(ID・種類・flags・tag・形・整数の位置 x_mm/y_mm/angle_mrad・描画用の float)使い方: 決定論を守るためのルール › 2. float をシミュレーションに入れない |
detphys_mesh_info | 登録した形の情報 |