Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

showObjectBounds()

Purpose

Display and configure the collision boundaries of a 3D object

Syntax

showObjectBounds( enabled, colour, thickness )

Arguments

enabled True/false value to display the boundaries

colour Vector containing the RGBA (red, blue, green, alpha) values for the boundaries

thickness Float line thickness in pixels

Example

active = true
thickness = 1
colour = white
showObjectBounds( active, colour, thickness )

model = loadModel( "Kat Deak/Racecar_DogRacer" )
object = placeObject( model, {}, {3, 3, 3} )

c = controls( 0 )
oldc = c

setCamera( { -8, 3, 0 }, {} )
worldLight( { 0, -1, 0 }, white, 2 )

loop
    clear()
    c = controls( 0 )

    thickness += c.ry
    thickness = clamp( thickness, 0, 20 )

    if c.a and !oldc.a then
        active = !active
    endif
    if c.x and !oldc.x then
        colour = { random(1.0), random(1.0), random(1.0), 1 }
    endif

    showObjectBounds( active, colour, thickness )
    rotateObject( object, {0, 1, 0 }, .5 )
    drawObjects()

    oldc = c

    printAt( 0, 0, "Push the right control stick up or down to adjust line thickness" )
    printAt( 0, 2, "Thickness: ", thickness )
    printAt( 0, 4, "Press the X button to randomise line colour" )
    printAt( 0, 6, "Press the A button to set bounds visibility" )
    printAt( 0, 8, "Bounds visibility: ", active)

    update()
repeat

Associated Commands

drawObjects(), loadModel(), objectPointAt(), placeObject(), removeObject(), rotateObject(), setObjectCollisionScale(), setObjectMaterial(), setObjectPos()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.