 |
AGXDynamics
2.35.0.3
|
Go to the documentation of this file.
17 #ifndef AGXCOLLIDE_HEIGHTFIELD_H
18 #define AGXCOLLIDE_HEIGHTFIELD_H
27 #include <external/GIMPACT/AabbTree.h>
146 size_t minVertexX,
size_t maxVertexX,
147 size_t minVertexY,
size_t maxVertexY);
167 void setHeight(
size_t xIndex,
size_t yIndex,
agx::Real height);
175 agx::Real getHeight(
size_t x,
size_t y)
const;
178 size_t getResolutionX()
const;
181 size_t getResolutionY()
const;
212 agx::Vec3 getVertexFromGrid(
size_t xIndex,
size_t yIndex)
const;
226 void setMinAllowedHeight(
agx::Real minAllowedHeight);
238 void setDynamic(
bool dynamic);
244 bool getDynamic()
const;
256 bool calculateVertexIndicesTouchedByAABB(
270 virtual void calculatePossibleTriangleOverlapsAlongLineSegment(
283 virtual void calculatePossibleTriangleOverlapsAlongLineSegment(
294 void calculateVertexCoordinates(
296 size_t& vertexIndexX,
size_t& vertexIndexY)
const;
304 size_t getTriangleIndex(
305 size_t indexX,
size_t indexY,
306 uint_fast8_t upper)
const;
331 void calculateMassProperties();
338 virtual Shape* clone()
const override;
350 virtual void updateBvhTree()
override;
358 void updateTriangle(
size_t triangleIndex,
bool shouldUpdateBvhNode =
true);
360 void addQuadrantVolume(
int xIndex,
int yIndex,
agx::Real factor);
379 void finalize(
bool updateMassProperties,
const agx::RealVector& heights,
bool flipY =
false);
387 void setHeights(
bool shouldUpdateMassProperties,
const agx::RealVector& heights,
bool flipY =
false);
452 size_t& vertexIndexX,
size_t& vertexIndexY)
const
agx::Vec3 getVertex(size_t globalVertexIndex) const
void setDynamic(bool dynamic)
Sets if the HeightField is dynamic, which means if it should keep its MassProperties updated.
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
void calculateVertexCoordinates(size_t vertexIndex, size_t &vertexIndexX, size_t &vertexIndexY) const
Calculates the vertex indices for x and y given a global vertex index.
BoundingAABB m_localBound
const HeightFieldMeshData * getHeightFieldMeshData() const
#define DOXYGEN_END_INTERNAL_BLOCK()
agx::Vec2 getSize() const
Returns the size of the HeightField (in dimension x and y).
#define DOXYGEN_START_INTERNAL_BLOCK()
A HeightField is a collision shape that can be created from a grid structure, like an image.
void setMinAllowedHeight(agx::Real minAllowedHeight)
Sets the new minAllowedHeight, which is at the same time the lower bound for a dynamic HeightField (f...
Axis aligned bounding box implementation.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
void calculateMassProperties()
Calculates "mass properties" such as volume, unscaled inertia tensor and center.
Class for data sharing only to be used by HeightField.
#define AGXPHYSICS_EXPORT
size_t getTriangleIndex(size_t indexX, size_t indexY, uint_fast8_t upper) const
Computes the global triangle index within the HeightField.
HeightFieldMeshDataRef m_heightFieldData
agx::Vec3 getVertexFromGrid(size_t xIndex, size_t yIndex) const
Returns the vertex at a grid position.
agx::Real getHeight(size_t x, size_t y) const
Gets the height at a grid point.
agx::Real getMinAllowedHeight() const
Returns the minimum allowed height, which is at the same time the lower bound for a dynamic HeightFie...
Class for more intuitive access to the Mesh's mesh data.
agx::Real getMinHeight() const
Returns the (global) minimum height of the HeightField.
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
size_t getResolutionY() const
Returns the resolution (the number of height values) in dimension y.
bool getDynamic() const
Return if the HeightField is dynamic, which means if it should keep its MassProperties updated.
Class to represent Images.
agx::Vec2 getScale() const
Returns the scaling factor for a single cell in the HeightField (in dimension x and y).
This namespace consists of a set of classes for handling geometric intersection tests including boole...
size_t getResolutionX() const
Returns the resolution (the number of height values) in dimension x.
CollisionMeshDataRef m_collisionMeshData
AGX_DECLARE_POINTER_TYPES(SpaceListener)
agx::Vec2 projectPointToGrid(const agx::Vec3 &point) const
Projects a point in local HeightField coordinate system to the HeightField grid (which is moved to th...
agx::Real getMaxHeight() const
Returns the (global) maximum height of the HeightField.
Vec2T< Real > Vec2
The object holding 2 dimensional vectors and providing basic arithmetic.
The agxIO namespace contains classes for reading, writing and finding files.