Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- AnimatedMapObject
- AnimatedObject
- AnimatedObjectEvent
- Bale
- Basketball
- Bga
- BgaSellStation
- BunkerSilo
- BuyingStation
- DigitalDisplay
- DogBall
- HelpIcons
- LoadingStation
- NightIllumination
- Nightlight2
- NightlightFlicker
- PhysicsObject
- Rotator
- SellingStation
- SimParticleSystem
- Storage
- StorageSystem
- SunAdmirer
- TourIcons
- UnloadingStation
- VehicleSellingPoint
- WildlifeSpawner
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
Rotator
Descriptions rotate around their y axisFunctions
new
DescriptionCreating rotatorDefinition
new(integer name)Arguments
integer | name | node id |
table | instance | Instance of object |
21 | function Rotator:new(name) |
22 | local self = {} |
23 | setmetatable(self, Rotator_mt) |
24 | |
25 | self.axisTable = {0, 0, 0} |
26 | self.me = name |
27 | self.speed = Utils.getNoNil(getUserAttribute(name, "speed"), 0.0012) |
28 | local axis = Utils.getNoNil(getUserAttribute(name, "axis"), 3) |
29 | self.axisTable[axis] = 1 |
30 | |
31 | return self |
32 | end |
onCreate
DescriptionCreating rotatorDefinition
onCreate(integer id)Arguments
integer | id | node id |
13 | function Rotator:onCreate(id) |
14 | g_currentMission:addUpdateable(Rotator:new(id)) |
15 | end |
update
DescriptionUpdateDefinition
update(float dt)Arguments
float | dt | time since last call in ms |
40 | function Rotator:update(dt) |
41 | rotate(self.me, self.axisTable[1] * self.speed * dt, self.axisTable[2] * self.speed * dt, self.axisTable[3] * self.speed * dt) |
42 | end |