28#ifndef __Ogre_Volume_GridSource_H__
29#define __Ogre_Volume_GridSource_H__
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));
#define _OgreVolumeExport
Representation of a ray in space, i.e.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Standard 3-dimensional vector.
4-dimensional homogeneous vector.
Abstract operation volume source holding two sources as operants.
A volume source from a discrete 3d grid.
Real mPosYScale
The scale of the position based on the world height.
GridSource(bool trilinearValue, bool trilinearGradient, bool sobelGradient)
virtual Vector3 getIntersectionStart(const Ray &ray, Real maxDistance) const
Overridden from VolumeSource.
size_t mWidth
The texture width.
virtual float getVolumeGridValue(size_t x, size_t y, size_t z) const =0
Gets the volume value of a position.
size_t getDepth(void) const
Gets the depth of the texture.
bool mTrilinearValue
Whether to use trilinear filtering or not for the value.
const Vector3 getGradient(size_t x, size_t y, size_t z) const
Gets a gradient of a point with optional sobel blurring.
size_t mHeight
The texture height.
virtual Real getValue(const Vector3 &position) const
Overridden from VolumeSource.
const bool mSobelGradient
Whether to blur the gradient a bit Sobel like.
Real mPosZScale
The scale of the position based on the world depth.
size_t mDepth
The texture depth.
virtual Vector3 getIntersectionEnd(const Ray &ray, Real maxDistance) const
Overridden from VolumeSource.
Real mVolumeSpaceToWorldSpaceFactor
Factor to come from volume coordinate to world coordinate.
virtual ~GridSource(void)
Destructor.
Real mPosXScale
The scale of the position based on the world width.
size_t getHeight(void) const
Gets the height of the texture.
size_t getWidth(void) const
Gets the width of the texture.
virtual Vector4 getValueAndGradient(const Vector3 &position) const
Overridden from VolumeSource.
virtual void combineWithSource(CSGOperationSource *operation, Source *source, const Vector3 ¢er, Real radius)
Updates this grid with another source in a certain area.
Real getVolumeSpaceToWorldSpaceFactor(void) const
Overridden from VolumeSource.
virtual void setVolumeGridValue(int x, int y, int z, float value)=0
Sets the volume value of a position.
const bool mTrilinearGradient
Whether to use trilinear filtering or not for the gradient.
Abstract class defining the density function.
float Real
Software floating point type.