LUADOC - Farming Simulator 19

Script v1.7.1.0

Engine v1.7.1.0

Foundation Reference

IKChains

Description
Specialization loading inverse kinematic (IK) chains
Functions

onLoad

Description
Definition
onLoad()
Code
28function IKChains:onLoad(savegame)
29 local spec = self.spec_ikChains
30
31 spec.chains = {}
32 local i = 0
33 while true do
34 local key = string.format("vehicle.ikChains.ikChain(%d)", i)
35 if not hasXMLProperty(self.xmlFile, key) then
36 break
37 end
38 IKUtil.loadIKChain(self.xmlFile, key, self.components, self.components, spec.chains, self.getParentComponent, self)
39 i = i + 1
40 end
41 IKUtil.updateAlignNodes(spec.chains, self.getParentComponent, self, nil)
42end

onUpdate

Description
Definition
onUpdate()
Code
46function IKChains:onUpdate(dt, isActiveForInput, isActiveForInputIgnoreSelection, isSelected)
47 local spec = self.spec_ikChains
48 IKUtil.updateIKChains(spec.chains) --, 40, 0.001)
49end

prerequisitesPresent

Description
Definition
prerequisitesPresent()
Code
15function IKChains.prerequisitesPresent(specializations)
16 return true
17end

registerEventListeners

Description
Definition
registerEventListeners()
Code
21function IKChains.registerEventListeners(vehicleType)
22 SpecializationUtil.registerEventListener(vehicleType, "onLoad", IKChains)
23 SpecializationUtil.registerEventListener(vehicleType, "onUpdate", IKChains)
24end