WIP on fluid medium traversal

This commit is contained in:
Michaël Lemaire 2013-11-09 19:13:28 +01:00
parent 6835db2aca
commit 0edd90c477
6 changed files with 35 additions and 4 deletions

View file

@ -0,0 +1 @@
#include "FluidMediumInterface.h"

View file

@ -0,0 +1,27 @@
#ifndef FLUIDMEDIUMINTERFACE_H
#define FLUIDMEDIUMINTERFACE_H
#include "software_global.h"
namespace paysages {
namespace basics {
class SpaceCoordinate;
}
namespace software {
/*!
* \brief Interface to a fluid medium compatible class.
*/
class SOFTWARESHARED_EXPORT FluidMediumInterface
{
public:
/*!
* Return true if the object may interfere with the fluid medium on the given segment.
*/
virtual bool mayInfluence(const SpaceCoordinate& start, const SpaceCoordinate& end) const = 0;
};
}
}
#endif // FLUIDMEDIUMINTERFACE_H

View file

@ -24,10 +24,11 @@ class SOFTWARESHARED_EXPORT FluidMediumTraversal
{
public:
FluidMediumTraversal(SoftwareRenderer *renderer);
virtual ~FluidMediumTraversal();
void setCollector(FluidMediumCollector *collector);
virtual void getTraversedMedia(std::vector<FluidMediumInterface> &media);
virtual void getTraversedMedia(std::vector<FluidMediumInterface> &media, const SpaceCoordinates &start, const SpaceCoordinates &end);
void collectHalfLine(const SpaceCoordinates &start, const Vector3 &direction);
void collectSegment(const SpaceCoordinates &start, const SpaceCoordinates &end);

View file

@ -1,6 +1,6 @@
#include "SoftwareRenderer.h"
#include "global/FluidMediumTraversal.h"
#include "FluidMediumTraversal.h"
SoftwareRenderer::SoftwareRenderer(Scenery* scenery):
scenery(scenery)

View file

@ -14,11 +14,13 @@ DEFINES += SOFTWARE_LIBRARY
include(../../common.pri)
SOURCES += SoftwareRenderer.cpp \
global/FluidMediumTraversal.cpp
FluidMediumTraversal.cpp \
FluidMediumInterface.cpp
HEADERS += SoftwareRenderer.h\
software_global.h \
global/FluidMediumTraversal.h
FluidMediumTraversal.h \
FluidMediumInterface.h
unix:!symbian {
maemo5 {