Changeset 1181 for java/Framclipse/com.framsticks.framclipse
- Timestamp:
- 08/10/22 13:51:32 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/Framclipse/com.framsticks.framclipse/res/framscript.xml
r1180 r1181 6793 6793 </type> 6794 6794 <type name="WorldMap" context="Global context"> 6795 <description><![CDATA[Environment details for "Blocks" and "Heightfield" world type. The most important concept is a "Map", which is the array of Map elements. Internally, Maps have more elements than could be deduced from the user-supplied World.wrldsiz, as additional rows of element are added to provide smooth transitions to the flat surroundings. 6796 6797 Blocks: x/ysize=World.wrldsiz+4 rows of blocks (from which only 2+World.wrldsiz rows are placed within the world boundaries) 6798 6799 Smooth: x/ysize=World.wrldsiz+2 rows of vertices (creating World.wrldsiz+1 rows of triangles, everything within the world boundaries) 6800 ]]></description> 6795 <description><![CDATA[Environment details for "Blocks" and "Heightfield" world type. The most important concept is a "Map", which is the array of Map elements.]]></description> 6801 6796 <element name="xsize" type="integer" flags="1"/> 6802 6797 <element name="ysize" type="integer" flags="1"/> 6798 <element name="getAsString" function="true" type="string" flags="32"> 6799 <description><![CDATA[This function returns the universal polygonal description of the world surface (regardless of the world type). The data is provided in the following simple textual format with each line describing one vertex (3 floating point values) or one face (3 or 4 vertex indices - faces can be triangles or quads), which is a subset of the Wavefront .obj file format: 6800 6801 v first vertex coordinates 6802 v second vertex coordinates 6803 v ...etc 6804 f first face indices 6805 f second face indices 6806 f ...etc 6807 6808 For example, the default flat world consists of 4 vertices and 1 quad face: 6809 6810 v 0 0 0 6811 v 20.0 0 0 6812 v 20.0 20.0 0 6813 v 0 20.0 0 6814 f 1 2 3 4 6815 6816 Internaly, the data returned by this function is generated by the 'scripts/worldmap-faces.script' file, so you can refer to its source if needed. 6817 The first argument to getAsString() (if not null or empty string) selects an alternate userscript to be used instead of the default "worldmap-faces.script", allowing for extension and customization. 6818 Examples: 6819 WorldMap.getAsString(null,null) //use the default script 6820 WorldMap.getAsString("myscript","myarg") //calls "WorldMap_myscript", passing "myarg" to its main_args() function.]]></description> 6821 <arguments> 6822 <argument name="alternate script" type="string"/> 6823 <argument name="special arguments" type="untyped"/> 6824 </arguments> 6825 </element> 6803 6826 <element name="getHeight" function="true" type="float"> 6804 6827 <description><![CDATA[Height at any 2d coordinate]]></description> … … 6809 6832 </element> 6810 6833 <element name="getMap" function="true" type="Object"> 6811 <description><![CDATA[retrieve map cell object]]></description> 6834 <description><![CDATA[Retrieve the map element object for a given grid coordinates (x,y), where 0<=x<xsize, 0<=y<ysize. 6835 6836 The obtained value type depends on the current world type. 6837 - Blocks world objects provide 'z' and 'type' values (z is the block height, type is 0=flat block, 1=west-east slope, 2=north-south slope). 6838 - Heightfield world objects provide just the 'z' value (which is the grid point height). 6839 6840 See the 'scripts/worldmap_faces.script' file for a practical example on how to obtain the world geometry data using WorldMap.getMap(). 6841 6842 Quirks: Internally, maps have more elements than could be deduced from the user-supplied World.wrldmap, as additional rows of elements are added to provide smooth transitions to flat surroundings, which is reflected in 'xsize' and 'ysize'. 6843 WorldMap.getMap() arguments refer to this internal representation, so the object corresponding to the first map element is not (0,0), but (1,1) for Heightfield or (2,2) for Blocks world. Not starting from (0,0) can be convenient - for example, given any valid grid coordinates (x,y), all its neighbors are also valid and can be requested through getMap() without introducing any special cases in the code.]]></description> 6812 6844 <arguments> 6813 6845 <argument name="x" type="integer"/>
Note: See TracChangeset
for help on using the changeset viewer.