WIP on fluid medium traversal
This commit is contained in:
parent
6835db2aca
commit
0edd90c477
6 changed files with 35 additions and 4 deletions
1
src/render/software/FluidMediumInterface.cpp
Normal file
1
src/render/software/FluidMediumInterface.cpp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#include "FluidMediumInterface.h"
|
27
src/render/software/FluidMediumInterface.h
Normal file
27
src/render/software/FluidMediumInterface.h
Normal 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
|
|
@ -24,10 +24,11 @@ class SOFTWARESHARED_EXPORT FluidMediumTraversal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FluidMediumTraversal(SoftwareRenderer *renderer);
|
FluidMediumTraversal(SoftwareRenderer *renderer);
|
||||||
|
virtual ~FluidMediumTraversal();
|
||||||
|
|
||||||
void setCollector(FluidMediumCollector *collector);
|
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 collectHalfLine(const SpaceCoordinates &start, const Vector3 &direction);
|
||||||
void collectSegment(const SpaceCoordinates &start, const SpaceCoordinates &end);
|
void collectSegment(const SpaceCoordinates &start, const SpaceCoordinates &end);
|
|
@ -1,6 +1,6 @@
|
||||||
#include "SoftwareRenderer.h"
|
#include "SoftwareRenderer.h"
|
||||||
|
|
||||||
#include "global/FluidMediumTraversal.h"
|
#include "FluidMediumTraversal.h"
|
||||||
|
|
||||||
SoftwareRenderer::SoftwareRenderer(Scenery* scenery):
|
SoftwareRenderer::SoftwareRenderer(Scenery* scenery):
|
||||||
scenery(scenery)
|
scenery(scenery)
|
||||||
|
|
|
@ -14,11 +14,13 @@ DEFINES += SOFTWARE_LIBRARY
|
||||||
include(../../common.pri)
|
include(../../common.pri)
|
||||||
|
|
||||||
SOURCES += SoftwareRenderer.cpp \
|
SOURCES += SoftwareRenderer.cpp \
|
||||||
global/FluidMediumTraversal.cpp
|
FluidMediumTraversal.cpp \
|
||||||
|
FluidMediumInterface.cpp
|
||||||
|
|
||||||
HEADERS += SoftwareRenderer.h\
|
HEADERS += SoftwareRenderer.h\
|
||||||
software_global.h \
|
software_global.h \
|
||||||
global/FluidMediumTraversal.h
|
FluidMediumTraversal.h \
|
||||||
|
FluidMediumInterface.h
|
||||||
|
|
||||||
unix:!symbian {
|
unix:!symbian {
|
||||||
maemo5 {
|
maemo5 {
|
||||||
|
|
Loading…
Reference in a new issue