|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CVegetable Class ReferenceA vegetable descriptor.
More...
#include <vegetable.h>
List of all members.
Density Angle Factor |
enum | TAngleType { AngleGround = 0,
AngleCeiling,
AngleWall
} |
void | setAngleGround (float cosAngleMin) |
| set an Angle setup such that max density is when normal== K, and 0 density is when normalAngle= cosAngleMin. More...
|
void | setAngleCeiling (float cosAngleMax) |
| set an Angle setup such that max density is when normal= -K, and 0 density is when normalAngle= cosAngleMax. More...
|
void | setAngleWall (float cosAngleMin, float cosAngleMax) |
| set an Angle setup such that max density is when normal is at (cosAngleMin+cosAngleMax)/2, and 0 density is when cosAngle= one of the cosAngleMin or cosAngleMax. More...
|
float | getCosAngleMin () const |
float | getCosAngleMax () const |
TAngleType | getAngleType () const |
Public Types |
enum | TVegetableWater { AboveWater = 0,
UnderWater,
IntersectWater,
VegetInfoLast
} |
| Micro vegetation position against Water. Above water is the default. More...
|
Public Methods |
| CVegetable () |
void | registerToManager (CVegetableManager *manager) |
| register the vegetable to the vegetable manager. More...
|
void | generateGroup (const CVector &posInWorld, const CVector &surfaceNormal, float area, uint vegetSeed, std::vector< CVector2f > &instances) const |
| generate a list of instance to create on a small ground element, according to density and noise. More...
|
void | generateGroupBiLinear (const CVector &posInWorld, const CVector posInWorldBorder[4], const CVector &surfaceNormal, float area, uint vegetSeed, std::vector< CVector2f > &instances) const |
void | reserveIgAddInstances (CVegetableInstanceGroupReserve &vegetIgReserve, TVegetableWater vegetWaterState, uint numInstances) const |
| Fast allocation reservation: you must call this before generating all your instances in an Ig: Add N instances of Vegetable to the reservation system. More...
|
void | generateInstance (CVegetableInstanceGroup *ig, const NLMISC::CMatrix &posInWorld, const NLMISC::CRGBAF &modulateAmbientColor, const NLMISC::CRGBAF &modulateDiffuseColor, float blendDistMax, TVegetableWater vegetWaterState, CVegetableUV8 dlmUV) const |
| posInWorld should be a matrix of position + rotation (typically for surface alignement). More...
|
void | serial (NLMISC::IStream &f) |
Public Attributes |
std::string | ShapeName |
| Name of the shape to use. More...
|
CNoiseValue | Density |
| Density== Number of instance to create / mē. More...
|
float | MaxDensity |
| the maximum density computed. if <0, no maximum. -1 by default. More...
|
CNoiseValue | Sxy |
| Random Scale. More...
|
CNoiseValue | Sz |
| Random Scale. More...
|
CNoiseValue | Rx |
| Random Orientation. More...
|
CNoiseValue | Ry |
| Random Orientation. More...
|
CNoiseValue | Rz |
| Random Orientation. More...
|
CNoiseValue | BendFactor |
| Random Bend factor. More...
|
CNoiseValue | BendPhase |
| Random Bend Phase. More...
|
float | BendFrequencyFactor |
| Fixed Bend FrequencyFactor. NB: rounded during addInstance to the nearest NL3D_VEGETABLE_FREQUENCY_FACTOR_PREC. More...
|
CNoiseColorGradient | Color |
| The color to modulate the instance. More...
|
uint32 | DistType |
| At which distance this vegetable will be rendered. More...
|
Private Methods |
void | generateGroupEx (float nbInst, const CVector &posInWorld, const CVector &surfaceNormal, uint vegetSeed, std::vector< CVector2f > &instances) const |
| Do the generateGroup, but take nbInst unmodulated by normal. More...
|
Static Private Methods |
float | easeInEaseOut (float x) |
Private Attributes |
float | _CosAngleMin |
| density is multiplied by a function f(cos angle with verticalVector), such that f(CosAngleMiddle)==1, and f(CosAngleMin)==f(CosAngleMax)== 0. More...
|
float | _CosAngleMax |
| density is multiplied by a function f(cos angle with verticalVector), such that f(CosAngleMiddle)==1, and f(CosAngleMin)==f(CosAngleMax)== 0. More...
|
float | _CosAngleMiddle |
| density is multiplied by a function f(cos angle with verticalVector), such that f(CosAngleMiddle)==1, and f(CosAngleMin)==f(CosAngleMax)== 0. More...
|
float | _OOCosAngleDist |
| density is multiplied by a function f(cos angle with verticalVector), such that f(CosAngleMiddle)==1, and f(CosAngleMin)==f(CosAngleMax)== 0. More...
|
TAngleType | _AngleType |
| angle type setuped with setAngleMin etc... More...
|
CVegetableManager * | _Manager |
| the manager. More...
|
CVegetableShape * | _VegetableShape |
| shape in the manager. More...
|
Detailed Description
A vegetable descriptor.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2001
Definition at line 54 of file vegetable.h.
Member Enumeration Documentation
enum NL3D::CVegetable::TAngleType
|
|
|
-
Enumeration values:
-
AngleGround |
|
AngleCeiling |
|
AngleWall |
|
Definition at line 90 of file vegetable.h.
Referenced by getAngleType. |
enum NL3D::CVegetable::TVegetableWater
|
|
|
Micro vegetation position against Water. Above water is the default.
-
Enumeration values:
-
AboveWater |
|
UnderWater |
|
IntersectWater |
|
VegetInfoLast |
|
Definition at line 58 of file vegetable.h. |
Constructor & Destructor Documentation
NL3D::CVegetable::CVegetable |
( |
|
) |
|
|
|
Definition at line 48 of file vegetable.cpp.
References _Manager, BendFactor, BendFrequencyFactor, DistType, MaxDensity, Rx, Ry, Rz, setAngleGround, Sxy, and Sz. |
Member Function Documentation
float NL3D::CVegetable::easeInEaseOut |
( |
float |
x |
) |
[inline, static, private] |
|
void NL3D::CVegetable::generateGroup |
( |
const CVector & |
posInWorld, |
|
|
const CVector & |
surfaceNormal, |
|
|
float |
area, |
|
|
uint |
vegetSeed, |
|
|
std::vector< CVector2f > & |
instances |
|
) |
const |
|
|
generate a list of instance to create on a small ground element, according to density and noise.
result is a list of instance to create, with random 2d position. 2d position are in range [0..1]. caller should scale, or use it to compute real world position, and then use generateInstance() to really compute the instances.
Warning! Use OptFastFloor()! So call must be enclosed with a OptFastFloorBegin()/OptFastFloorEnd(). -
Parameters:
-
posInWorld |
center (approx) of the surface which generate group of vegetable |
surfaceNormal |
UNIT up vector of the surface to compare with (0,0,1), to modulate density |
area |
area of the surface, to know number of elements to generate for this surface |
vegetSeed |
"random" value which Should be different for all vegetables in the same area. usefull if lot of different vegetable generated in same area: positions won't be generated at same place. |
instances |
the generated position of instances. |
Definition at line 176 of file vegetable.cpp.
References Density, generateGroupEx, MaxDensity, and min. |
void NL3D::CVegetable::generateGroupBiLinear |
( |
const CVector & |
posInWorld, |
|
|
const CVector |
posInWorldBorder[4], |
|
|
const CVector & |
surfaceNormal, |
|
|
float |
area, |
|
|
uint |
vegetSeed, |
|
|
std::vector< CVector2f > & |
instances |
|
) |
const |
|
void NL3D::CVegetable::generateGroupEx |
( |
float |
nbInst, |
|
|
const CVector & |
posInWorld, |
|
|
const CVector & |
surfaceNormal, |
|
|
uint |
vegetSeed, |
|
|
std::vector< CVector2f > & |
instances |
|
) |
const [private] |
|
|
posInWorld should be a matrix of position + rotation (typically for surface alignement).
FinalPos= posInWorld * noiseMatrix(scale/rot) FinalAmbientColor= vegetManager->Ambient * modulateAmbientColor * randomColor. FinalDiffuseColor= vegetManager->Diffuse * modulateDiffuseColor * randomColor. If instance is in AlphaBlend/ZSort, blendDistMax is the distance where the instance is invisible (alpha==0). instance is added to the manager, under the instance group ig. This one must have been generated by the VegetableManager. -
Parameters:
-
dlmUV |
is the dynamic lightmap UV for this vegetable. |
Definition at line 306 of file vegetable.cpp.
References _Manager, _VegetableShape, BendFactor, BendFrequencyFactor, BendPhase, Color, NLMISC::CMatrix::getPos, nlassert, Rx, Ry, Rz, Sxy, and Sz. |
TAngleType NL3D::CVegetable::getAngleType |
( |
|
) |
const [inline] |
|
float NL3D::CVegetable::getCosAngleMax |
( |
|
) |
const [inline] |
|
float NL3D::CVegetable::getCosAngleMin |
( |
|
) |
const [inline] |
|
|
Definition at line 367 of file vegetable.cpp.
References _AngleType, _CosAngleMax, _CosAngleMiddle, _CosAngleMin, _OOCosAngleDist, BendFactor, BendFrequencyFactor, BendPhase, Color, Density, DistType, MaxDensity, Rx, Ry, Rz, NLMISC::IStream::serial, NLMISC::IStream::serialEnum, NLMISC::IStream::serialVersion, ShapeName, Sxy, and Sz. |
void NL3D::CVegetable::setAngleCeiling |
( |
float |
cosAngleMax |
) |
|
|
void NL3D::CVegetable::setAngleGround |
( |
float |
cosAngleMin |
) |
|
|
void NL3D::CVegetable::setAngleWall |
( |
float |
cosAngleMin, |
|
|
float |
cosAngleMax |
|
) |
|
|
Member Data Documentation
float NL3D::CVegetable::_CosAngleMax [private]
|
|
float NL3D::CVegetable::_CosAngleMiddle [private]
|
|
float NL3D::CVegetable::_CosAngleMin [private]
|
|
float NL3D::CVegetable::_OOCosAngleDist [private]
|
|
float NL3D::CVegetable::BendFrequencyFactor
|
|
uint32 NL3D::CVegetable::DistType
|
|
float NL3D::CVegetable::MaxDensity
|
|
std::string NL3D::CVegetable::ShapeName
|
|
The documentation for this class was generated from the following files:
|
|