#include <ped_obstacle.h>
List of all members.
Public Member Functions |
| | Tobstacle () |
| | Tobstacle (double ax, double ay, double bx, double by) |
| virtual void | setPosition (double ax, double ay, double bx, double by) |
| virtual Tvector | obstacleforce (double p1, double p2) |
| virtual void | rotate (double x, double y, double phi) |
|
void | setType (int t) |
|
int | getid () |
|
int | gettype () |
|
double | getax () |
|
double | getay () |
|
double | getbx () |
|
double | getby () |
Detailed Description
Class that defines a Tobstacle object. An obstacle is, for now, always a wall with start and end coordinate.
- Author:
- chgloor
- Date:
- 2012-01-17
- Examples:
-
example.cpp.
Constructor & Destructor Documentation
| Ped::Tobstacle::Tobstacle |
( |
| ) |
|
Default constructor, places a wall from 0/0 to 1/1
- Date:
- 2012-01-07
| Ped::Tobstacle::Tobstacle |
( |
double |
pax, |
|
|
double |
pay, |
|
|
double |
pbx, |
|
|
double |
pby |
|
) |
| |
Constructor used to set intial values.
- Date:
- 2012-01-07
- Parameters:
-
| pax | x coordinate of the first corner of the obstacle. |
| pay | y coordinate of the first corner of the obstacle. |
| pbx | x coordinate of the second corner of the obstacle. |
| pby | y coordinate of the second corner of the obstacle. |
Member Function Documentation
| Ped::Tvector Ped::Tobstacle::obstacleforce |
( |
double |
x, |
|
|
double |
y |
|
) |
| [virtual] |
Calculates and returns the forces of the obstacle to a given point x/y. x/y can be the location of an agent, but it can also be anything else, for example a grid coordinate of the user interface, if you want to display the obstacle forces on the map.
- Date:
- 2012-01-17
- Returns:
- Tvector forces
- Parameters:
-
| double | x: The x coordinate of the point |
| double | y: The y coordinate of the point |
| void Ped::Tobstacle::rotate |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
phi |
|
) |
| [virtual] |
rot phi around x/y
- Author:
- chgloor
- Date:
- 2012-01-20
- Warning:
- Due to rounding errors, this will fail after a while.
- Todo:
- Use the original points (saved) and cache the total phi or something.
- Parameters:
-
| x | The x coordinate of the point the obstacle will be rotated around. |
| y | The y coordinate of the point the obstacle will be rotated around. |
| r | The angle the obstacle will be rotated, where phi is given in radians |
| void Ped::Tobstacle::setPosition |
( |
double |
pax, |
|
|
double |
pay, |
|
|
double |
pbx, |
|
|
double |
pby |
|
) |
| [virtual] |
Moves the obstacle to a new position. Can be uses to simulate opening doors etc.
- Date:
- 2012-01-07
- Parameters:
-
| pax | x coordinate of the first corner of the obstacle. |
| pay | y coordinate of the first corner of the obstacle. |
| pbx | x coordinate of the second corner of the obstacle. |
| pby | y coordinate of the second corner of the obstacle. |
The documentation for this class was generated from the following files: