CollisionOutline

Package: Libraries.Interface.Controls.Scenes.Items · Inherits from: Libraries.Interface.Item3D, Libraries.Interface.Item, Libraries.Language.Object, Libraries.Game.Graphics.Model

The CollisionOutline is the scene editor's outline of an item's collision box: the box's twelve edges, where the box is when the game runs, colored by the item's responsiveness (light blue Unmovable, orange Non-responsive, green Responsive). It is an editor helper, not a scene item, and lets clicks through. It is made at the box's size in the world, so its edges look the same width at any scale. Boxes of the same size share one mesh (SelectionBoxMesh), and a new one is loaded only when the size changes, so following an item each frame is cheap.

Example Code

use Libraries.Interface.Controls.Scenes.Items.CollisionOutline
use Libraries.Game.Graphics.Model
use Libraries.Game.Physics.PhysicsProperties3D

Model tent
tent:Load("Models/Tent.obj")
PhysicsProperties3D physics
CollisionOutline outline
outline:Follow(tent, physics:NON_RESPONSIVE)

Actions

Follow(Libraries.Game.Graphics.Model item, integer responsiveness)

This action puts the outline over an item's collision box: its size is the item's width, height and depth times its scale, its middle is the item's shape offset (SetShapeOffset) placed through the item's position, turn and scale, and it turns with the item.

Parameters

  • item Libraries.Game.Graphics.Model: The item whose collision box is shown
  • responsiveness integer: The item's responsiveness, from PhysicsProperties3D (UNMOVABLE, NON_RESPONSIVE or RESPONSIVE)

Inherited Actions

112 actions from Libraries.Game.Graphics.Model
62 actions from Libraries.Interface.Item
211 actions from Libraries.Interface.Item3D
3 actions from Libraries.Language.Object