多くのプロパティを利用して剛体を定義する [詳細]
Public メソッド | |
| PhysicsBody () | |
| デフォルトコンスタラクタ | |
| PhysicsBody (PhysicsBody body) | |
| コピーコンストラクタ | |
| PhysicsBody (PhysicsShape conv, float m) | |
| コンストラクタ | |
| void | Clear () |
| 全てのメンバをクリアする | |
| void | CopyBody (PhysicsBody body) |
| 全てのメンバをコピーする | |
| void | MoveTo (Vector2 pt, float rt, float dt) |
| 位置、回転、並進速度、回転速度をアップデートする | |
| bool | InsideBody (Vector2 pos, PhysicsShape con) |
| 頂点が剛体の領域に含まれるかどうか | |
| void | SetBodyStatic () |
| 剛体をスタティック剛体にセット | |
| void | SetBodyKinematic () |
| 剛体をキネマティック剛体にセット | |
| void | SetBodyTrigger () |
| 剛体をトリガー剛体に設定する | |
| void | BackToDynamic () |
| キネマティック剛体をダイナミック剛体に戻す | |
| void | WakeUpDynamic () |
| スリープ状態のダイナミック剛体を起こす | |
| void | WakeUpKinematic () |
| スリープ状態のキネマティック剛体を起こす | |
| bool | IsKinematicOrStatic () |
| 剛体がキネマティックまたはスタティック剛体であるかを判定する | |
| bool | IsKinematic () |
| 剛体がキネマティックであるかを判定する | |
| bool | IsStatic () |
| 剛体がスタティックであるかを判定する | |
| bool | IsDynamic () |
| 剛体がダイナミックであるかを判定する | |
| bool | IsTrigger () |
| 剛体がトリガーであるかを判定する | |
| void | ApplyForce (Vector2 power) |
| 重心に力を加える | |
| void | ApplyForce (Vector2 power, Vector2 pos, bool isGlobal=true) |
| 任意の点に力を加える | |
| void | ApplyTorque (float rotPower) |
| 剛体にトルクを加える | |
Static Public メソッド | |
| static Vector2 | MergeBody (PhysicsBody[] bodyList, uint[] indexList, uint num, PhysicsShape[] sceneShapes, uint[] map, bool flag=true) |
| 剛体のマージ | |
| static Vector2 | MergeBodyWithPos (PhysicsBody[] bodyList, uint[] indexList, uint num, PhysicsShape[] sceneShapes, uint[] map, Vector2 pos) |
| 重心の設定を行う剛体のマージ | |
Public 変数 | |
| Vector2 | position = new Vector2(0, 0) |
| 剛体の位置 | |
| float | rotation = 0.0f |
| 剛体の回転角度 | |
| Vector2 | velocity = new Vector2(0, 0) |
| 剛体の並進速度 | |
| float | angularVelocity = 0.0f |
| 剛体の回転速度 | |
| Vector2 | localPosition = new Vector2(0, 0) |
| コンパウンド形状の場合のローカル位置 | |
| float | localRotation = 0.0f |
| コンパウンド形状の場合のローカル回転角度 | |
| Vector2 | acceleration = new Vector2(0, 0) |
| 剛体の並進加速度 | |
| Vector2 | force = new Vector2(0, 0) |
| 剛体にかかる重力を除く外力 | |
| float | torque = 0.0f |
| 剛体にかかる重力を除くトルク | |
| float | mass = 0.0f |
| 剛体の質量 | |
| float | invMass = 0.0f |
| 剛体の質量の逆数 | |
| float | inertia = 0.0f |
| 剛体のテンソル | |
| float | invInertia = 0.0f |
| 剛体のテンソルの逆数 | |
| Vector2 | width = new Vector2(0, 0) |
| 剛体の初期位置、回転角度に対するAABBバウンディングボックス | |
| Vector2 | aabbMin = new Vector2(0, 0) |
| 毎フレームアップデートされるAABBバウンディングボックスの左下位置 | |
| Vector2 | aabbMax = new Vector2(0, 0) |
| 毎フレームアップデートされるAABBバウンディングボックスの右上位置 | |
| bool | broadCollide = false |
| Broad Phase衝突判定の結果 | |
| bool | narrowCollide = false |
| Narrow Phase衝突判定の結果 | |
| uint | shapeIndex = 0 |
| 剛体の形状のインデックス | |
| uint | collisionFilter = 0 |
| 剛体のcollisionフィルター | |
| uint | groupFilter = 0xFFFFFFFF |
| 剛体のgroupフィルター | |
| float | airFriction = 0.0f |
| Integrate Phaseで考慮される空気摩擦係数 | |
| float | colFriction = 0.0f |
| Solver Phaseで考慮される衝突摩擦係数 | |
| bool | sleep = false |
| スリープ状態、真ならシミュレーションで考慮されない | |
| uint | sleepCount = 0 |
| スリープ状態に入るかをチェックするカウンター | |
| bool | picking = true |
| シミュレーション中にピッキングを可能にするかどうか | |
| float | oldMass = 0.0f |
| 剛体の前の質量 | |
| float | oldInvMass = 0.0f |
| 剛体の前の質量の逆数 | |
| float | oldInertia = 0.0f |
| 剛体の前のテンソル | |
| float | oldInvInertia = 0.0f |
| 剛体の前のテンソルの逆数 | |
| float | penetrationRepulse = 0.2f |
| めり込みに対する反発力の加速係数 | |
| float | penetLimit = 0.03f |
| めり込みに対する許容度 | |
| float | tangentFriction = 0.3f |
| 反発に対する接線方向の摩擦係数 | |
| float | restitutionCoeff = 0.0f |
| 反発に対する反発係数 | |
| object | userData = null |
| ユーザーデータへの参照 | |
プロパティ | |
| Vector2 | Position [get, set] |
| setter and getter of position | |
| float | Rotation [get, set] |
| setter and getter of position | |
| Vector2 | Velocity [get, set] |
| setter and getter of velocity | |
| float | AngularVelocity [get, set] |
| setter and getter of angular velocity | |
| Vector2 | LocalPosition [get, set] |
| setter and getter of local position | |
| float | LocalRotation [get, set] |
| setter and getter of local rotation | |
| Vector2 | Acceleration [get, set] |
| setter and getter of acceleration | |
| Vector2 | Force [get, set] |
| setter and getter of force | |
| float | Torque [get, set] |
| setter and getter of torque | |
| float | Mass [get, set] |
| setter and getter of mass | |
| float | InvMass [get, set] |
| setter and getter of inverse mass | |
| float | Inertia [get, set] |
| setter and getter of inertia tensor | |
| float | InvInertia [get, set] |
| setter and getter of inverse inertia tensor | |
| Vector2 | Width [get, set] |
| setter and getter of Width | |
| Vector2 | AabbMin [get, set] |
| setter and getter of AaabbMin | |
| Vector2 | AabbMax [get, set] |
| setter and getter of aabbMax | |
| bool | BroadCollide [get] |
| getter of broadCollide | |
| bool | NarrowCollide [get] |
| getter of narrowCollide | |
| uint | ShapeIndex [get, set] |
| setter and getter of shape index | |
| uint | CollisionFilter [get, set] |
| setter and getter of collisionFilter | |
| uint | GroupFilter [get, set] |
| setter and getter of groupFilter | |
| float | AirFriction [get, set] |
| setter and getter of airFriction | |
| float | ColFriction [get, set] |
| setter and getter of airFriction | |
| bool | Sleep [get, set] |
| setter and getter of sleep | |
| uint | SleepCount [get, set] |
| setter and getter of sleepCount | |
| bool | Picking [get, set] |
| setter and getter of picking | |
| BodyType | Type [get, set] |
| setter and getter of type | |
| float | PenetrationRepulse [get, set] |
| setter and getter of penetrationRepulse | |
| float | PenetLimit [get, set] |
| setter and getter of penetLimit | |
| float | TangentFriction [get, set] |
| setter and getter of tangentFriction | |
| float | RestitutionCoeff [get, set] |
| setter and getter of restitutionCoeff | |
| object | UserData [get, set] |
| setter and getter of userData | |
多くのプロパティを利用して剛体を定義する
| PhysicsBody | ( | PhysicsBody | body | ) |
コピーコンストラクタ
| body | コピー元の剛体 |
| PhysicsBody | ( | PhysicsShape | conv, |
| float | m | ||
| ) |
コンストラクタ
| conv | 剛体の形状 |
| m | 剛体の質量 |
| void ApplyForce | ( | Vector2 | power | ) |
重心に力を加える
| power | 与えられる力 |
ダイナミック剛体のみに有効
任意の点に力を加える
| power | 与えられる力 |
| pos | 力の位置 |
| isGlobal | 力の位置がグローバル座標かローカル座標かを示す。デフォルトはグローバル座標 |
ダイナミック剛体のみに有効
| void ApplyTorque | ( | float | rotPower | ) |
剛体にトルクを加える
| rotPower | 与えられるトルク |
ダイナミック剛体のみに有効
| void BackToDynamic | ( | ) |
キネマティック剛体をダイナミック剛体に戻す
キネマティック剛体をダイナミック剛体に戻し、必要な情報を元の変数にセットする
| bool InsideBody | ( | Vector2 | pos, |
| PhysicsShape | con | ||
| ) |
頂点が剛体の領域に含まれるかどうか
| pos | 与えられた頂点 |
| con | 剛体の形状 |
| static Vector2 MergeBody | ( | PhysicsBody[] | bodyList, |
| uint[] | indexList, | ||
| uint | num, | ||
| PhysicsShape[] | sceneShapes, | ||
| uint[] | map, | ||
| bool | flag = true |
||
| ) | [static] |
剛体のマージ
複数の剛体 (コンパウンド形状)をマージするために、インデックスが昇順で与えられている
| bodyList | シーンの剛体リスト |
| indexList | マージするための剛体のインデックスリスト |
| num | マージするための剛体の数 |
| sceneShapes | シーンの形状リスト |
| map | コンパウンド形状対応マップ |
| flag | 剛体の位置をマージ後に再調整するかどうか |
| static Vector2 MergeBodyWithPos | ( | PhysicsBody[] | bodyList, |
| uint[] | indexList, | ||
| uint | num, | ||
| PhysicsShape[] | sceneShapes, | ||
| uint[] | map, | ||
| Vector2 | pos | ||
| ) | [static] |
重心の設定を行う剛体のマージ
複数の剛体 (コンパウンド形状)をマージするために、インデックスが昇順で与えられている
| bodyList | シーンの剛体リスト |
| indexList | マージするための剛体のインデックスリスト |
| num | マージするための剛体の数 |
| sceneShapes | シーンの形状リスト |
| map | コンパウンド形状対応マップ |
| pos | マージした剛体の重心 |
| void MoveTo | ( | Vector2 | pt, |
| float | rt, | ||
| float | dt | ||
| ) |
位置、回転、並進速度、回転速度をアップデートする
| pt | 剛体の新しい位置 |
| rt | 剛体の新しい回転 |
| dt | タイムステップ |
剛体の新しい位置と回転を与えて、自動的に並進速度、回転速度を計算して設定します
位置、回転、並進速度、回転速度がこの関数によってセットされます 主にキネマティック剛体に対して使用し、スタティック剛体には使用できません
| void SetBodyKinematic | ( | ) |
剛体をキネマティック剛体にセット
剛体をキネマティック剛体に設定,必要な情報を変数に保存する
| void SetBodyStatic | ( | ) |
剛体をスタティック剛体にセット
剛体は一度スタティック剛体にセットされるとダイナミック剛体には戻せない
| void WakeUpDynamic | ( | ) |
スリープ状態のダイナミック剛体を起こす
sleep = false; sleepCount = 0; と同じ
| void WakeUpKinematic | ( | ) |
スリープ状態のキネマティック剛体を起こす
キネマティック剛体を動かす時にはスリープ状態から起こさないと正しく衝突判定が行われません
sleep = false; sleepCount = 0; と同じ
| float inertia = 0.0f |
剛体のテンソル
剛体のテンソルはテンソルの逆数と同期していないといけない
| float invInertia = 0.0f |
剛体のテンソルの逆数
剛体のテンソルの逆数はテンソルと同期していないといけない
| float invMass = 0.0f |
剛体の質量の逆数
剛体の質量の逆数は質量と同期していないといけない
| float mass = 0.0f |
剛体の質量
剛体の質量は質量の逆数と同期していないといけない
| float penetLimit = 0.03f |
めり込みに対する許容度
この値を有効にするにはPhysicsSceneのuniquePropertyをfalseにする必要あり
| float penetrationRepulse = 0.2f |
めり込みに対する反発力の加速係数
この値を有効にするにはPhysicsSceneのuniquePropertyをfalseにする必要あり
| float restitutionCoeff = 0.0f |
反発に対する反発係数
この値を有効にするにはPhysicsSceneのuniquePropertyをfalseにする必要あり
| float tangentFriction = 0.3f |
反発に対する接線方向の摩擦係数
この値を有効にするにはPhysicsSceneのuniquePropertyをfalseにする必要あり
| object userData = null |
ユーザーデータへの参照
参照先データはユーザーによって適切に管理される必要があります