PhysicsGetElementType

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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