- Documentation
- Client functions
- engineGetModelBoundingBox
Function
engineGetModelBoundingBox
Returns a model's collision box: the minimum and maximum x, y, z relative to the model centre, and finally the radius of the collision sphere. The data comes from the collision loaded by the game, so it works for cars, peds and objects. Useful for placing things on the ground, measuring size and framing the camera.
Syntax
float, float, float, float, float, float, float engineGetModelBoundingBox(int modelID)Arguments
modelIDint- Model number.
Returns
minX, minY, minZ, maxX, maxY, maxZ and the radius, or false when the game has no collision loaded for this model.
Example
local x0, y0, z0, x1, y1, z1 = engineGetModelBoundingBox(411)
if x0 then
outputChatBox(("Infernus: %.1f x %.1f x %.1f m"):format(x1 - x0, y1 - y0, z1 - z0))
end