GetElementDistanceFromCentreOfMassToBaseOfModel: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | |||
This function is used to retrieve the distance between a element's centre of bas to the base of the model. This can be used to calculate the position the element has to be set to, to have it on ground level. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float getElementDistanceFromCentreOfMassToBaseOfModel ( element theElement ) | float getElementDistanceFromCentreOfMassToBaseOfModel ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Parameters=== | |||
'''theElement:''' The element you want to retrieve the value of. | |||
===Returns=== | |||
Returns a ''float'' with the distance, or ''false'' if the element is invalid. | |||
==Example== | |||
This example outputs the value for the local player. | |||
<syntaxhighlight lang="lua"> | |||
local localPlayer = getLocalPlayer() | |||
local distance = getElementDistanceFromCentreOfMassToBaseOfModel(localPlayer) | |||
outputChatBox(tostring(distance)) | |||
</syntaxhighlight> | |||
==See Also== | |||
{{Element functions}} |
Revision as of 23:02, 29 July 2007
This function is used to retrieve the distance between a element's centre of bas to the base of the model. This can be used to calculate the position the element has to be set to, to have it on ground level.
Syntax
float getElementDistanceFromCentreOfMassToBaseOfModel ( element theElement )
Required Parameters
theElement: The element you want to retrieve the value of.
Returns
Returns a float with the distance, or false if the element is invalid.
Example
This example outputs the value for the local player.
local localPlayer = getLocalPlayer() local distance = getElementDistanceFromCentreOfMassToBaseOfModel(localPlayer) outputChatBox(tostring(distance))
See Also
- 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