LockMatrix

This function pauses entity matrix updating. For faster performance, use this before calling multiple animation commands, then use Entity::UnlockMatrix() to resume entity matrix updating.

Syntax

Example

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

--Load a model
model = Model:Load("Models/Characters/Barbarian/barbarian.mdl")

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

--We're going to make a lot of changes to the entity orientation, but the expensive update
--stuff will only occur once per loop when we call Entity::UnlockMatrix()
model:LockMatrix()
model:SetAnimationFrame(Time:GetCurrent()/100.0,1)
model:SetAnimationFrame(Time:GetCurrent()/100.0,0.5,1)
model:SetAnimationFrame(Time:GetCurrent()/100.0,0.5,2)
model:UnlockMatrix()

Time:Update()
world:Update()
world:Render()
context:Sync()

end