]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/groundcache.hxx
Use bool where the source and destination variable is bool.
[flightgear.git] / src / FDM / groundcache.hxx
index e881463bb9fddcf0da0fd1daec74aa17faf00880..e91534a63f1ba532e7845e3e6392383fab6ee5dc 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
@@ -28,6 +28,8 @@
 #include <simgear/compiler.h>
 #include <simgear/constants.h>
 
+class SGMaterial;
+
 class FGGroundCache {
 public:
     FGGroundCache();
@@ -63,8 +65,7 @@ public:
     // and finally the altitude above ground.
     bool get_agl(double t, const double pt[3], double max_altoff,
                  double contact[3], double normal[3], double vel[3],
-                 int *type, double *loadCapacity,
-                 double *frictionFactor, double *agl);
+                 int *type, const SGMaterial** material, double *agl);
 
     // Return 1 if the hook intersects with a wire.
     // That test is done by checking if the quad spanned by the points pt*
@@ -82,25 +83,34 @@ public:
 
 private:
     struct Triangle {
+      Triangle() : material(0) {}
       // The edge vertices.
       sgdVec3 vertices[3];
       // The surface normal.
       sgdVec4 plane;
       // The bounding shpere.
       sgdSphere sphere;
-      // The linear velocity.
+      // The linear and angular velocity.
       sgdVec3 velocity;
+      sgdVec3 rotation;
+      sgdVec3 rotation_pivot;
       // Ground type
       int type;
+      // the simgear material reference, contains friction coeficients ...
+      const SGMaterial* material;
     };
     struct Catapult {
       sgdVec3 start;
       sgdVec3 end;
       sgdVec3 velocity;
+      sgdVec3 rotation;
+      sgdVec3 rotation_pivot;
     };
     struct Wire {
       sgdVec3 ends[2];
       sgdVec3 velocity;
+      sgdVec3 rotation;
+      sgdVec3 rotation_pivot;
       int wire_id;
     };
 
@@ -141,12 +151,13 @@ private:
 
     // Helper class to hold some properties of the ground triangle.
     struct GroundProperty {
-      GroundProperty() : type(0) {}
+      GroundProperty() : type(0), material(0) {}
       int type;
       int wire_id;
-      sgVec3 vel;
-      // not yet implemented ...
-//       double loadCapacity;
+      sgdVec3 vel;
+      sgdVec3 rot;
+      sgdVec3 pivot;
+      const SGMaterial* material;
     };
 
     // compute the ground property of this leaf.