28 #ifndef __Ogre_Volume_GridSource_H__
29 #define __Ogre_Volume_GridSource_H__
78 virtual Vector3 getIntersectionStart(
const Ray &ray,
Real maxDistance)
const;
82 virtual Vector3 getIntersectionEnd(
const Ray &ray,
Real maxDistance)
const;
94 virtual float getVolumeGridValue(
size_t x,
size_t y,
size_t z)
const = 0;
106 virtual void setVolumeGridValue(
int x,
int y,
int z,
float value) = 0;
122 (getVolumeGridValue(x + 1, y - 1, z) - getVolumeGridValue(x - 1, y - 1, z))
123 + (
Real)2.0 * (getVolumeGridValue(x + 1, y, z) - getVolumeGridValue(x - 1, y, z))
124 + (getVolumeGridValue(x + 1, y + 1, z) - getVolumeGridValue(x - 1, y + 1, z)),
125 (getVolumeGridValue(x, y + 1, z - 1) - getVolumeGridValue(x, y - 1, z - 1))
126 + (
Real)2.0 * (getVolumeGridValue(x, y + 1, z) - getVolumeGridValue(x, y - 1, z))
127 + (getVolumeGridValue(x, y + 1, z + 1) - getVolumeGridValue(x, y - 1, z + 1)),
128 (getVolumeGridValue(x - 1, y, z + 1) - getVolumeGridValue(x - 1, y, z - 1))
129 + (
Real)2.0 * (getVolumeGridValue(x, y, z + 1) - getVolumeGridValue(x, y, z - 1))
130 + (getVolumeGridValue(x + 1, y, z + 1) - getVolumeGridValue(x + 1, y, z - 1))) / (
Real)4.0;
134 getVolumeGridValue(x + 1, y, z) - getVolumeGridValue(x - 1, y, z),
135 getVolumeGridValue(x, y + 1, z) - getVolumeGridValue(x, y - 1, z),
136 getVolumeGridValue(x, y, z + 1) - getVolumeGridValue(x, y, z - 1));
141 GridSource(
bool trilinearValue,
bool trilinearGradient,
bool sobelGradient);
149 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
153 virtual Real getValue(
const Vector3 &position)
const;
159 size_t getWidth(
void)
const;
165 size_t getHeight(
void)
const;
171 size_t getDepth(
void)
const;
192 Real getVolumeSpaceToWorldSpaceFactor(
void)
const;
Real mPosYScale
The scale of the position based on the world height.
4-dimensional homogeneous vector.
float Real
Software floating point type.
bool mTrilinearValue
Whether to use trilinear filtering or not for the value.
A volume source from a discrete 3d grid.
Standard 3-dimensional vector.
size_t mHeight
The texture height.
const Vector3 getGradient(size_t x, size_t y, size_t z) const
Gets a gradient of a point with optional sobel blurring.
Real mPosXScale
The scale of the position based on the world width.
Real mPosZScale
The scale of the position based on the world depth.
const bool mSobelGradient
Whether to blur the gradient a bit Sobel like.
size_t mDepth
The texture depth.
size_t mWidth
The texture width.
Real mVolumeSpaceToWorldSpaceFactor
Factor to come from volume coordinate to world coordinate.
Abstract class defining the density function.
const bool mTrilinearGradient
Whether to use trilinear filtering or not for the gradient.
#define _OgreVolumeExport
Representation of a ray in space, i.e.
Abstract operation volume source holding two sources as operants.