GetElementBoneRotation: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
{{Added feature/item|3.0159|1.5.9|1.5.8|20704|Returns the orientation of a specific bone relative to the [[element]]. Currently the [[Element/Player|Player]] and [[Element/Ped|Ped]] element types are accepted.}} | {{Added feature/item|3.0159|1.5.9|1.5.8|20704|Returns the orientation of a specific bone relative to the [[element]]. Currently the [[Element/Player|Player]] and [[Element/Ped|Ped]] element types are accepted.}} | ||
{{Tip|If you want to attach an element to a bone, see [[attachElementToBone]].}} | {{Tip|If you want to attach an element to a bone, see [[attachElementToBone]].}} | ||
Revision as of 17:35, 20 September 2021
20704
Tip: If you want to attach an element to a bone, see attachElementToBone. |
Syntax
float, float, float getElementBoneRotation ( element theElement, int boneId )
Required Arguments
- theElement: the element to get the bone rotation on.
- boneId: the ID of the bone to get the rotation of. See Bone IDs.
Returns
Returns 3 floats, representing the yaw, pitch, roll rotation values.
Example
This example outputs the yaw, pitch and roll orientation of a specific bone relative to the local player bone specified through a command:
function getBoneRotation (commandName, boneId) if not tonumber (boneId) then outputChatBox ("You didn't insert an bone ID!", 255, 0, 0) return false end local x, y, z = getElementBoneRotation (localPlayer, boneId) outputChatBox ("The bone rotation is: "..x..", "..y..", "..z) end addCommandHandler ("getbonerotation", getBoneRotation)
Requirements
This template will be deleted.
See Also
- getElementBoneMatrix
- getElementBonePosition
- getElementBoneRotation
- getElementBoundingBox
- getElementDistanceFromCentreOfMassToBaseOfModel
- getElementLighting
- getElementRadius
- isElementCollidableWith
- isElementLocal
- isElementOnScreen
- isElementStreamable
- isElementStreamedIn
- isElementSyncer
- isElementWaitingForGroundToLoad
- setElementBoneMatrix
- setElementBonePosition
- setElementBoneRotation
- setElementCollidableWith
- setElementStreamable
- updateElementRpHAnim
- Shared
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement