duckengine
Version:
A 2D Game Engine for the web.
125 lines • 112 kB
HTML
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PhysicsBody | DuckEngine - v2.1.0</title><meta name="description" content="Documentation for DuckEngine - v2.1.0"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">DuckEngine - v2.1.0</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">DuckEngine - v2.1.0</a></li><li><a href="../modules/core_physics_physicsBody.html">core/physics/physicsBody</a></li><li><a href="core_physics_physicsBody.PhysicsBody.html">PhysicsBody</a></li></ul><h1>Class PhysicsBody<textureType></h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>classdesc</dt><dd><p>Creates a DuckEngine PhysicsBody</p>
</dd><dt>description</dt><dd><p>The PhysicsBody Class. The GameObject class extends this class</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-type-parameters"><h3>Type parameters</h3><ul class="tsd-type-parameters"><li><h4>textureType<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a></h4></li></ul></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">PhysicsBody</span><ul class="tsd-hierarchy"><li><a href="core_gameobjects_gameObject.GameObject.html" class="tsd-signature-type" data-tsd-kind="Class">GameObject</a></li><li><a href="core_physics_models_area.Area.html" class="tsd-signature-type" data-tsd-kind="Class">Area</a></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter"><a href="core_physics_physicsBody.PhysicsBody.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#attachOffset" class="tsd-kind-icon">attach<wbr/>Offset</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#attachedChildren" class="tsd-kind-icon">attached<wbr/>Children</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#bounds" class="tsd-kind-icon">bounds</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#collider" class="tsd-kind-icon">collider</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#collidesWith" class="tsd-kind-icon">collides<wbr/>With</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#enabled" class="tsd-kind-icon">enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#game" class="tsd-kind-icon">game</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#h" class="tsd-kind-icon">h</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#hitbox" class="tsd-kind-icon">hitbox</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#isAttached" class="tsd-kind-icon">is<wbr/>Attached</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#options" class="tsd-kind-icon">options</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#physics" class="tsd-kind-icon">physics</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#position" class="tsd-kind-icon">position</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#r" class="tsd-kind-icon">r</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#scene" class="tsd-kind-icon">scene</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#shape" class="tsd-kind-icon">shape</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#velocity" class="tsd-kind-icon">velocity</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#w" class="tsd-kind-icon">w</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#_update" class="tsd-kind-icon">_update</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#accelerateVelocity" class="tsd-kind-icon">accelerate<wbr/>Velocity</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#applyFriction" class="tsd-kind-icon">apply<wbr/>Friction</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#applyGravity" class="tsd-kind-icon">apply<wbr/>Gravity</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#attachChild" class="tsd-kind-icon">attach<wbr/>Child</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#attachTo" class="tsd-kind-icon">attach<wbr/>To</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#autoFitHitbox" class="tsd-kind-icon">auto<wbr/>Fit<wbr/>Hitbox</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#bounceVelocityBounds" class="tsd-kind-icon">bounce<wbr/>Velocity<wbr/>Bounds</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#detachChild" class="tsd-kind-icon">detach<wbr/>Child</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#detachFrom" class="tsd-kind-icon">detach<wbr/>From</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getBottom" class="tsd-kind-icon">get<wbr/>Bottom</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getCenter" class="tsd-kind-icon">get<wbr/>Center</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getCenterX" class="tsd-kind-icon">get<wbr/>CenterX</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getCenterY" class="tsd-kind-icon">get<wbr/>CenterY</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getLeft" class="tsd-kind-icon">get<wbr/>Left</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getRight" class="tsd-kind-icon">get<wbr/>Right</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#getTop" class="tsd-kind-icon">get<wbr/>Top</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#isColliding" class="tsd-kind-icon">is<wbr/>Colliding</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#isCollidingGroup" class="tsd-kind-icon">is<wbr/>Colliding<wbr/>Group</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#reflectVelocity" class="tsd-kind-icon">reflect<wbr/>Velocity</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#scaleHitbox" class="tsd-kind-icon">scale<wbr/>Hitbox</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#setEnabled" class="tsd-kind-icon">set<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#setType" class="tsd-kind-icon">set<wbr/>Type</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#setVelocity" class="tsd-kind-icon">set<wbr/>Velocity</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#setVelocityX" class="tsd-kind-icon">set<wbr/>VelocityX</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="core_physics_physicsBody.PhysicsBody.html#setVelocityY" class="tsd-kind-icon">set<wbr/>VelocityY</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">new <wbr/>Physics<wbr/>Body<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>shape<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.Types.Collider.html#ShapeString" class="tsd-signature-type" data-tsd-kind="Type alias">ShapeString</a>, id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, y<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, w<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, h<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, r<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, game<span class="tsd-signature-symbol">: </span><a href="core_game.Game.html" class="tsd-signature-type" data-tsd-kind="Class">Game</a>, scene<span class="tsd-signature-symbol">: </span><a href="core_scene.Scene.html" class="tsd-signature-type" data-tsd-kind="Class">Scene</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="core_physics_physicsBody.PhysicsBody.html" class="tsd-signature-type" data-tsd-kind="Class">PhysicsBody</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L223">core/physics/physicsBody.ts:223</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>description</dt><dd><p>Creates a PhysicsBody instance. Extended by GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>textureType<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>shape: <a href="../modules/index.Duck.Types.Collider.html#ShapeString" class="tsd-signature-type" data-tsd-kind="Type alias">ShapeString</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Shape of PhysicsBody</p>
</div></div></li><li><h5>id: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>ID from GameObject ID</p>
</div></div></li><li><h5>x: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>X position</p>
</div></div></li><li><h5>y: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Y position</p>
</div></div></li><li><h5>w: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Width</p>
</div></div></li><li><h5>h: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Height</p>
</div></div></li><li><h5>r: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Radius</p>
</div></div></li><li><h5>game: <a href="core_game.Game.html" class="tsd-signature-type" data-tsd-kind="Class">Game</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Game instance</p>
</div></div></li><li><h5>scene: <a href="core_scene.Scene.html" class="tsd-signature-type" data-tsd-kind="Class">Scene</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Scene instance</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="core_physics_physicsBody.PhysicsBody.html" class="tsd-signature-type" data-tsd-kind="Class">PhysicsBody</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="attachOffset" class="tsd-anchor"></a><h3>attach<wbr/>Offset</h3><div class="tsd-signature tsd-kind-icon">attach<wbr/>Offset<span class="tsd-signature-symbol">:</span> <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L166">core/physics/physicsBody.ts:166</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The offset between the PhysicsBody that self is attached to</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="attachedChildren" class="tsd-anchor"></a><h3>attached<wbr/>Children</h3><div class="tsd-signature tsd-kind-icon">attached<wbr/>Children<span class="tsd-signature-symbol">:</span> <a href="core_physics_physicsBody.PhysicsBody.html" class="tsd-signature-type" data-tsd-kind="Class">PhysicsBody</a><span class="tsd-signature-symbol"><</span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L158">core/physics/physicsBody.ts:158</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>PhysicsBodies that are attached</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="bounds" class="tsd-anchor"></a><h3>bounds</h3><div class="tsd-signature tsd-kind-icon">bounds<span class="tsd-signature-symbol">:</span> <a href="../interfaces/index.Duck.Types.Math.BoundsLike.html" class="tsd-signature-type" data-tsd-kind="Interface">BoundsLike</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L133">core/physics/physicsBody.ts:133</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The bounds of the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="collider" class="tsd-anchor"></a><h3>collider</h3><div class="tsd-signature tsd-kind-icon">collider<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="core_physics_models_collider.Collider.html" class="tsd-signature-type" data-tsd-kind="Class">Collider</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L99">core/physics/physicsBody.ts:99</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The Collider instance of the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="collidesWith" class="tsd-anchor"></a><h3>collides<wbr/>With</h3><div class="tsd-signature tsd-kind-icon">collides<wbr/>With<span class="tsd-signature-symbol">:</span> <a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.html" class="tsd-signature-type" data-tsd-kind="Namespace">TypeClasses</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html" class="tsd-signature-type" data-tsd-kind="Namespace">GameObjects</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html#GameObject" class="tsd-signature-type" data-tsd-kind="Type alias">GameObject</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> | </span><a href="core_group_group.Group.html" class="tsd-signature-type" data-tsd-kind="Class">Group</a><span class="tsd-signature-symbol"><</span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.html" class="tsd-signature-type" data-tsd-kind="Namespace">TypeClasses</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html" class="tsd-signature-type" data-tsd-kind="Namespace">GameObjects</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html#GameObject" class="tsd-signature-type" data-tsd-kind="Type alias">GameObject</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L107">core/physics/physicsBody.ts:107</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>An array or group of GameObjects that can collide with the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="enabled" class="tsd-anchor"></a><h3>enabled</h3><div class="tsd-signature tsd-kind-icon">enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L142">core/physics/physicsBody.ts:142</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Determines if the PhysicsBody._update is called by the Scene.physicsServer used by Scene.physicsList
, changing this value does nothing, must use PhysicsBody.setEnabled</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="game" class="tsd-anchor"></a><h3>game</h3><div class="tsd-signature tsd-kind-icon">game<span class="tsd-signature-symbol">:</span> <a href="core_game.Game.html" class="tsd-signature-type" data-tsd-kind="Class">Game</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L83">core/physics/physicsBody.ts:83</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The Game instance</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="h" class="tsd-anchor"></a><h3>h</h3><div class="tsd-signature tsd-kind-icon">h<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L56">core/physics/physicsBody.ts:56</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The height of the GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="hitbox" class="tsd-anchor"></a><h3>hitbox</h3><div class="tsd-signature tsd-kind-icon">hitbox<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="core_physics_models_hitbox.Hitbox.html" class="tsd-signature-type" data-tsd-kind="Class">Hitbox</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L117">core/physics/physicsBody.ts:117</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The Collider Hitbox of the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="id" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> id</h3><div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L24">core/physics/physicsBody.ts:24</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The unique identifier for a GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="isAttached" class="tsd-anchor"></a><h3>is<wbr/>Attached</h3><div class="tsd-signature tsd-kind-icon">is<wbr/>Attached<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L150">core/physics/physicsBody.ts:150</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Determines if the PhysicsBody is attached to another PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="options" class="tsd-anchor"></a><h3>options</h3><div class="tsd-signature tsd-kind-icon">options<span class="tsd-signature-symbol">:</span> <a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.PhysicsBody.html" class="tsd-signature-type" data-tsd-kind="Namespace">PhysicsBody</a><span class="tsd-signature-symbol">.</span><a href="../interfaces/index.Duck.Types.PhysicsBody.Config.html" class="tsd-signature-type" data-tsd-kind="Interface">Config</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L75">core/physics/physicsBody.ts:75</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>PhysicsBody config, includes: type - KinematicBody | RigidBody | StaticBody</p>
<p>defaults: { type: 'KinematicBody'}</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="physics" class="tsd-anchor"></a><h3>physics</h3><div class="tsd-signature tsd-kind-icon">physics<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>addCollider<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>addHitbox<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>setBounds<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L176">core/physics/physicsBody.ts:176</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Object that has all the physics method</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>add<wbr/>Collider<span class="tsd-signature-symbol">:</span>function</h5><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon">add<wbr/>Collider<span class="tsd-signature-symbol">(</span>collidesWith<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.html" class="tsd-signature-type" data-tsd-kind="Namespace">TypeClasses</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html" class="tsd-signature-type" data-tsd-kind="Namespace">GameObjects</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html#GameObject" class="tsd-signature-type" data-tsd-kind="Type alias">GameObject</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="core_physics_models_collider.Collider.html" class="tsd-signature-type" data-tsd-kind="Class">Collider</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L183">core/physics/physicsBody.ts:183</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody#physics</p>
</dd><dt>description</dt><dd><p>Adds a collider to the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>collidesWith: <a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.html" class="tsd-signature-type" data-tsd-kind="Namespace">TypeClasses</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html" class="tsd-signature-type" data-tsd-kind="Namespace">GameObjects</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.TypeClasses.GameObjects.html#GameObject" class="tsd-signature-type" data-tsd-kind="Type alias">GameObject</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">textureType</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>What the GameObject collides with</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="core_physics_models_collider.Collider.html" class="tsd-signature-type" data-tsd-kind="Class">Collider</a></h4></li></ul></li><li class="tsd-parameter"><h5>add<wbr/>Hitbox<span class="tsd-signature-symbol">:</span>function</h5><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon">add<wbr/>Hitbox<span class="tsd-signature-symbol">(</span>w<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, h<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, offset<span class="tsd-signature-symbol">?: </span><a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="core_physics_models_hitbox.Hitbox.html" class="tsd-signature-type" data-tsd-kind="Class">Hitbox</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L195">core/physics/physicsBody.ts:195</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody#physics</p>
</dd><dt>description</dt><dd><p>Adds a hitbox to the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> w: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> h: <span class="tsd-signature-type">number</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> offset: <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="core_physics_models_hitbox.Hitbox.html" class="tsd-signature-type" data-tsd-kind="Class">Hitbox</a></h4></li></ul></li><li class="tsd-parameter"><h5>set<wbr/>Bounds<span class="tsd-signature-symbol">:</span>function</h5><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon">set<wbr/>Bounds<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, y<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, w<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, h<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L206">core/physics/physicsBody.ts:206</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>GameObject#physics</p>
</dd><dt>description</dt><dd><p>Adds bounds to the GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>x: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>X position</p>
</div></div></li><li><h5>y: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Y position</p>
</div></div></li><li><h5>w: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Width of the bounds</p>
</div></div></li><li><h5>h: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Height of the bounds</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="position" class="tsd-anchor"></a><h3>position</h3><div class="tsd-signature tsd-kind-icon">position<span class="tsd-signature-symbol">:</span> <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L40">core/physics/physicsBody.ts:40</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The current global position of the GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="r" class="tsd-anchor"></a><h3>r</h3><div class="tsd-signature tsd-kind-icon">r<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L64">core/physics/physicsBody.ts:64</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The radius of the GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="scene" class="tsd-anchor"></a><h3>scene</h3><div class="tsd-signature tsd-kind-icon">scene<span class="tsd-signature-symbol">:</span> <a href="core_scene.Scene.html" class="tsd-signature-type" data-tsd-kind="Class">Scene</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L91">core/physics/physicsBody.ts:91</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The Scene instance</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="shape" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> shape</h3><div class="tsd-signature tsd-kind-icon">shape<span class="tsd-signature-symbol">:</span> <a href="../modules/index.Duck.Types.Collider.html#ShapeString" class="tsd-signature-type" data-tsd-kind="Type alias">ShapeString</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L32">core/physics/physicsBody.ts:32</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The shape of the GameObject, 'rect', 'circle', 'roundrect', or 'sprite'</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="velocity" class="tsd-anchor"></a><h3>velocity</h3><div class="tsd-signature tsd-kind-icon">velocity<span class="tsd-signature-symbol">:</span> <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L125">core/physics/physicsBody.ts:125</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The velocity of the PhysicsBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="w" class="tsd-anchor"></a><h3>w</h3><div class="tsd-signature tsd-kind-icon">w<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L48">core/physics/physicsBody.ts:48</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>The width of the GameObject</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="_update" class="tsd-anchor"></a><h3>_update</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">_update<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L352">core/physics/physicsBody.ts:352</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Updates the PhysicsBody's position by the velocity. Sets velocity to 0 on every tick.
Clamps position to bounds if exists. Rounds pixels if roundPixels game config is set to true.
Updates hitbox.collisionState if hitbox exists.</p>
<p>DO NOT CALL MANUALLY, CALLED IN SCENE.__tick</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="accelerateVelocity" class="tsd-anchor"></a><h3>accelerate<wbr/>Velocity</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">accelerate<wbr/>Velocity<span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a>, amount<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L580">core/physics/physicsBody.ts:580</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Accelerates the velocity by an amount, PhysicsBody.options.type must be KinematicBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>target: <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The target velocity</p>
</div></div></li><li><h5>amount: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The value to increase the velocity by</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="applyFriction" class="tsd-anchor"></a><h3>apply<wbr/>Friction</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">apply<wbr/>Friction<span class="tsd-signature-symbol">(</span>frictionAmount<span class="tsd-signature-symbol">: </span><a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L604">core/physics/physicsBody.ts:604</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Applies friction to the velocity by an amount, PhysicsBody.options.type must be KinematicBody or RigidBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>frictionAmount: <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The value to decrease the velocity by</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="applyGravity" class="tsd-anchor"></a><h3>apply<wbr/>Gravity</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">apply<wbr/>Gravity<span class="tsd-signature-symbol">(</span>gravity<span class="tsd-signature-symbol">: </span><a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/physics/physicsBody.ts#L631">core/physics/physicsBody.ts:631</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>PhysicsBody</p>
</dd><dt>description</dt><dd><p>Applies gravity to the velocity by a Vector2, PhysicsBody.options.type must be KinematicBody or RigidBody</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>gravity: <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The Vector2 to add to the velocity by</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="attachChild" class="tsd-anchor"></a><h3>attach<wbr/>Child</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">attach<wbr/>Child<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="core_physics_physicsBody.PhysicsBody.html" class="tsd-signature-type" data-tsd-kind="Class">PhysicsBody</a><span class="tsd-signature-symbol"><</span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../mo