Go to the documentation of this file.
28 #ifndef __Ogre_Volume_CSGSource_H__
29 #define __Ogre_Volume_CSGSource_H__
64 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
68 virtual Real getValue(
const Vector3 &position)
const;
95 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
99 virtual Real getValue(
const Vector3 &position)
const;
127 if (dMin.
x >= (
Real)0.0 && dMin.
y >= (
Real)0.0 && dMin.
z >= (
Real)0.0 &&
130 const Real d[6] = {dMin.
x, dMin.
y, dMin.
z, dMax.
x, dMax.
y, dMax.
z};
132 for (
size_t i = 0; i < 6; ++i)
142 distance = -mBox.
distance(position);
159 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
163 virtual Real getValue(
const Vector3 &position)
const;
196 virtual const Source* getSourceA()
const;
202 virtual void setSourceA(
Source *a);
208 virtual const Source* getSourceB(
void)
const;
214 virtual void setSourceB(
Source *b);
237 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
241 virtual Real getValue(
const Vector3 &position)
const;
264 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
268 virtual Real getValue(
const Vector3 &position)
const;
292 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
296 virtual Real getValue(
const Vector3 &position)
const;
325 virtual const Source* getSource(
void)
const;
331 virtual void setSource(
Source *a);
352 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
356 virtual Real getValue(
const Vector3 &position)
const;
379 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
383 virtual Real getValue(
const Vector3 &position)
const;
420 for (
size_t i = 0; i < mNumOctaves; ++i)
422 toAdd += mNoise.
noise(position.
x * mFrequencies[i], position.
y * mFrequencies[i], position.
z * mFrequencies[i]) * mAmplitudes[i];
424 return mSrc->getValue(position) + toAdd;
457 virtual Vector4 getValueAndGradient(
const Vector3 &position)
const;
461 virtual Real getValue(
const Vector3 &position)
const;
467 long getSeed(
void)
const;
Real * mFrequencies
The frequencies of the octaves.
size_t mNumOctaves
The amount of octaves.
Builds the intersection between two sources.
Real distanceTo(const Vector3 &position) const
Gets the distance of a point to the nearest cube element.
const Vector3 & getMinimum(void) const
Gets the minimum corner of the box.
AxisAlignedBox mBox
The box.
Real mScale
Holds the dimensions of the volume.
const Source * mB
The second operant.
const Vector3 & getMaximum(void) const
Gets the maximum corner of the box.
Builds the union between two sources.
const Real mD
The distance to zero of the plane.
Source which does a unary operation to another one.
Real distance(const Vector3 &v) const
Returns the minimum distance between a given point and any part of the box.
A 3D box aligned with the x/y/z axes.
static const Real POS_INFINITY
const Source * mA
The first operant.
Abstract operation volume source holding two sources as operants.
Vector3 mNormal
The normal of the plane.
Negates the given volume.
Simplex Noise ported from public domain Java Implementation http://webstaff.itn.liu....
#define _OgreVolumeExport
Real getInternalValue(const Vector3 &position) const
4-dimensional homogeneous vector.
SimplexNoise mNoise
To make some noise.
Builds the difference between two sources.
Real noise(Real xIn, Real yIn, Real zIn) const
3D noise function.
long mSeed
The initial seed.
float Real
Software floating point type.
Real * mAmplitudes
The amplitudes of the octaves.
const Vector3 mCenter
The center.
const Source * mSrc
The first operant.
Standard 3-dimensional vector.
Abstract class defining the density function.
Real mGradientOff
To calculate the gradient.
Scales the given volume source.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.