Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------------------------------
- -- this functions moves an array of points to it's new location relative to the old origin,
- -- so the distance and bearing between the points and the old origin are the same for the new origin
- -- NOTE: On some devices the calls are 'call by value' and on others 'call by reference'
- --
- -- @param:
- -- zPoints: Points (array of ZonePoints)
- -- oldOrigin: OriginalPoint
- -- newOrigin: OriginalPoint
- -- @return:
- -- zPoints: Points (array of ZonePoints)
- function translatePointsRelativeSafe(zPoints, oldOrigin, newOrigin)
- local index
- local value
- local bearing
- local distance
- for index, value in pairs(zPoints) do
- distance, bearing = VectorToPointSafeToUseOniPhone(oldOrigin, zPoints[index])
- zPoints[index] = Wherigo.TranslatePoint(newOrigin, distance, bearing)
- end
- return zPoints
- end
- ---------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement