RigsofRods
Soft-body Physics Simulation
Data Structures | Public Member Functions | Private Member Functions | Private Attributes
SkyX::VClouds::GeometryBlock Class Reference

#include <GeometryBlock.h>

+ Collaboration diagram for SkyX::VClouds::GeometryBlock:

Data Structures

struct  VERTEX
 Vertex struct. More...
 

Public Member Functions

 GeometryBlock (VClouds *vc, const float &Height, const Ogre::Radian &Alpha, const Ogre::Radian &Beta, const float &Radius, const Ogre::Radian &Phi, const int &Na, const int &Nb, const int &Nc, const int &A, const int &B, const int &C, const int &Position)
 Constructor. More...
 
 ~GeometryBlock ()
 Destructor. More...
 
void create ()
 Create. More...
 
void remove ()
 Remove. More...
 
void updateGeometry (Ogre::Camera *c, const Ogre::Vector3 &displacement, const Ogre::Vector3 &distance)
 Update geometry. More...
 
const bool & isCreated () const
 Has been create() already called? More...
 
Ogre::MeshPtr getMesh ()
 Get mesh. More...
 
Ogre::SubMesh * getSubMesh ()
 Get sub mesh. More...
 
Ogre::Entity * getEntity ()
 Get entity. More...
 
Ogre::HardwareVertexBufferSharedPtr & getHardwareVertexBuffer ()
 Get hardware vertex buffer reference. More...
 
Ogre::HardwareIndexBufferSharedPtr & getHardwareIndexBuffer ()
 Get hardware index buffer reference. More...
 
void setWorldOffset (const Ogre::Vector2 &WorldOffset)
 Set world offset. More...
 
const bool isInFrustum (Ogre::Camera *c) const
 Is the geometry block inside the camera frustum? More...
 

Private Member Functions

const Ogre::AxisAlignedBox _buildAABox (const float &fd) const
 Build axis aligned box. More...
 
void _calculateDataSize ()
 Calculate data size. More...
 
void _createGeometry ()
 Create geometry. More...
 
void _updateGeometry ()
 Update geometry. More...
 
void _updateZoneCSlice (const int &n)
 Update zone C slice. More...
 
void _updateZoneBSlice (const int &n)
 Update zone B slice. More...
 
void _updateZoneASlice (const int &n)
 Update zone A slice. More...
 
void _setVertexData (const int &index, const Ogre::Vector3 &p, const float &o)
 Set vertex data. More...
 

Private Attributes

bool mCreated
 Has been create() already called? More...
 
Ogre::MeshPtr mMesh
 Ogre::MeshPtr. More...
 
Ogre::SubMesh * mSubMesh
 Ogre::Submesh pointer. More...
 
Ogre::Entity * mEntity
 Ogre::Entity pointer. More...
 
Ogre::HardwareVertexBufferSharedPtr mVertexBuffer
 Vertex buffer. More...
 
Ogre::HardwareIndexBufferSharedPtr mIndexBuffer
 Index buffer. More...
 
VERTEXmVertices
 Vertices pointer. More...
 
int mNumberOfTriangles
 Current number of triangles. More...
 
int mVertexCount
 Vertex count. More...
 
float mHeight
 Height. More...
 
Ogre::Radian mAlpha
 Angles. More...
 
Ogre::Radian mBeta
 
float mRadius
 Radius. More...
 
Ogre::Radian mPhi
 Acimutal angle. More...
 
int mNa
 Number of slices per geometry zone. More...
 
int mNb
 
int mNc
 
float mA
 A, B and C radius. More...
 
float mB
 
float mC
 
int mPosition
 Number of block(Position) More...
 
Ogre::Vector2 mV2Cos
 Precomputed Cos/Sin vectors. More...
 
Ogre::Vector2 mV2Sin
 
float mBetaSin
 PI - Beta, PI - Alpha Sin. More...
 
float mAlphaSin
 
Ogre::Vector3 mDisplacement
 Displacement. More...
 
Ogre::Vector2 mWorldOffset
 World coords offset. More...
 
VCloudsmVClouds
 VClouds pointer. More...
 
Ogre::Camera * mCamera
 Current rendering camera. More...
 
Ogre::Vector3 mDistance
 Current distance. More...
 
float mLastFallingDistance
 Last falling distance. More...
 

Detailed Description

Definition at line 33 of file GeometryBlock.h.

Constructor & Destructor Documentation

◆ GeometryBlock()

SkyX::VClouds::GeometryBlock::GeometryBlock ( VClouds vc,
const float &  Height,
const Ogre::Radian &  Alpha,
const Ogre::Radian &  Beta,
const float &  Radius,
const Ogre::Radian &  Phi,
const int &  Na,
const int &  Nb,
const int &  Nc,
const int &  A,
const int &  B,
const int &  C,
const int &  Position 
)

Constructor.

Parameters
vcVClouds pointer
HeightField height (in woorld coordinates)
AlphaAlpha angle
BetaBeta angle
RadiusTotal radius
PhiActimutal angle
NaNumber of slices in A zone
NbNumber of slices in B zone
NcNumber of slices in C zone
AA radius
BB radius
CC radius

Definition at line 30 of file GeometryBlock.cpp.

+ Here is the call graph for this function:

◆ ~GeometryBlock()

SkyX::VClouds::GeometryBlock::~GeometryBlock ( )

Destructor.

Definition at line 59 of file GeometryBlock.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _buildAABox()

const Ogre::AxisAlignedBox SkyX::VClouds::GeometryBlock::_buildAABox ( const float &  fd) const
private

Build axis aligned box.

Parameters
fdFalling distance (Positive values for falling geometry, negative for reverse falling geometry)

Definition at line 117 of file GeometryBlock.cpp.

+ Here is the caller graph for this function:

◆ _calculateDataSize()

void SkyX::VClouds::GeometryBlock::_calculateDataSize ( )
private

Calculate data size.

Definition at line 133 of file GeometryBlock.cpp.

+ Here is the caller graph for this function:

◆ _createGeometry()

void SkyX::VClouds::GeometryBlock::_createGeometry ( )
private

Create geometry.

Definition at line 145 of file GeometryBlock.cpp.

+ Here is the caller graph for this function:

◆ _setVertexData()

void SkyX::VClouds::GeometryBlock::_setVertexData ( const int &  index,
const Ogre::Vector3 &  p,
const float &  o 
)
private

Set vertex data.

Parameters
indexVertex index
oSlice opacity
pPosition

Definition at line 489 of file GeometryBlock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateGeometry()

void SkyX::VClouds::GeometryBlock::_updateGeometry ( )
private

Update geometry.

Definition at line 323 of file GeometryBlock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateZoneASlice()

void SkyX::VClouds::GeometryBlock::_updateZoneASlice ( const int &  n)
private

Update zone A slice.

Parameters
nNumber of slice

Definition at line 448 of file GeometryBlock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateZoneBSlice()

void SkyX::VClouds::GeometryBlock::_updateZoneBSlice ( const int &  n)
private

Update zone B slice.

Parameters
nNumber of slice

Definition at line 394 of file GeometryBlock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateZoneCSlice()

void SkyX::VClouds::GeometryBlock::_updateZoneCSlice ( const int &  n)
private

Update zone C slice.

Parameters
nNumber of slice

Definition at line 351 of file GeometryBlock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

void SkyX::VClouds::GeometryBlock::create ( )

Create.

Definition at line 64 of file GeometryBlock.cpp.

+ Here is the call graph for this function:

◆ getEntity()

Ogre::Entity* SkyX::VClouds::GeometryBlock::getEntity ( )
inline

Get entity.

Returns
Entity

Definition at line 115 of file GeometryBlock.h.

◆ getHardwareIndexBuffer()

Ogre::HardwareIndexBufferSharedPtr& SkyX::VClouds::GeometryBlock::getHardwareIndexBuffer ( )
inline

Get hardware index buffer reference.

Returns
Ogre::HardwareIndexBufferSharedPtr reference

Definition at line 131 of file GeometryBlock.h.

◆ getHardwareVertexBuffer()

Ogre::HardwareVertexBufferSharedPtr& SkyX::VClouds::GeometryBlock::getHardwareVertexBuffer ( )
inline

Get hardware vertex buffer reference.

Returns
Ogre::HardwareVertexBufferSharedPtr reference

Definition at line 123 of file GeometryBlock.h.

◆ getMesh()

Ogre::MeshPtr SkyX::VClouds::GeometryBlock::getMesh ( )
inline

Get mesh.

Returns
Mesh

Definition at line 99 of file GeometryBlock.h.

◆ getSubMesh()

Ogre::SubMesh* SkyX::VClouds::GeometryBlock::getSubMesh ( )
inline

Get sub mesh.

Returns
Sub mesh

Definition at line 107 of file GeometryBlock.h.

◆ isCreated()

const bool& SkyX::VClouds::GeometryBlock::isCreated ( ) const
inline

Has been create() already called?

Returns
true if created() have been already called, false if not

Definition at line 91 of file GeometryBlock.h.

◆ isInFrustum()

const bool SkyX::VClouds::GeometryBlock::isInFrustum ( Ogre::Camera *  c) const

Is the geometry block inside the camera frustum?

Parameters
cCamera
Returns
true if yes, false if not

Definition at line 554 of file GeometryBlock.cpp.

+ Here is the caller graph for this function:

◆ remove()

void SkyX::VClouds::GeometryBlock::remove ( )

Remove.

Definition at line 96 of file GeometryBlock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWorldOffset()

void SkyX::VClouds::GeometryBlock::setWorldOffset ( const Ogre::Vector2 &  WorldOffset)
inline

Set world offset.

Parameters
WorldOffsetWorld offset

Definition at line 139 of file GeometryBlock.h.

◆ updateGeometry()

void SkyX::VClouds::GeometryBlock::updateGeometry ( Ogre::Camera *  c,
const Ogre::Vector3 &  displacement,
const Ogre::Vector3 &  distance 
)

Update geometry.

Parameters
cCamera
displacementCurrent offset in world units per zone
distanceCurrent camera to cloud field distance

Definition at line 280 of file GeometryBlock.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ mA

float SkyX::VClouds::GeometryBlock::mA
private

A, B and C radius.

Definition at line 224 of file GeometryBlock.h.

◆ mAlpha

Ogre::Radian SkyX::VClouds::GeometryBlock::mAlpha
private

Angles.

Definition at line 216 of file GeometryBlock.h.

◆ mAlphaSin

float SkyX::VClouds::GeometryBlock::mAlphaSin
private

Definition at line 233 of file GeometryBlock.h.

◆ mB

float SkyX::VClouds::GeometryBlock::mB
private

Definition at line 224 of file GeometryBlock.h.

◆ mBeta

Ogre::Radian SkyX::VClouds::GeometryBlock::mBeta
private

Definition at line 216 of file GeometryBlock.h.

◆ mBetaSin

float SkyX::VClouds::GeometryBlock::mBetaSin
private

PI - Beta, PI - Alpha Sin.

Definition at line 232 of file GeometryBlock.h.

◆ mC

float SkyX::VClouds::GeometryBlock::mC
private

Definition at line 224 of file GeometryBlock.h.

◆ mCamera

Ogre::Camera* SkyX::VClouds::GeometryBlock::mCamera
private

Current rendering camera.

Definition at line 243 of file GeometryBlock.h.

◆ mCreated

bool SkyX::VClouds::GeometryBlock::mCreated
private

Has been create() already called?

Definition at line 191 of file GeometryBlock.h.

◆ mDisplacement

Ogre::Vector3 SkyX::VClouds::GeometryBlock::mDisplacement
private

Displacement.

Definition at line 236 of file GeometryBlock.h.

◆ mDistance

Ogre::Vector3 SkyX::VClouds::GeometryBlock::mDistance
private

Current distance.

Definition at line 246 of file GeometryBlock.h.

◆ mEntity

Ogre::Entity* SkyX::VClouds::GeometryBlock::mEntity
private

Ogre::Entity pointer.

Definition at line 198 of file GeometryBlock.h.

◆ mHeight

float SkyX::VClouds::GeometryBlock::mHeight
private

Height.

Definition at line 214 of file GeometryBlock.h.

◆ mIndexBuffer

Ogre::HardwareIndexBufferSharedPtr SkyX::VClouds::GeometryBlock::mIndexBuffer
private

Index buffer.

Definition at line 203 of file GeometryBlock.h.

◆ mLastFallingDistance

float SkyX::VClouds::GeometryBlock::mLastFallingDistance
private

Last falling distance.

Definition at line 249 of file GeometryBlock.h.

◆ mMesh

Ogre::MeshPtr SkyX::VClouds::GeometryBlock::mMesh
private

Ogre::MeshPtr.

Definition at line 194 of file GeometryBlock.h.

◆ mNa

int SkyX::VClouds::GeometryBlock::mNa
private

Number of slices per geometry zone.

Definition at line 222 of file GeometryBlock.h.

◆ mNb

int SkyX::VClouds::GeometryBlock::mNb
private

Definition at line 222 of file GeometryBlock.h.

◆ mNc

int SkyX::VClouds::GeometryBlock::mNc
private

Definition at line 222 of file GeometryBlock.h.

◆ mNumberOfTriangles

int SkyX::VClouds::GeometryBlock::mNumberOfTriangles
private

Current number of triangles.

Definition at line 209 of file GeometryBlock.h.

◆ mPhi

Ogre::Radian SkyX::VClouds::GeometryBlock::mPhi
private

Acimutal angle.

Definition at line 220 of file GeometryBlock.h.

◆ mPosition

int SkyX::VClouds::GeometryBlock::mPosition
private

Number of block(Position)

Definition at line 226 of file GeometryBlock.h.

◆ mRadius

float SkyX::VClouds::GeometryBlock::mRadius
private

Radius.

Definition at line 218 of file GeometryBlock.h.

◆ mSubMesh

Ogre::SubMesh* SkyX::VClouds::GeometryBlock::mSubMesh
private

Ogre::Submesh pointer.

Definition at line 196 of file GeometryBlock.h.

◆ mV2Cos

Ogre::Vector2 SkyX::VClouds::GeometryBlock::mV2Cos
private

Precomputed Cos/Sin vectors.

Definition at line 229 of file GeometryBlock.h.

◆ mV2Sin

Ogre::Vector2 SkyX::VClouds::GeometryBlock::mV2Sin
private

Definition at line 230 of file GeometryBlock.h.

◆ mVClouds

VClouds* SkyX::VClouds::GeometryBlock::mVClouds
private

VClouds pointer.

Definition at line 241 of file GeometryBlock.h.

◆ mVertexBuffer

Ogre::HardwareVertexBufferSharedPtr SkyX::VClouds::GeometryBlock::mVertexBuffer
private

Vertex buffer.

Definition at line 201 of file GeometryBlock.h.

◆ mVertexCount

int SkyX::VClouds::GeometryBlock::mVertexCount
private

Vertex count.

Definition at line 211 of file GeometryBlock.h.

◆ mVertices

VERTEX* SkyX::VClouds::GeometryBlock::mVertices
private

Vertices pointer.

Definition at line 206 of file GeometryBlock.h.

◆ mWorldOffset

Ogre::Vector2 SkyX::VClouds::GeometryBlock::mWorldOffset
private

World coords offset.

Definition at line 238 of file GeometryBlock.h.


The documentation for this class was generated from the following files: