2015-04-08 11:52:03 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module Terrain
|
|
|
|
-- @extend Node
|
|
|
|
-- @parent_module cc
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- initialize heightMap data
|
|
|
|
-- @function [parent=#Terrain] initHeightMap
|
|
|
|
-- @param self
|
|
|
|
-- @param #char heightMap
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2015-05-11 10:00:41 +08:00
|
|
|
--------------------------------
|
|
|
|
-- set the MaxDetailAmount.
|
|
|
|
-- @function [parent=#Terrain] setMaxDetailMapAmount
|
|
|
|
-- @param self
|
|
|
|
-- @param #int maxValue
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- show the wireline instead of the surface,Debug Use only.<br>
|
|
|
|
-- Note only support desktop platform
|
|
|
|
-- @function [parent=#Terrain] setDrawWire
|
|
|
|
-- @param self
|
|
|
|
-- @param #bool boolValue
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- Switch frustum Culling Flag<br>
|
|
|
|
-- Note frustum culling will remarkable improve your terrain rendering performance.
|
|
|
|
-- @function [parent=#Terrain] setIsEnableFrustumCull
|
|
|
|
-- @param self
|
|
|
|
-- @param #bool boolValue
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
2015-05-25 16:37:59 +08:00
|
|
|
--------------------------------
|
|
|
|
-- get the terrain's height data
|
|
|
|
-- @function [parent=#Terrain] getHeightData
|
|
|
|
-- @param self
|
|
|
|
-- @return array_table#array_table ret (return value: array_table)
|
|
|
|
|
2015-05-11 10:00:41 +08:00
|
|
|
--------------------------------
|
|
|
|
-- set the Detail Map
|
|
|
|
-- @function [parent=#Terrain] setDetailMap
|
|
|
|
-- @param self
|
|
|
|
-- @param #unsigned int index
|
|
|
|
-- @param #cc.Terrain::DetailMap detailMap
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- reset the heightmap data.
|
|
|
|
-- @function [parent=#Terrain] resetHeightMap
|
|
|
|
-- @param self
|
|
|
|
-- @param #char heightMap
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
2015-04-08 11:52:03 +08:00
|
|
|
--------------------------------
|
|
|
|
-- set the alpha map
|
|
|
|
-- @function [parent=#Terrain] setAlphaMap
|
|
|
|
-- @param self
|
|
|
|
-- @param #cc.Texture2D newAlphaMapTexture
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- set the skirt height ratio
|
|
|
|
-- @function [parent=#Terrain] setSkirtHeightRatio
|
|
|
|
-- @param self
|
|
|
|
-- @param #float ratio
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- Convert a world Space position (X,Z) to terrain space position (X,Z)
|
|
|
|
-- @function [parent=#Terrain] convertToTerrainSpace
|
|
|
|
-- @param self
|
|
|
|
-- @param #vec2_table worldSpace
|
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- initialize alphaMap ,detailMaps textures
|
|
|
|
-- @function [parent=#Terrain] initTextures
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- initialize all Properties which terrain need
|
|
|
|
-- @function [parent=#Terrain] initProperties
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2015-05-11 10:00:41 +08:00
|
|
|
--------------------------------
|
|
|
|
-- Set threshold distance of each LOD level,must equal or gereater than the chunk size<br>
|
|
|
|
-- Note when invoke initHeightMap, the LOD distance will be automatic calculated.
|
|
|
|
-- @function [parent=#Terrain] setLODDistance
|
|
|
|
-- @param self
|
|
|
|
-- @param #float lod1
|
|
|
|
-- @param #float lod2
|
|
|
|
-- @param #float lod3
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- get the terrain's size
|
|
|
|
-- @function [parent=#Terrain] getTerrainSize
|
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
2015-04-08 11:52:03 +08:00
|
|
|
--------------------------------
|
|
|
|
-- get the normal of the specified pistion in terrain<br>
|
|
|
|
-- return the normal vector of the specified position of the terrain.<br>
|
|
|
|
-- note the fast normal calculation may not get precise normal vector.
|
|
|
|
-- @function [parent=#Terrain] getNormal
|
|
|
|
-- @param self
|
|
|
|
-- @param #int pixelX
|
|
|
|
-- @param #int pixelY
|
|
|
|
-- @return vec3_table#vec3_table ret (return value: vec3_table)
|
|
|
|
|
2015-04-09 11:50:13 +08:00
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Terrain] reload
|
|
|
|
-- @param self
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
2015-04-08 11:52:03 +08:00
|
|
|
--------------------------------
|
|
|
|
-- get height from the raw height filed
|
|
|
|
-- @function [parent=#Terrain] getImageHeight
|
|
|
|
-- @param self
|
|
|
|
-- @param #int pixelX
|
|
|
|
-- @param #int pixelY
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- get the terrain's maximum height.
|
|
|
|
-- @function [parent=#Terrain] getMaxHeight
|
|
|
|
-- @param self
|
|
|
|
-- @return float#float ret (return value: float)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-05-11 10:00:41 +08:00
|
|
|
-- get the terrain's mininal height.
|
|
|
|
-- @function [parent=#Terrain] getMinHeight
|
2015-04-09 11:50:13 +08:00
|
|
|
-- @param self
|
2015-05-11 10:00:41 +08:00
|
|
|
-- @return float#float ret (return value: float)
|
2015-04-08 11:52:03 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
--
|
|
|
|
-- @function [parent=#Terrain] draw
|
|
|
|
-- @param self
|
|
|
|
-- @param #cc.Renderer renderer
|
|
|
|
-- @param #mat4_table transform
|
|
|
|
-- @param #unsigned int flags
|
|
|
|
-- @return Terrain#Terrain self (return value: cc.Terrain)
|
|
|
|
|
|
|
|
return nil
|