PhysicsGetElementType: Difference between revisions
Jump to navigation
Jump to search
CrosRoad95 (talk | contribs) (Created page with "__NOTOC__ {{Client function}} Returns type of physics-element ==Syntax== <syntaxhighlight lang="lua"> string physicsGetElementType(physics-element thePhysicsElement)...") |
CrosRoad95 (talk | contribs) |
||
Line 22: | Line 22: | ||
local const = physicsCreateConstraint("pointtopoint", rb, 0,0,0) | local const = physicsCreateConstraint("pointtopoint", rb, 0,0,0) | ||
iprint("shape: ",physicsGetElementType(shape)) -- shape | iprint("shape: ",physicsGetElementType(shape)) -- shape | ||
iprint("rigidbody: ",physicsGetElementType( | iprint("rigidbody: ",physicsGetElementType(rb)) -- rigidbody | ||
iprint("staticcollision: ",physicsGetElementType(col)) -- staticcollision | iprint("staticcollision: ",physicsGetElementType(col)) -- staticcollision | ||
iprint("constraint: ",physicsGetElementType(const)) -- constraint | iprint("constraint: ",physicsGetElementType(const)) -- constraint |
Latest revision as of 19:11, 19 February 2020
Returns type of physics-element
Syntax
string physicsGetElementType(physics-element thePhysicsElement)
Required Arguments
- thePhysicsElement: physics element: shape, constraint, rigid body, static collision
Returns
Name of physics element, "shape", "rigidbody", "staticcollision", "constraint"
Example
local shape = physicsCreateShape(physics, "box", 1) local rb = physicsCreateRigidBody(shape) local col = physicsCreateStaticCollision(shape) local const = physicsCreateConstraint("pointtopoint", rb, 0,0,0) iprint("shape: ",physicsGetElementType(shape)) -- shape iprint("rigidbody: ",physicsGetElementType(rb)) -- rigidbody iprint("staticcollision: ",physicsGetElementType(col)) -- staticcollision iprint("constraint: ",physicsGetElementType(const)) -- constraint iprint("invalid: ",physicsGetElementType(physics)) -- false
See Also
- physicsCreateWorld
- physicsDestroy
- physicsCreateShape
- physicsCreateShapeFromModel
- physicsCreateRigidBody
- physicsCreateStaticCollision
- physicsCreateConstraint
- physicsAddChildShape
- physicsRemoveChildShape
- physicsGetChildShapes
- physicsSetChildShapeOffsets
- physicsGetChildShapeOffsets
- physicsGetShapes
- physicsGetRigidBodies
- physicsGetStaticCollisions
- physicsGetConstraints
- physicsSetProperties
- physicsGetProperties
- physicsDrawDebug
- physicsSetDebugMode
- physicsBuildCollisionFromGTA
- physicsApplyVelocity
- physicsApplyVelocityForce
- physicsApplyAngularVelocity
- physicsApplyAngularVelocityForce
- physicsApplyDamping
- physicsRayCast
- physicsShapeCast
- physicsGetElementType
- physicsIsElement