Script v1.4.4.0
- Handtools
- Events
- Objects
- AnimatedObject
- Bale
- Basketball
- Bga
- BunkerSilo
- FieldDefinition
- FillablePallet
- HelpIcons
- MountableObject
- Nightlight2
- NightlightFlicker
- PhysicsObject
- Rotator
- SaplingPallet
- ShovelTarget
- SimParticleSystem
- StationCrane
- Storage
- TourIcons
- Train
- VehicleSellingPoint
- Placeables
- Triggers
- Utils
- Vehicles
- Specializations
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
Rotator
DescriptionRotators rotate around their y axisFunctions
onCreate
DescriptionCreating rotatorDefinition
onCreate(integer id)Arguments
integer | id | node id |
15 | function Rotator:onCreate(id) |
16 | g_currentMission:addUpdateable(Rotator:new(id)); |
17 | end; |
new
DescriptionCreating rotatorDefinition
new(integer name)Arguments
integer | name | node id |
table | instance | Instance of object |
23 | function Rotator:new(name) |
24 | local self = {}; |
25 | setmetatable(self, Rotator_mt); |
26 | |
27 | self.axisTable = {0, 0, 0}; |
28 | self.me = name; |
29 | self.speed = Utils.getNoNil(getUserAttribute(name, "speed"), 0.0012); |
30 | local axis = Utils.getNoNil(getUserAttribute(name, "axis"), 3); |
31 | self.axisTable[axis] = 1; |
32 | |
33 | return self; |
34 | end; |
update
DescriptionUpdateDefinition
update(float dt)Arguments
float | dt | time since last call in ms |
42 | function Rotator:update(dt) |
43 | rotate(self.me, self.axisTable[1] * self.speed * dt, self.axisTable[2] * self.speed * dt, self.axisTable[3] * self.speed * dt); |
44 | end; |