TDME2  1.9.200
HeightMap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tdme/tdme.h>
7 #include <tdme/math/Vector3.h>
8 
12 
13 /**
14  * Height map physics primitive
15  * @author Andreas Drewke
16  */
18  : public BoundingVolume
19 {
20 private:
21  int columns;
22  int rows;
23  float minHeight;
24  float maxHeight;
25  float* heightValues;
26 
27  // overridden methods
28  void destroyCollisionShape() override;
29  void createCollisionShape(World* world) override;
30 
31 public:
32  // forbid class copy
34 
35  /**
36  * Public constructor
37  * @param colums columns
38  * @param rows rows
39  * @param minHeight min height
40  * @param maxHeight max height
41  * @param heightValues height values which will not be copied
42  * @param scale scale
43  */
44  HeightMap(
45  int columns,
46  int rows,
47  float minHeight,
48  float maxHeight,
49  float* heightValues,
50  const Vector3& scale = Vector3(1.0f, 1.0f, 1.0f)
51  );
52 
53  /**
54  * Public destructor
55  */
56  ~HeightMap();
57 
58  // overrides
59  void setScale(const Vector3& scale) override;
60  BoundingVolume* clone() const override;
61 
62 };
Dynamic physics world class.
Definition: World.h:38
Height map physics primitive.
Definition: HeightMap.h:19
HeightMap(int columns, int rows, float minHeight, float maxHeight, float *heightValues, const Vector3 &scale=Vector3(1.0f, 1.0f, 1.0f))
Public constructor.
Definition: HeightMap.cpp:19
void destroyCollisionShape() override
Destroy collision shape.
Definition: HeightMap.cpp:43
void setScale(const Vector3 &scale) override
Set local scale.
Definition: HeightMap.cpp:39
~HeightMap()
Public destructor.
Definition: HeightMap.cpp:35
void createCollisionShape(World *world) override
Create collision shap.
Definition: HeightMap.cpp:50
BoundingVolume * clone() const override
Clones this bounding volume.
Definition: HeightMap.cpp:70
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6