INET Framework for OMNeT++/OMNEST
inet::physicalenvironment::FlatGround Class Reference

#include <FlatGround.h>

Inheritance diagram for inet::physicalenvironment::FlatGround:
inet::physicalenvironment::IGround

Public Member Functions

virtual Coord computeGroundProjection (const Coord &position) const override
 Returns a point on the ground "underneath" (or above) the given position. More...
 
virtual Coord computeGroundNormal (const Coord &position) const override
 Returns a unit length vector that is locally perpendicular to the ground at "position", pointing up. More...
 

Protected Member Functions

virtual void initialize (int stage) override
 

Protected Attributes

double elevation = NaN
 

Member Function Documentation

◆ computeGroundNormal()

Coord inet::physicalenvironment::FlatGround::computeGroundNormal ( const Coord position) const
overridevirtual

Returns a unit length vector that is locally perpendicular to the ground at "position", pointing up.

If such vector cannot be determined, all components of the result are NaN. The point given by "position" does not have to be on the ground. If necessary, it is first projected to the ground internally by the implementation.

Implements inet::physicalenvironment::IGround.

28 {
29  return Coord(0, 0, 1);
30 }

◆ computeGroundProjection()

Coord inet::physicalenvironment::FlatGround::computeGroundProjection ( const Coord position) const
overridevirtual

Returns a point on the ground "underneath" (or above) the given position.

The projection might alter only the Z coordinate in simple cases, or it might alter all coordinates in case of a large scene on a globe model, or a scene placed at an angle above the ground (using a IGeographicCoordinateSystem).

Implements inet::physicalenvironment::IGround.

23 {
24  return Coord(position.x, position.y, elevation);
25 }

◆ initialize()

void inet::physicalenvironment::FlatGround::initialize ( int  stage)
overrideprotectedvirtual
17 {
18  if (stage == INITSTAGE_LOCAL)
19  elevation = par("elevation");
20 }

Member Data Documentation

◆ elevation

double inet::physicalenvironment::FlatGround::elevation = NaN
protected

The documentation for this class was generated from the following files:
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::physicalenvironment::FlatGround::elevation
double elevation
Definition: FlatGround.h:20