https://wiki.multitheftauto.com/wiki/PhysicsIsElement?feed=atom&action=history
PhysicsIsElement - Revision history
2024-03-28T13:32:13Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://wiki.multitheftauto.com/index.php?title=PhysicsIsElement&diff=65214&oldid=prev
CrosRoad95: Created page with "__NOTOC__ {{Client function}} Returns whatever physics-element exists ==Syntax== <syntaxhighlight lang="lua"> bool physicsIsElement(physics-element thePhysicsElement)..."
2020-02-19T19:16:14Z
<p>Created page with "__NOTOC__ {{Client function}} Returns whatever physics-element exists ==Syntax== <syntaxhighlight lang="lua"> bool physicsIsElement(physics-element thePhysicsElement)..."</p>
<p><b>New page</b></p><div>__NOTOC__ <br />
{{Client function}}<br />
Returns whatever physics-element exists<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool physicsIsElement(physics-element thePhysicsElement) <br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''thePhysicsElement:''' physics element: shape, constraint, rigid body, static collision<br />
<br />
===Returns===<br />
True if physics element exists<br />
<br />
==Example==<br />
<br />
if shape got destroyed, static collisions, rigid body and its constraints will destroyed too, this example prove it.<br />
<syntaxhighlight lang="lua"><br />
local shape = physicsCreateShape(physics, "box", 1)<br />
local rb = physicsCreateRigidBody(shape)<br />
local col = physicsCreateStaticCollision(shape)<br />
local const = physicsCreateConstraint("pointtopoint", rb, 0,0,0)<br />
iprint("isElement before", physicsIsElement(shape), physicsIsElement(rb), physicsIsElement(col), physicsIsElement(const)) -- true, true, true, true<br />
physicsDestroy(shape)<br />
iprint("isElement after", physicsIsElement(shape), physicsIsElement(rb), physicsIsElement(col), physicsIsElement(const)) -- false, false, false ,false<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
<br />
{{Client_physics_functions}}</div>
CrosRoad95