Constructor
new Segment(node, planet, tileZoom, extent)
Name | Type | Description |
---|---|---|
node | quadTree. | Segment node. |
planet | Planet | Current planet scene. |
tileZoom | Number | Zoom index. |
extent | Extent | Segment extent. |
Members
_extent :Extent
Geographical extent.
bbox :Box
Segment bounding box.
bsphere :Sphere
Segment bounding sphere
gridSize :number
Vertices grid size.
- number
handler :Handler
WebGl handler pointer.
initialized :boolean
Segment is ready to create plain vertices.
- boolean
materials :Array.<planetSegment.Material>
Texture materials array.
- Array.<planetSegment.Material>
materials
- Source
node :quadTree.Node
Quad tree node of the segment.
- quadTree.
Node
normalMapReady :boolean
Normal map is allready made.
- boolean
parentNormalMapReady :boolean
Parent normal map is made allready(optimization parameter).
- boolean
plainReady :boolean
Plain segment vertices was created.
- boolean
planet :Planet
Planet pointer.
terrainExists :boolean
Terrain existing flag.
- boolean
terrainIsLoading :boolean
Terrain is loading now flag.
- boolean
terrainReady :boolean
Terrain is allready applied flag.
- boolean
tileX :number
Horizontal tile index.
- number
tileY :number
Vertical tile index.
- number
tileZoom :number
Tile zoom index.
- number
Methods
_freeCache()
Removes cache records.
(protected) _getLayerExtentOffset(layer)
Name | Type | Description |
---|---|---|
layer |
- Source
- To Do
- siplify layer._extentMerc in this.getLayerExtent(layer)
_setExtentLonLat()
- Source
acceptForRendering(camera) → {boolean}
Returns that segment good for rendering with camera by current lod ratio.
Name | Type | Description |
---|---|---|
camera | Camera | Camera object. |
- Type:
- boolean
clearSegment()
Clear but not destroy segment data.
createBoundsByExtent()
Creates bound volumes by segment geographical extent.
deleteBuffers()
Delete segment gl buffers.
deleteElevations()
Delete elevation data.
deleteMaterials()
Delete materials.
destroySegment()
Clear and destroy all segment data.
elevationsExists(elevations)
Terrain obtained from server.
Name | Type | Description |
---|---|---|
elevations | Float32Array | Elevation data. |
elevationsExists(elevations)
Terrain obtained from server.
Name | Type | Description |
---|---|---|
elevations | Float32Array | Elevation data. |
- Source
elevationsNotExists()
Terrain is not obtained or not exists on the server.
elevationsNotExists()
Keep plain elevation segment for rendering
'this.tileZoom <= this.planet.terrain.maxZoom' it means, that the segment is plain
- Source
getEntityTerrainPoint(entity, res, normalopt) → {Vec3}
Returns entity terrain point.
Name | Type | Attributes | Description |
---|---|---|---|
entity | Entity | Entity. | |
res | Vec3 | Point coordinates. | |
normal | Vec3 | <optional> | Terrain point normal. |
- Type:
- Vec3
getEntityTerrainPoint(entity, res) → {Vec3}
Returns entity terrain point.
- Source
- Type:
- Vec3
getMaterialByLayer(layer) → {planetSegment.Material}
Gets specific layer material.
Name | Type | Description |
---|---|---|
layer | Layer | Layer object. |
- Segment material.
- Type:
- planetSegment.
Material
getMaterialByLayer(layer) → {Material|undefined}
Gets specific layer material.
Name | Type | Description |
---|---|---|
layer | Layer | Layer object. |
- Source
- Segment material.
- Type:
- Material |
undefined
getTerrainPoint(xyz, insideSegmentPosition, resopt, normalopt) → {number}
Returns distance from object to terrain coordinates and terrain point that calculates out in the res parameter.
Name | Type | Attributes | Description |
---|---|---|---|
xyz | Vec3 | Cartesian object position. | |
insideSegmentPosition | LonLat | Geodetic object position. | |
res | Vec3 | <optional> | Result cartesian coordinates on the terrain. |
normal | Vec3 | <optional> | Terrain point normal. |
- Type:
- number
getTerrainPoint(xyz, insideSegmentPosition, resopt) → {number}
Returns distance from object to terrain coordinates and terrain point that calculates out in the res parameter.
Name | Type | Attributes | Description |
---|---|---|---|
xyz | Vec3 | Cartesian object position. | |
insideSegmentPosition | LonLat | Geodetic object position. | |
res | Vec3 | <optional> | Result cartesian coordinates on the terrain. |
- Source
- Type:
- number
loadTerrain(forceLoading)
Name | Type | Description |
---|---|---|
forceLoading | boolean |
projectNative(lonlat) → {LonLat}
Project wgs86 to segment native projection.
Name | Type | Description |
---|---|---|
lonlat | LonLat | Coordinates to project. |
- Type:
- LonLat
projectNative(lonlat) → {LonLat}
Project wgs86 to segment native projection.
Name | Type | Description |
---|---|---|
lonlat | LonLat | Coordinates to project. |
- Source
- Type:
- LonLat