GetElementBoundingBox: Difference between revisions
Jump to navigation
Jump to search
Black Dragon (talk | contribs) No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | {{Client function}} | ||
This function returns the minimum and maximum | __NOTOC__ | ||
This function returns the minimum and maximum coordinates of an element's bounding box. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float float float float float float getElementBoundingBox ( element theElement ) | float float float float float float getElementBoundingBox ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
'''theElement:''' the element whose bounding box we want to get. | |||
===Returns=== | ===Returns=== | ||
Line 14: | Line 15: | ||
==Example== | ==Example== | ||
This example outputs to chatbox the minimum and the maximum | This example outputs to chatbox the minimum and the maximum coordinates of an element. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function minMaxOutput( element ) | function minMaxOutput( element ) | ||
x0, y0, z0, x1, y1, z1 = getElementBoundingBox ( element ) | local x0, y0, z0, x1, y1, z1 = getElementBoundingBox ( element ) | ||
if ( x0 ) then | if ( x0 ) then | ||
outputChatBox( "The coords are: " .. x0 .. ", " .. y0 .. ", " .. z0 .. ", " .. x1 .. ", " .. y1 .. ", " .. z1 ) | outputChatBox( "The coords are: " .. x0 .. ", " .. y0 .. ", " .. z0 .. ", " .. x1 .. ", " .. y1 .. ", " .. z1 ) | ||
else | else | ||
outputChatBox( " | outputChatBox( "Failed to retrieve bounding box" ) | ||
end | end | ||
end | end |
Revision as of 15:53, 20 August 2007
This function returns the minimum and maximum coordinates of an element's bounding box.
Syntax
float float float float float float getElementBoundingBox ( element theElement )
Required Arguments
theElement: the element whose bounding box we want to get.
Returns
- Returns min x, min y, min z, max x, max y, max z if the passed element is valid, false otherwise.
Example
This example outputs to chatbox the minimum and the maximum coordinates of an element.
function minMaxOutput( element ) local x0, y0, z0, x1, y1, z1 = getElementBoundingBox ( element ) if ( x0 ) then outputChatBox( "The coords are: " .. x0 .. ", " .. y0 .. ", " .. z0 .. ", " .. x1 .. ", " .. y1 .. ", " .. z1 ) else outputChatBox( "Failed to retrieve bounding box" ) end end
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