Hide

This functions hides an entity. A hidden entity will be invisible, will not collide with other entities, and its 4x4 matrix will not be updated when the parent moves.

Syntax

Returns

If the entity is hidden, true is returned, otherwise false is returned.

Example

entity = {}

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

model = Model:Box()
model:SetColor(0.0,0.0,1.0)

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

model:Turn(0,Time:GetSpeed(),0)

if (window:KeyHit(Key.Space)) then

if (model:Hidden()) then
model:Show()
else
model:Hide()
end
end

Time:Update()
world:Update()
world:Render()

context:SetBlendMode(Blend.Alpha)
context:DrawText("Press space to change.",2,2)
context:DrawText("Hidden:"..tostring(model:Hidden()),2,22)

context:Sync()
end