Files
aego/tests/agent/testdata/schema_show_body2d.json
sanspie 2fcbaa6c12 Stage 11g1: the editor in Russian (D348)
engine/i18n with catalogs, plural forms and module catalogs; tools/i18n extract and check; the editor UI, menus, panels and notices in Russian with the author's terms; overflow test and tooltip wrapping; the English log.
2026-10-25 15:31:22 +03:00

190 lines
5.3 KiB
JSON

{
"ok": true,
"value": {
"name": "physics.Body2D",
"kind": "component",
"display": "Rigid Body 2D",
"category": "Physics",
"owner": "physics",
"doc": "Simulates the node as a rigid body. Colliders on the node and its children form its shape.",
"fields": [
{
"name": "type",
"kind": "enum",
"enum": [
"static",
"kinematic",
"dynamic"
],
"default": "dynamic",
"saved": true,
"doc": "static never moves, kinematic moves by velocity, dynamic reacts to forces and contacts."
},
{
"name": "massMode",
"kind": "enum",
"enum": [
"auto",
"override"
],
"default": "auto",
"saved": true,
"doc": "auto takes the mass from collider density, override uses Mass."
},
{
"name": "gravityScale",
"kind": "float32",
"default": "1",
"saved": true,
"doc": "Multiplier of the project gravity for this body; 0 makes it float."
},
{
"name": "linearDamping",
"kind": "float32",
"min": 0,
"default": "0",
"saved": true,
"doc": "Slows the movement every step, like air resistance; 0 keeps the speed."
},
{
"name": "angularDamping",
"kind": "float32",
"min": 0,
"default": "0",
"saved": true,
"doc": "Slows the rotation every step; 0 keeps spinning."
},
{
"name": "fixedRotation",
"kind": "bool",
"default": "false",
"saved": true,
"doc": "Keeps the body upright: contacts and torque never rotate it."
},
{
"name": "bullet",
"kind": "bool",
"default": "false",
"saved": true,
"doc": "Continuous collision against other dynamic bodies, so a fast body cannot pass through them. Costs more."
},
{
"name": "allowSleep",
"kind": "bool",
"default": "true",
"saved": true,
"doc": "Lets the body sleep after it comes to rest, which saves time; contacts and scripts wake it."
},
{
"name": "interpolate",
"kind": "bool",
"default": "false",
"saved": true,
"doc": "Draws the body between physics steps for smooth motion; scripts still see the exact pose."
},
{
"name": "layer",
"kind": "int32",
"min": 0,
"max": 31,
"default": "0",
"saved": true,
"doc": "Collision layer, see Project Settings → Physics."
},
{
"name": "mask",
"kind": "int64",
"default": "-1",
"saved": true,
"doc": "Layers this body collides with."
},
{
"name": "velocity",
"kind": "vec2",
"default": "[0, 0]",
"readOnly": true,
"saved": false,
"doc": "Velocity in units per second."
},
{
"name": "angularVelocity",
"kind": "float32",
"default": "0",
"readOnly": true,
"saved": false,
"doc": "Rotation speed in radians per second."
},
{
"name": "awake",
"kind": "bool",
"default": "false",
"readOnly": true,
"saved": false,
"doc": "Whether the body is simulated this step or sleeping."
}
],
"methods": [
{
"name": "ApplyForce",
"sig": "(force Vec2)",
"doc": "ApplyForce pushes the body's center of mass during the next physics step. Call it from FixedUpdate."
},
{
"name": "ApplyForceAt",
"sig": "(force Vec2, point Vec2)",
"doc": "ApplyForceAt pushes the body at a world point, which also spins it."
},
{
"name": "ApplyImpulse",
"sig": "(impulse Vec2)",
"doc": "ApplyImpulse changes the velocity at once, scaled by mass."
},
{
"name": "ApplyImpulseAt",
"sig": "(impulse Vec2, point Vec2)",
"doc": "ApplyImpulseAt applies an impulse at a world point."
},
{
"name": "ApplyTorque",
"sig": "(torque float)",
"doc": "ApplyTorque spins the body during the next physics step."
},
{
"name": "Mass",
"sig": "() float",
"doc": "Mass returns the mass computed from the colliders or the override."
},
{
"name": "MoveTo",
"sig": "(position Vec2, angle float)",
"doc": "MoveTo drives a kinematic body to the pose by the end of the next physics step, pushing dynamic bodies on the way. Call it from FixedUpdate."
},
{
"name": "SetAngularVelocity",
"sig": "(velocity float)",
"doc": "SetAngularVelocity sets the spin in radians per second."
},
{
"name": "SetVelocity",
"sig": "(velocity Vec2)",
"doc": "SetVelocity sets the linear velocity in units per second."
},
{
"name": "Sleep",
"sig": "()",
"doc": "Sleep stops the body until something touches it."
},
{
"name": "Teleport",
"sig": "(position Vec2, angle float)",
"doc": "Teleport moves the body to a world pose without sweeping, keeping its velocity."
},
{
"name": "WakeUp",
"sig": "()",
"doc": "WakeUp makes a sleeping body simulate again."
}
]
}
}