O --- O
libpedsim Documentation [HOME] [EXAMPLES] [DEMO APP] [DOCUMENTATION] [DOWNLOAD]
|
O --- O
|

Ped::Tobstacle Class Reference

#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:
paxx coordinate of the first corner of the obstacle.
payy coordinate of the first corner of the obstacle.
pbxx coordinate of the second corner of the obstacle.
pbyy 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:
doublex: The x coordinate of the point
doubley: 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:
xThe x coordinate of the point the obstacle will be rotated around.
yThe y coordinate of the point the obstacle will be rotated around.
rThe 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:
paxx coordinate of the first corner of the obstacle.
payy coordinate of the first corner of the obstacle.
pbxx coordinate of the second corner of the obstacle.
pbyy coordinate of the second corner of the obstacle.

The documentation for this class was generated from the following files:
O --- O




(c) 1995-2012 by Christian Gloor [contact]