Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // AlphaEngine API/SDK+AlphaEditor
- //
- // Programmers
- // Vivienne Anthony <[email protected]>
- // Andrej Skorinko. email - <[email protected]>
- //#include "AlphaEngineStd.h"
- #include "AlphaEngine/Graphics3D/SphereTerrain/STDefines.h"
- #include <Graphics3D/SphereTerrain/Face/SphereTerrainFace.h>
- #include <Graphics3D/SphereTerrain/Face/Node/SphereTerrainNode.h>
- #include <Graphics3D/SphereTerrain/Face/Node/Patch/SphereTerrainPatch.h>
- #include <Graphics3D/SphereTerrain/Face/Node/Patch/Topology/SphereTerrainTopology.h>
- #include <Graphics3D/SphereTerrain/SimplexNoise/SimplexNoise.h>
- #include <Graphics3D/SphereTerrain/RidgedNoise/RidgedNoise.h>
- #include <AlphaEngine/Math/aeVector4.h>
- #include <vector>
- #include <cmath>
- // Notes
- // The Topology Code
- // 1) Creates a Vector4 array as Vector4<double> that contains a cube face in a specfic region based on quadtree patch division. A height map texture is also created at the same time.
- // Vector3 facePlane = Vector3::ZERO;
- // Vector3 tempXStep = Vector3::ZERO;
- // Vector3 tempYStep = Vector3::ZERO;
- // aeVector4<double>* pPositionMapData = (aeVector4<double>*) new aeVector4<
- // double> [TEXELSIZEPLUS * TEXELSIZEPLUS];
- // m_pHeightMapTexture = new Texture2D(context_);
- // m_pHeightMapTextureData = new float[TEXELSIZEPLUS * TEXELSIZEPLUS];
- //
- // aeVector4<double> = (x,y,z, height);
- //
- // 2) A normal map data is generated by patch size. Patch size is the vertex defined. In this code 32 is the size.
- //
- // Normals are calculated by triangle face normal. Each vertex is calculated based on the average of surrounding normals
- //
- // 1-2-3
- // |\|/|
- // 0-X-4
- // |/|\|
- // 7-6-5
- //
- // vertex e1 = v2-v1, vertex e2 = v3-v1, vertex normal = e2.crossproduct(e1)
- // then divide by amount of normals
- //
- // In function Vector3 SphereTerrainTopology::CalculateNormal2()
- //
- // When processing if(a vertex is outside) the edge boundary the next triangle face is calculated.
- // The total number of calculated normals is used for the division
- //
- // 3) Create geometry by U, V by 2 (the equivalent of U, V * 8 to much the 257) texel size
- //
- // Each vertex point use the above method to add geometry
- //
- // Add each triangle to the geometry VertexData
- //
- SphereTerrainTopology::SphereTerrainTopology(Context * context,
- SphereTerrainPatch * Patch = nullptr) :
- Object(context), m_pPatch(Patch), m_pVertexData(nullptr), m_pIndexData(
- nullptr), m_pHeightMapTextureData(nullptr), m_pHeightMapTexture(
- nullptr), m_IndexCount(0), m_VertexCount(0) {
- }
- void SphereTerrainTopology::RegisterObject(Context* context) {
- context->RegisterFactory<SphereTerrainTopology>();
- }
- // Build Data
- void SphereTerrainTopology::GenerateTopology() {
- // Do not compute topology if none exist
- if (!m_pPatch) {
- return;
- };
- // Create Noise
- SimplexNoise newNoise;
- // Create memory
- m_pVertexData = (float *) new float[PATCH_VERTICES_TOTAL * VERTEXELEMENTS
- * 6]; //256 / 768
- m_pIndexData = (unsigned int *) new unsigned int[PATCH_VERTICES_TOTAL * 6];
- // Create Position Map Data
- aeVector4<double>* pPositionMapData = (aeVector4<double>*) new aeVector4<
- double> [TEXELSIZEPLUS * TEXELSIZEPLUS];
- // temporary Vertex Data
- Vector3 tempVertexNormalData[33 * 33];
- // Create memory
- m_pHeightMapTexture = new Texture2D(context_);
- m_pHeightMapTextureData = new float[TEXELSIZEPLUS * TEXELSIZEPLUS];
- // Create off texture turn off compression
- m_pHeightMapTexture->SetNumLevels(1);
- m_pHeightMapTexture->SetSize(TEXELSIZEPLUS, TEXELSIZEPLUS,
- g_pApp->GetGraphics()->GetFloat32Format(), TEXTURE_STATIC);
- m_pHeightMapTexture->SetData(0, 0, 0, TEXELSIZEPLUS, TEXELSIZEPLUS,
- m_pHeightMapTextureData);
- m_pHeightMapTexture->SetFilterMode(FILTER_NEAREST);
- // Set Cube size
- float CubeSize = 2.0f;
- // Get Visual Radius
- float SphereTerrainVisualRadius = m_pPatch->GetVisualRadius();
- // Create a ridgednoise perlon
- RidgedNoise someNoise(SphereTerrainVisualRadius);
- // Set Noise
- someNoise.SetRidgedNoiseParameters(m_pPatch->GetHeightScale(),
- m_pPatch->GetOctaves(), m_pPatch->GetGain(),
- m_pPatch->GetLacunarity(), m_pPatch->GetOffset(), m_pPatch->GetH());
- // size best off vertices
- unsigned int PatchSize = PATCH_VERTICES;
- // Get Cube Center - Create Defaults
- Vector3 facePlane = Vector3::ZERO;
- Vector3 tempXStep = Vector3::ZERO;
- Vector3 tempYStep = Vector3::ZERO;
- // Element total size easier to count
- unsigned int VertexElementTotalSize = 6 * VERTEXELEMENTS;
- // Get Face Direction
- const STFaceDirection faceDirection = m_pPatch->GetFaceDirection();
- const Vector2 Coordinates = m_pPatch->GetCoordinates();
- const unsigned int depth = m_pPatch->GetDepth();
- // Face direction
- unsigned int face = (unsigned int) faceDirection;
- // Calculate face plane
- facePlane = ((float) CubeSize / 2) * TerrainFaceCoordinate[face]; // put a side on plane 1
- // Get depth
- float Depth = 1.0f / pow(2.0f, depth);
- switch (face) {
- case 0: {
- tempXStep = CubeSize * Vector3(0, -1, 0);
- tempYStep = CubeSize * Vector3(0, 0, 1);
- }
- break;
- case 1: {
- tempXStep = CubeSize * Vector3(0, -1, 0);
- tempYStep = CubeSize * Vector3(0, 0, -1);
- }
- break;
- case 2: {
- tempXStep = CubeSize * Vector3(0, 0, 1);
- tempYStep = CubeSize * Vector3(1, 0, 0);
- }
- break;
- case 3: {
- tempXStep = CubeSize * Vector3(0, 0, 1);
- tempYStep = CubeSize * Vector3(-1, 0, 0);
- }
- break;
- case 4: {
- tempXStep = CubeSize * Vector3(0, -1, 0);
- tempYStep = CubeSize * Vector3(-1, 0, 0);
- }
- break;
- case 5: {
- tempXStep = CubeSize * Vector3(0, -1, 0);
- tempYStep = CubeSize * Vector3(1, 0, 0);
- }
- break;
- }
- // Index Data
- Vector<unsigned int> indexData;
- // Create a index
- unsigned int index = 0;
- // Set Reference to Vertex Data
- m_pVertexReference = &m_pVertexData[0];
- // SphereTerrain Patch Origin;
- Vector3 tempPatchOrigin;
- // Temporary variables when creating geometry
- Vector3 tempVertexOrigin, tempVertex[8];
- // Temporary variables when creating geometry - Normal Data
- Vector3 tempVertexNormalOrigin, tempVertexNormal[8];
- // Stemp increments when calculating Texel position and height map
- Vector3 tempXIncrement, tempYIncrement;
- // temporary Vertex Height Computerd by Noise
- double tempVertexHeight = 0;
- // temporary Vertex Origin Position For Calculation
- // Note: When Convert Patch Size to Vertex Geomometry
- unsigned int temptempVertexOriginPosition = 0;
- // temporary Vertex Position for For Calcuation
- // Note: When Convert Patch Size to Vertex Geomometry
- unsigned int tempVertexPosition = 0;
- // size to use
- unsigned int scale = TEXELSIZE / PATCH_VERTICES;
- switch (face) {
- case 0:
- tempPatchOrigin = Vector3(0.0f, 1.0f, -1.0f)
- + Vector3(0.0f, -(Coordinates.x_ * 2.0f),
- Coordinates.y_ * 2.0f);
- break;
- case 1: {
- tempPatchOrigin = Vector3(0.0f, 1.0f, 1.0f)
- + Vector3(0.0f, -(Coordinates.x_ * 2.0f),
- -(Coordinates.y_ * 2.0f));
- }
- break;
- case 2: {
- tempPatchOrigin = Vector3(-1.0f, 0.0f, -1.0f)
- + Vector3(Coordinates.y_ * 2.0f, 0.0f, Coordinates.x_ * 2.0f);
- }
- break;
- case 3: {
- tempPatchOrigin = Vector3(1.0f, 0.0f, -1.0f)
- + Vector3(-(Coordinates.y_ * 2.0f), 0.0f,
- Coordinates.x_ * 2.0f);
- }
- break;
- case 4: {
- tempPatchOrigin = Vector3(1.0f, 1.0f, 0.0f)
- + Vector3(-(Coordinates.y_ * 2.0f), -(Coordinates.x_ * 2.0f),
- 0.0f);
- }
- break;
- case 5: {
- tempPatchOrigin = Vector3(-1.0f, 1.0f, 0.0f)
- + Vector3(Coordinates.y_ * 2.0f, -(Coordinates.x_ * 2.0f),
- 0.0f);
- }
- }
- // Add depth
- tempXStep *= Depth;
- tempYStep *= Depth;
- // Generate a position map
- for (int u = 0; u < TEXELSIZEPLUS; u++) {
- for (int v = 0; v < TEXELSIZEPLUS; v++) {
- // Use precache values to speed process
- tempXIncrement = (tempXStep / TEXELSIZE) * v;
- tempYIncrement = (tempYStep / TEXELSIZE) * u;
- // Map origin to a sphere
- tempVertexOrigin = CubeToSphereMapping(
- facePlane + tempPatchOrigin + tempXIncrement
- + tempYIncrement);
- // Get the terrain height
- tempVertexHeight = someNoise.GetTerrainHeight(tempVertexOrigin);
- // Set data to generate a position map used once
- pPositionMapData[(u * TEXELSIZEPLUS) + v] = aeVector4<double>(
- tempVertexOrigin.x_, tempVertexOrigin.y_,
- tempVertexOrigin.z_, (double) tempVertexHeight);
- // Copy height map to data using float
- m_pHeightMapTextureData[(u * TEXELSIZEPLUS) + v] =
- (float) tempVertexHeight;
- }
- }
- for (unsigned int u = 0; u <= PatchSize; u++) {
- for (unsigned int v = 0; v <= PatchSize; v++) {
- tempVertexNormalData[(u * 33) + v] = CalculateNormal2(
- pPositionMapData, u, v);
- }
- }
- // loop through and create a grid of vertices. // do not draw edge
- for (int u = 1; u < PatchSize; u += 2) {
- for (int v = 1; v < PatchSize; v += 2) {
- // Create Index Data
- for (unsigned int i = 0; i < 24; i++) {
- indexData.Push(index);
- index++;
- }
- // Calculate origin point position
- temptempVertexOriginPosition = (u * scale) * TEXELSIZEPLUS
- + (v * scale);
- // Get Position
- tempVertexOrigin =
- Vector3(
- pPositionMapData[temptempVertexOriginPosition].GetVector3());
- // Multiply by stored height
- tempVertexOrigin *=
- pPositionMapData[temptempVertexOriginPosition].GetHeight();
- tempVertexNormalOrigin = tempVertexNormalData[(u * 33) + v];
- // Loop through each edge
- for (unsigned int i = 0; i < 8; i++) {
- // Create the position in array
- tempVertexPosition = temptempVertexOriginPosition
- + ((EdgeVertex[i][1] * scale) * TEXELSIZEPLUS)
- + (EdgeVertex[i][0] * scale);
- // Get Position
- tempVertex[i] = Vector3(
- pPositionMapData[tempVertexPosition].GetVector3());
- // Multiply by stored height
- tempVertex[i] *=
- pPositionMapData[tempVertexPosition].GetHeight();
- // normalize
- tempVertexNormal[i] = tempVertexNormalData[(((u
- + EdgeVertex[i][1]) * 33) + v + EdgeVertex[i][0])];
- }
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[1], tempVertexNormal[1], tempVertex[2],
- tempVertexNormal[2]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[2], tempVertexNormal[2], tempVertex[3],
- tempVertexNormal[3]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[3], tempVertexNormal[3], tempVertex[4],
- tempVertexNormal[4]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[4], tempVertexNormal[4], tempVertex[5],
- tempVertexNormal[5]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[5], tempVertexNormal[5], tempVertex[6],
- tempVertexNormal[6]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[6], tempVertexNormal[6], tempVertex[7],
- tempVertexNormal[7]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[7], tempVertexNormal[7], tempVertex[0],
- tempVertexNormal[0]);
- AddTriangleN(tempVertexOrigin, tempVertexNormalOrigin,
- tempVertex[0], tempVertexNormal[0], tempVertex[1],
- tempVertexNormal[1]);
- }
- }
- // Just use the index ad the vertex count
- m_IndexCount = indexData.Size();
- m_VertexCount = indexData.Size();
- // Copy Index Shortcut
- for (unsigned i = 0; i < m_IndexCount; i++) {
- m_pIndexData[i] = indexData.At(i);
- }
- // Delete Position Data
- delete[] pPositionMapData;
- // Null Ptr
- pPositionMapData = nullptr;
- }
- SphereTerrainTopology::~SphereTerrainTopology() {
- // Delete Texture
- delete m_pHeightMapTexture;
- delete[] m_pHeightMapTextureData;
- m_pHeightMapTextureData = nullptr;
- m_pHeightMapTexture = nullptr;
- // Remove Data
- delete[] m_pVertexData;
- delete[] m_pIndexData;
- // Null Ptr
- m_pVertexData = nullptr;
- m_pIndexData = nullptr;
- // Clear Counter
- m_IndexCount = 0;
- m_VertexCount = 0;
- }
- void SphereTerrainTopology::AddTriangle(Vector3 v1, Vector3 v2, Vector3 v3) {
- Vector3 cache_normal = Vector3::ZERO;
- *m_pVertexReference = v1.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v1.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v1.z_;
- *m_pVertexReference++;
- v1 = cache_normal.Normalized();
- *m_pVertexReference = v1.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v1.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v1.z_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.z_;
- *m_pVertexReference++;
- v2 = cache_normal.Normalized();
- *m_pVertexReference = v2.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.z_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.z_;
- *m_pVertexReference++;
- v3 = cache_normal.Normalized();
- *m_pVertexReference = v3.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.z_;
- *m_pVertexReference++;
- }
- void SphereTerrainTopology::AddTriangleN(Vector3 v1, Vector3 n1, Vector3 v2,
- Vector3 n2, Vector3 v3, Vector3 n3) {
- // Save Vertex information
- *m_pVertexReference = v1.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v1.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v1.z_;
- *m_pVertexReference++;
- *m_pVertexReference = n1.x_;
- *m_pVertexReference++;
- *m_pVertexReference = n1.y_;
- *m_pVertexReference++;
- *m_pVertexReference = n1.z_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v2.z_;
- *m_pVertexReference++;
- *m_pVertexReference = n2.x_;
- *m_pVertexReference++;
- *m_pVertexReference = n2.y_;
- *m_pVertexReference++;
- *m_pVertexReference = n2.z_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.x_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.y_;
- *m_pVertexReference++;
- *m_pVertexReference = v3.z_;
- *m_pVertexReference++;
- *m_pVertexReference = n3.x_;
- *m_pVertexReference++;
- *m_pVertexReference = n3.y_;
- *m_pVertexReference++;
- *m_pVertexReference = n3.z_;
- *m_pVertexReference++;
- }
- Vector3 SphereTerrainTopology::SurfaceVectorToCoordinates(Vector3 surfacePos,
- float radius, float height) {
- // Create a return veriable.
- Vector3 loReturnData = surfacePos;
- // Get a unit vector ( this will 'point' in the correct direction, from (0,0,0) to
- // the position of the vertex on the sphere ).
- loReturnData.Normalize();
- Vector3 pos = loReturnData.Normalized() * radius;
- // Add the planet radius and the height of the vertex, and return the vector.
- return loReturnData.Normalized();
- }
- Vector3 SphereTerrainTopology::CubeToSphereMapping(Vector3 surfacePos) {
- // Cube to Sphere Mapping
- // http://mathproofs.blogspot.co.uk/2005/07/mapping-cube-to-sphere.html
- /*
- float x = surfacePos.x_;
- float y = surfacePos.y_;
- float z = surfacePos.z_;
- // Create a square root
- float x2 = x * x;
- float y2 = y * y;
- float z2 = z * z;
- Vector3 ret;
- ret.x_ = x * sqrtf(1.0f - (y2 / 2.0f) - (z2 / 2.0f) + (y2 * z2 / 3.14f));
- ret.y_ = y * sqrtf(1.0f - (z2 / 2.0f) - (x2 / 2.0f) + (x2 * z2 / 3.14f));
- ret.z_ = z * sqrtf(1.0f - (x2 / 2.0f) - (y2 / 2.0f) + (x2 * y2 / 3.14f));*/
- cubetosphere_x = surfacePos.x_;
- cubetosphere_y = surfacePos.y_;
- cubetosphere_z = surfacePos.z_;
- // Create a square root
- cubetosphere_x2 = cubetosphere_x * cubetosphere_x;
- cubetosphere_y2 = cubetosphere_y * cubetosphere_y;
- cubetosphere_z2 = cubetosphere_z * cubetosphere_z;
- cubetosphere_ret.x_ = cubetosphere_x
- * sqrtf(
- 1.0f - (cubetosphere_y2 / 2.0f) - (cubetosphere_z2 / 2.0f)
- + (cubetosphere_y2 * cubetosphere_z2 / 3.14f));
- cubetosphere_ret.y_ = cubetosphere_y
- * sqrtf(
- 1.0f - (cubetosphere_z2 / 2.0f) - (cubetosphere_x2 / 2.0f)
- + (cubetosphere_x2 * cubetosphere_z2 / 3.14f));
- cubetosphere_ret.z_ = cubetosphere_z
- * sqrtf(
- 1.0f - (cubetosphere_x2 / 2.0f) - (cubetosphere_y2 / 2.0f)
- + (cubetosphere_x2 * cubetosphere_y2 / 3.14f));
- return cubetosphere_ret;
- }
- Vector3 SphereTerrainTopology::GetNormalHeight(
- const aeVector4<double> * positionMap, unsigned int u, unsigned int v) {
- unsigned int scale = 8;
- Vector3 normalVector;
- if (u == 0 || v == 0) {
- return normalVector;
- }
- // cakculate
- float heightL = (float) positionMap[((u - 1) * scale * TEXELSIZEPLUS)
- + ((v - 1) * scale)].h;
- float heightR = (float) positionMap[((u - 1) * scale * TEXELSIZEPLUS)
- + ((v + 1) * scale)].h;
- float heightD = (float) positionMap[((u + 1) * scale * TEXELSIZEPLUS)
- + ((v - 1) * scale)].h;
- float heightU = (float) positionMap[((u + 1) * scale * TEXELSIZEPLUS)
- + ((v + 1) * scale)].h;
- if (heightR > TEXELSIZEPLUS || heightL > TEXELSIZEPLUS
- || heightD > TEXELSIZEPLUS || heightU > TEXELSIZEPLUS) {
- return normalVector;
- }
- normalVector.x_ = heightL - heightR;
- normalVector.y_ = 1.0f;
- normalVector.z_ = heightD - heightU;
- return normalVector;
- }
- Vector3 SphereTerrainTopology::CalculateNormal2(
- const aeVector4<double> * positionMap, unsigned int u, unsigned int v) {
- Vector3 edgeVertexSum = Vector3::ZERO;
- unsigned int scale = 8;
- unsigned int faces = 0;
- Vector3 v0 =
- positionMap[(u * scale) * TEXELSIZEPLUS + (v * scale)].GetVector3()
- * positionMap[(u * scale) * TEXELSIZEPLUS + (v * scale)].GetHeight();
- for (unsigned int i = 0; i < 8; i++) {
- unsigned int vp = i;
- if (u + EdgeVertex[vp][1] < 0 || u + EdgeVertex[vp][1] > 32)
- continue;
- if (v + EdgeVertex[vp][0] < 0 || v + EdgeVertex[vp][0] > 32)
- continue;
- // Calculate origin point position
- Vector3 v1 =
- positionMap[((u + EdgeVertex[vp][1]) * scale) * TEXELSIZEPLUS
- + ((v + EdgeVertex[vp][0]) * scale)].GetVector3()
- * positionMap[((u + EdgeVertex[vp][1]) * scale)
- * TEXELSIZEPLUS
- + ((v + EdgeVertex[vp][0]) * scale)].GetHeight();
- // Skip to Next Vertex
- vp++;
- if (vp == 8) {
- vp = 0;
- }
- if (u + EdgeVertex[vp][1] < 0 || u + EdgeVertex[vp][1] > 32)
- continue;
- if (v + EdgeVertex[vp][0] < 0 || v + EdgeVertex[vp][0] > 32)
- continue;
- Vector3 v2 =
- positionMap[((u + EdgeVertex[vp][1]) * scale) * TEXELSIZEPLUS
- + ((v + EdgeVertex[vp][0]) * scale)].GetVector3()
- * positionMap[((u + EdgeVertex[vp][1]) * scale)
- * TEXELSIZEPLUS
- + ((v + EdgeVertex[vp][0]) * scale)].GetHeight();
- // Skip to Next Vertex
- vp++;
- if (vp == 8) {
- vp = 0;
- }
- Vector3 a = v2 - v0;
- Vector3 b = v1 - v0;
- Vector3 n = b.CrossProduct(a);
- edgeVertexSum += n.Normalized();
- faces++;
- }
- // Renormalize
- edgeVertexSum.Normalize();
- // Average the vertexes normalze
- edgeVertexSum /= faces;
- return edgeVertexSum;
- }
- // Get Vertex Data
- float * SphereTerrainTopology::GetVertexData() const {
- return m_pVertexData;
- }
- // Get Index Data
- unsigned int * SphereTerrainTopology::GetIndexData() const {
- return m_pIndexData;
- }
- // Get Vertex Count (Same as Index count)
- unsigned int SphereTerrainTopology::GetVertexCounts() const {
- return m_VertexCount;
- }
- // Get Index Count (Same as Vertex count)
- unsigned int SphereTerrainTopology::GetIndexCounts() const {
- return m_IndexCount;
- }
- Texture2D * SphereTerrainTopology::GetHeightMap() const {
- return m_pHeightMapTexture;
- }
Advertisement
Add Comment
Please, Sign In to add comment