I have released two more utility plugins, and bundled my swf-based plugins as the krpano_fovplugin suite. As with my previous plugins, they are free to use and their sources are available as GPL open source.
string
Provides the following functions designed to complement txtadd provided by krpano itself:
- txtlength(destVar, text)
Sets destVar to the length of 'text' - txtchunk(destVar, text, start, length)
Sets destVar to the substring of 'text', starting from 'start' and 'length' characters long - txtfind(destVar, text, find)
Sets destVar to the position of 'find' in 'text', or -1 if the text is not found - txtreplace(destVar, text, find, replace, flags)
Sets destVar to a copy of 'text', replacing 'find' with 'replace'. The optional 'flags' argument can be used to set flags for the internal regular expression pattern (and defaults to ''gi' for a global, case-insensitive replace).
vectormath
Provides the following functions:
- sin(destVar, angle)
Sets destVar to the sine of 'angle' - cos(destVar, angle)
Sets destVar to the cosine of 'angle' - tan(destVar, angle)
Sets destVar to the tangens of 'angle' - asin(destVar, number)
Sets destVar to the inverse sine of 'number' - acos(destVar, number)
Sets destVar to the inverse cosine of 'number' - atan(destVar, number)
Sets destVar to the inverse tangent of 'number' - atan2(destVar, opposite, adjacent)
Sets destVar to the inverse tangent of 'opposite'/'adjacent' - anglebetween(destVar, ath1, atv1, ath2, atv2)
Sets destVar to the angle between the two vectors defined by ('ath1', 'atv1') and ('ath2', 'atv2') - normal(destVarH, destVarV, ath1, atv1, ath2, atv2)
Sets destVarH and destVarV to align with the normal of the two vectors defined by ('ath1', 'atv1') and ('ath2', 'atv2') - rotatevector(destVarH, destVarV, ath1, atv1, ath2, atv2)
Sets destVarH and destVarV to align with the vector ('ath1', 'atv1') after it has been rotated by ('ath2', 'atv2')
All angles are specified and returned in degrees, and axis rotations are done in the same order as krpano does them.
The string.swf and vectormath.swf files are available as part of the krpano_fovplugins package on github. See the examples folders for usage examples.