home *** CD-ROM | disk | FTP | other *** search
/ VRML Tools for 3D Cyberspace / VRML_Tools_For_3D_Cyberspace.iso / amber / include / position.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-01  |  2.1 KB  |  88 lines

  1. //**********************************************************************
  2. //  DIVE Laboratories, Inc.
  3. //  Copyright(c) 1995
  4. //  All rights reserved.
  5. //  FILE:   POSITION.HPP
  6. //
  7. //  DESCRIPTION
  8. //  This file provides the function prototypes for the 
  9. //  positionClass
  10. //
  11. //  Author: M. Doucet
  12. //
  13. //  Modification History:
  14. //  3/22/95    Created
  15. //
  16. //**********************************************************************
  17. #ifndef POSITION_HPP
  18. #define POSITION_HPP
  19.  
  20. #include "vrtypes.hpp"
  21.  
  22. class vectorClass;
  23. class quatClass;
  24.  
  25. class positionClass {
  26.  
  27. public:
  28.     
  29.     // Public Data (public access for speed)
  30.     V3       pos;     // Position
  31.  
  32.     // Position Assignment
  33.     void    set(V3 posIn);
  34.     void    set(Vres xPos=0.0, Vres yPos=0.0, Vres zPos=0.0);
  35.  
  36.     // Position Retrieval
  37.     void    get(V3 posOut);
  38.     void    get(Vres *xPos, Vres *yPos, Vres *zPos);
  39.  
  40.     // Translation
  41.     void    translate(vectorClass *v);
  42.     void    translate(Vres xDelta, Vres yDelta, Vres zDelta);
  43.  
  44.     // Vector Creation
  45.     void    subtract(positionClass *other, vectorClass *v);
  46.     void    subtract(positionClass other, vectorClass *v);
  47.  
  48.     // Rotation
  49.     void    rotate(int axis, Vres rads);
  50.     void    rotate(quatClass q);
  51.     void    rotate(vectorClass axis, Vres rads);
  52.     void    rotate(vectorClass *axis, Vres rads);
  53.  
  54.     // Debug
  55.     void      display(char *str="", int precision=4, int fore=8);
  56.  
  57.     // Access operator
  58.     Vres  operator[](int index);                                  
  59.  
  60.     // Scaling operators
  61.     void    operator*=(Vres scalar);
  62.     void    operator/=(Vres scalar);
  63.  
  64.     // Translation operators
  65.     void    operator+=(vectorClass v);     
  66.     void    operator-=(vectorClass v);     
  67.  
  68.     // Assignment operators
  69.     void    operator=(positionClass &other);     
  70.     void    operator=(positionClass *other);     
  71.  
  72.     // Equality operators
  73.     int     operator==(positionClass &other);     
  74.     int     operator==(positionClass *other);
  75.     int     operator!=(positionClass &other);     
  76.     int     operator!=(positionClass *other);
  77.  
  78.      // Constructors
  79.     positionClass(V3 posIn);
  80.     positionClass(Vres xPos=0.0, Vres yPos=0.0, Vres zPos=0.0);
  81.  
  82.     // Destructor
  83.     ~positionClass();
  84.  
  85. };
  86.  
  87. #endif
  88.