Sprache Deutsch Language English

Script Dokumentation LS 2015 - Rotator (Patch 1.3)

Script Dokumentation Übersicht

scripts/objects/Rotator.lua

Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1--[[ Rotator class
2
3 Rotators rotate around their y axis
4 Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.
5--]]
6
7Rotator = {}
8
9local Rotator_mt = Class(Rotator);
10
11function Rotator:onCreate(id)
12 g_currentMission:addUpdateable(Rotator:new(id));
13 --print("created Rotator, id: ", id);
14end;
15
16function Rotator:new(name)
17 local self = {};
18 setmetatable(self, Rotator_mt);
19
20 self.axisTable = {0, 0, 0};
21 self.me = name;
22 self.speed = Utils.getNoNil(getUserAttribute(name, "speed"), 0.0012);
23 local axis = Utils.getNoNil(getUserAttribute(name, "axis"), 3);
24 self.axisTable[axis] = 1;
25
26 return self;
27end;
28
29function Rotator:delete()
30
31end;
32
33function Rotator:update(dt)
34 rotate(self.me, self.axisTable[1] * self.speed * dt, self.axisTable[2] * self.speed * dt, self.axisTable[3] * self.speed * dt);
35end;
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
Script Dokumentation Übersicht