ボディの定義。 未指定の場合は box2dweb 側の初期値に従う。

interface Box2DBodyDef {
    active?: boolean;
    allowSleep?: boolean;
    angularDamping?: number;
    angularVelocity?: number;
    awake?: boolean;
    bullet?: boolean;
    fixedRotation?: boolean;
    gravityScale?: number;
    linearDamping?: number;
    linearVelocity?: b2Vec2;
    type?: number;
    userData?: string;
}

Properties

active?: boolean

開始時にボディをアクティブとするかどうか。

allowSleep?: boolean

ボディのスリープを許可するかどうか。

angularDamping?: number

角速度の減衰率。

angularVelocity?: number

角速度。

awake?: boolean

ボディの初期状態をアウェイクにするかスリープにするか。

bullet?: boolean

他のボディとの衝突時に貫通を許可するかどうか。

fixedRotation?: boolean

回転を固定させるかどうか。

gravityScale?: number

ボディに与える重力のスケール

linearDamping?: number

速度の減衰率。

linearVelocity?: b2Vec2

ボディの初期速度。

type?: number

BodyType。

userData?: string

ボディのユーザデータ。