PhysicsGetChildShapeOffsets: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
CrosRoad95 (talk | contribs)  (Created page with "__NOTOC__  {{Client function}} Returns offset position and rotation of child shape. Sometimes return number is slightly different than input!  ==Syntax==  <syntaxhighlight lan...")  | 
				CrosRoad95 (talk | contribs)  No edit summary  | 
				||
| Line 18: | Line 18: | ||
==Example==  | ==Example==  | ||
<syntaxhighlight lang="lua">  | <syntaxhighlight lang="lua">  | ||
local compound = physicsCreateShape(physics, "compound")  | local compound = physicsCreateShape(physics, "compound")  | ||
Latest revision as of 19:41, 12 February 2020
Returns offset position and rotation of child shape. Sometimes return number is slightly different than input!
Syntax
float float float float float float physicsGetChildShapeOffsets(physics-shape compoundShape, int index)
Required Arguments
- compoundShape: Must be compound shape
 - index: Index of child. Starts from 1.
 
Returns
Returns offset position ( x,y,z ) and rotation (rx,ry,rz) of child shape. False otherwise
Example
local compound = physicsCreateShape(physics, "compound")
local capsule = physicsCreateShape(physics, "capsule", 1, 1)
physicsAddChildShape(compound, capsule,1,2,3,4,5,6)
x,y,z,rx,ry,rz = physicsGetChildShapeOffsets(compound, 1)
outputChatBox("Offset of first shape: ".. string.format("%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", x,y,z,rx,ry,rz))
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