1. the lua script reads two node paths from a vehicle XML config key.
2. Next, it uses retrieves the nodes:
Code: Select all
node1 = I3DUtil.indexToObject(self.components, getXMLString(self.xmlFile,"path.to.my.key#node"));
node2 = I3DUtil.indexToObject(self.components, getXMLString(self.xmlFile,"path.to.my.key#baseNode"));
Code: Select all
local xWorld, yWorld, zWorld = getWorldTranslation(node1)
Code: Select all
local xLocal, yLocal, zLocal = worldToLocal(node2, xWorld, yWorld, zWorld)
But if they are part of two different components in the XML, the worldToLocal() call produces the wrong coordinates.
To make sure, I also tried this with node1 being a completely different object in-game. In that case, the expected results are returned.