OMK::Vis::MaterialSetTransparency Class Reference

Action to change this instance transparency. More...

#include <OMKEntityMaterialAction.h>

Inheritance diagram for OMK::Vis::MaterialSetTransparency:

Inheritance graph
[legend]
Collaboration diagram for OMK::Vis::MaterialSetTransparency:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MaterialSetTransparency (Ogre::Real transparency)
 The contructor stores the argument.
virtual ~MaterialSetTransparency ()
 Destructor.

Protected Attributes

Ogre::Real _transparency
 The argument.

Private Member Functions

virtual bool entityAction (EntityMaterial *entity) const
 The action update the entity.
virtual void passAction (SubEntityMaterial *subEntity, Ogre::Pass *passDest, Ogre::Pass *passSrc) const
 The action for each pass of each technique.

Detailed Description

Action to change this instance transparency.

Parameters:
transparency The new transparency. Values will be clamped to [0.0f..1.0f].
Note:
This changes transparency. A value of 0 means full opacity, while 1 means full transparency (invisible)

If transparency equals 0, it will use the original material instead of the copy (the copy is mandatory transparent, and thus might be slower than the original).

Definition at line 73 of file OMKEntityMaterialAction.h.


Constructor & Destructor Documentation

MaterialSetTransparency::MaterialSetTransparency ( Ogre::Real  transparency  ) 

The contructor stores the argument.

Definition at line 46 of file OMKEntityMaterialAction.cpp.

00047 : IMaterialPassAction(), 
00048 _transparency( transparency < 0.0f ? 0.0 : ( 1.0f < transparency ? 1.0f : transparency ) ) 
00049 {
00050 }

virtual OMK::Vis::MaterialSetTransparency::~MaterialSetTransparency (  )  [inline, virtual]

Destructor.

Definition at line 79 of file OMKEntityMaterialAction.h.

00079 {}


Member Function Documentation

bool MaterialSetTransparency::entityAction ( EntityMaterial entity  )  const [private, virtual]

The action update the entity.

Reimplemented from OMK::Vis::IMaterialAction.

Definition at line 52 of file OMKEntityMaterialAction.cpp.

References _transparency, and OMK::Vis::EntityMaterial::getOgreEntity().

00053 {
00054   entity->getOgreEntity()->setVisible( 1.0f != _transparency ) ;
00055   return true ;
00056 }

virtual void OMK::Vis::MaterialSetTransparency::passAction ( SubEntityMaterial subEntity,
Ogre::Pass *  passDest,
Ogre::Pass *  passSrc 
) const [private, virtual]

The action for each pass of each technique.

Implements OMK::Vis::IMaterialPassAction.


Member Data Documentation

Ogre::Real OMK::Vis::MaterialSetTransparency::_transparency [protected]

The argument.

It is given to the function.

Definition at line 83 of file OMKEntityMaterialAction.h.

Referenced by entityAction().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:05 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007