Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2004, 1:13:48 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/bezierTrack: just an idea of how the new Coordinate-System might look like. Many things have to be done here too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/bezierTrack/src/coordinates.h

    r3013 r3023  
    3434} Placement;
    3535
     36
     37///////////////////////////////////////////////////////////////////
     38////////  NEW COORDINATES, because the old ones were a bit fuzy  //
     39///////////////////////////////////////////////////////////////////
     40enum COORD_TYPE {WORLD, TRACK, LOCAL};
     41
     42typedef struct
     43{
     44  Vector position;
     45  Quaternion rotation;
     46} Coord;
     47
     48class Coordinate
     49{
     50 private:
     51  Coord worldCoord;
     52
     53 public:
     54
     55  void setCoord (Coord coordinate, COORD_TYPE cType);
     56  void setPosition (Vector position, COORD_TYPE cType);
     57  void setRotation (Quaternion rotation, COORD_TYPE cType);
     58
     59  Coord getCoord (COORD_TYPE cType) const;
     60  Vector getPosition (COORD_TYPE cType) const;
     61  Quaternion getRotation (COORD_TYPE cType) const;
     62};
     63
     64
     65
     66
     67
     68//! World coordinates:
     69/**
     70   Absolute coordinates in 3D-space are defined as the coordinates, an Entity has in respect to the absolute Zero point
     71*/
     72typedef struct
     73{
     74  Vector position;  //!< absolute position of the Object (the one opengl has to know)
     75  Quaternion rot;   //!< absolute rotation
     76} WorldCoord;
     77
     78typedef struct
     79{
     80  Vector position;  //!< The Vector from the current Path-Position to the Entity. (worldCoord->position - track->worldCoord->position)
     81  Quaternion rot;   //!< rotation an entity has to the track.
     82} TrackCoord;
     83
     84typedef struct
     85{
     86  Vector position;  //!< the coordinate to the object itself. This shoud be 0 for an entity. (can be used for explosions on the ship, shoot and so on.)
     87  Quaternion rot;   //!< the Rotation of an object itself. (to easily shoot in different directions)
     88} LocalCoord;
     89
    3690#endif
Note: See TracChangeset for help on using the changeset viewer.