/*
   File:        hilldyn.h
   Author:      Andrew W. Moore
   Created:     Mon May 17 15:47:31 EDT 1993
   Description: Header for Dynamics constrained to surface of (N-1)d hill

   Copyright (C) 1992, Andrew W. Moore
*/

#define EARTH_GRAVITY 9.81

typedef struct hilldyn_struct
{
  int dim;  /* Dim of physical (position) space, excluding "height" dimension.
               For a puck sliding on a hilly two-d surface this number would
               be 2. But many operation will be seen to then be 3 dimensional.
               And of course the pucks formal state will be 4-d cos of its
               velocity.
            */
  float (*height_fn)();             /* ( float *x ,dim ,height_fn_data ) */
  void (*height_derivative_fn)();  /* (float *x ,dim ,h_fn_data ,float *xres)*/
                                          /* The arrays in these two functions
                                             are all dim-dimensional */
 
  char *height_fn_data;

  float friction; /* 0.0 = no friction, 
                     Extra force of -friction * velocity in (dim+1)space
                  */
  float g;        /* Gravity */
  float mass;
  float max_move_dist; /* Integration of position performed in small stages
                          designed to prevent accidental huge jumps greater
                          than this distance.
                       */
  float max_pos,max_vel;
} hilldyn;

extern void hilldyn_next_state();             /* (hd,xstate,f,h,xnext) */





