5#include <ext/reactphysics3d/src/collision/shapes/ConcaveMeshShape.h>
6#include <ext/reactphysics3d/src/collision/TriangleMesh.h>
7#include <ext/reactphysics3d/src/collision/TriangleVertexArray.h>
24TerrainMesh::TerrainMesh()
31 vector<Triangle> triangles;
32 vector<Vector3> indexedVertices;
35 for (
auto& triangle: triangles) {
36 for (
const auto& vertex: triangle.getVertices()) {
39 for (; i < indexedVertices.size(); i++) {
40 if (indexedVertices[i].equals(vertexTransformed) ==
true)
break;
42 if (i == indexedVertices.size()) {
43 indexedVertices.push_back(vertexTransformed);
44 vertices.push_back(vertexTransformed[0]);
45 vertices.push_back(vertexTransformed[1]);
46 vertices.push_back(vertexTransformed[2]);
63 Console::println(
"TerrainMesh::setScale(): != 1.0f: Not supported!");
81 reactphysics3d::TriangleVertexArray::VertexDataType::VERTEX_FLOAT_TYPE,
82 reactphysics3d::TriangleVertexArray::IndexDataType::INDEX_INTEGER_TYPE
101 Console::println(
"TerrainMesh::fromTransformations(): Not supported!");
105 Console::println(
"TerrainMesh::clone(): Not supported!");
Bounding volume interface.
reactphysics3d::CollisionShape * collisionShape
void computeBoundingBox()
Compute bounding box.
Terrain mesh physics primitive.
vector< int32_t > indices
reactphysics3d::TriangleVertexArray * triangleVertexArray
reactphysics3d::TriangleMesh * triangleMesh
BoundingVolume * clone() const override
Clones this bounding volume.
void fromTransformations(const Transformations &transformations) override
Transform bounding volume from given transformations.
~TerrainMesh()
Destructor.
void setScale(const Vector3 &scale) override
Set local scale.
TerrainMesh()
Public constructor.
Triangle entity, this is not directly connectable with physics engine.
void getTriangles(vector< Triangle > &triangles, int nodeIdx=-1)
Retrieves list of triangles of all or given nodes.
Vector3 multiply(const Vector3 &v) const
Multiplies a vector3 with this matrix into destination vector.
bool equals(const Vector3 &v) const
Compares this vector with given vector.
Vector3 & set(float x, float y, float z)
Set up vector.