28 #ifndef __Renderable_H__
29 #define __Renderable_H__
73 Renderable() : mPolygonModeOverrideable(true), mUseIdentityProjection(false), mUseIdentityView(false), mRenderSystemData(NULL) {}
77 if (mRenderSystemData)
79 delete mRenderSystemData;
80 mRenderSystemData = NULL;
88 virtual const MaterialPtr& getMaterial(
void)
const = 0;
124 { (void)sm; (void)rsys;
return true; }
129 { (void)sm; (void)rsys; }
143 virtual void getWorldTransforms(
Matrix4* xform)
const = 0;
166 mUseIdentityProjection = useIdentityProjection;
191 mUseIdentityView = useIdentityView;
210 virtual Real getSquaredViewDepth(
const Camera* cam)
const = 0;
216 virtual const LightList& getLights(
void)
const = 0;
243 mCustomParameters[index] = value;
252 mCustomParameters.erase(index);
261 return mCustomParameters.find(index) != mCustomParameters.end();
270 CustomParameterMap::const_iterator i = mCustomParameters.find(index);
271 if (i != mCustomParameters.end())
278 "Parameter at the given index was not found.",
279 "Renderable::getCustomParameter");
311 CustomParameterMap::const_iterator i = mCustomParameters.find(constantEntry.
data);
312 if (i != mCustomParameters.end())
326 mPolygonModeOverrideable =
override;
334 return mPolygonModeOverrideable;
344 virtual void setUserAny(
const Any& anything) { getUserObjectBindings().setUserAny(anything); }
349 virtual const Any&
getUserAny(
void)
const {
return getUserObjectBindings().getUserAny(); }
401 return mRenderSystemData;
409 mRenderSystemData = val;
431 #endif //__Renderable_H__
A viewpoint from which the scene will be rendered.
Class encapsulating a standard 4x4 homogeneous matrix.
bool getUseIdentityProjection(void) const
Returns whether or not to use an 'identity' projection.
float Real
Software floating point type.
virtual ~Visitor()
Virtual destructor needed as class has virtual methods.
void setUseIdentityView(bool useIdentityView)
Sets whether or not to use an 'identity' view.
size_t elementCount
The number of elements per individual entry in this constant Used in case people used packed elements...
virtual bool getPolygonModeOverrideable(void) const
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setti...
Variant type that can hold Any other type.
CustomParameterMap mCustomParameters
bool mPolygonModeOverrideable
virtual void _updateCustomGpuParameter(const GpuProgramParameters::AutoConstantEntry &constantEntry, GpuProgramParameters *params) const
Update a custom GpuProgramParameters constant which is derived from information only this Renderable ...
Manages the organisation and rendering of a 'scene' i.e.
bool mUseIdentityProjection
const Vector4 & getCustomParameter(size_t index) const
Gets the custom value associated with this Renderable at the given index.
virtual bool getCastsShadows(void) const
Method which reports whether this renderable would normally cast a shadow.
Class representing an approach to rendering this particular Material.
UserObjectBindings & getUserObjectBindings()
Return an instance of user objects binding associated with this class.
void setUseIdentityProjection(bool useIdentityProjection)
Sets whether or not to use an 'identity' projection.
RenderSystemData * mRenderSystemData
User objects binding.
void setCustomParameter(size_t index, const Vector4 &value)
Sets a custom parameter for this Renderable, which may be used to drive calculations for this specifi...
Abstract class defining the interface all renderable objects must implement.
virtual bool preRender(SceneManager *sm, RenderSystem *rsys)
Called just prior to the Renderable being rendered.
Structure recording the use of an automatic parameter.
virtual void setPolygonModeOverrideable(bool override)
Sets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setti...
virtual unsigned short getNumWorldTransforms(void) const
Returns the number of world transform matrices this renderable requires.
void removeCustomParameter(size_t index)
Removes a custom value which is associated with this Renderable at the given index.
const UserObjectBindings & getUserObjectBindings() const
Return an instance of user objects binding associated with this class.
#define OGRE_EXCEPT(num, desc, src)
Collects together the program parameters used for a GpuProgram.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly...
virtual Technique * getTechnique(void) const
Retrieves a pointer to the Material Technique this renderable object uses.
virtual RenderSystemData * getRenderSystemData() const
Gets RenderSystem private data.
virtual const Any & getUserAny(void) const
bool getUseIdentityView(void) const
Returns whether or not to use an 'identity' view.
UserObjectBindings mUserObjectBindings
'New' rendering operation using vertex buffers.
void _writeRawConstant(size_t physicalIndex, const Vector4 &vec, size_t count=4)
Write a 4-element floating-point parameter to the program directly to the underlying constants buffer...
bool hasCustomParameter(size_t index) const
Checks whether a custom value is associated with this Renderable at the given index.
virtual ~Renderable()
Virtual destructor needed as class has virtual methods.
virtual void setRenderSystemData(RenderSystemData *val) const
Sets RenderSystem private data.
virtual void setUserAny(const Any &anything)
4-dimensional homogeneous vector.
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
Defines the functionality of a 3D API.
size_t physicalIndex
The target (physical) constant index.
map< size_t, Vector4 >::type CustomParameterMap
An internal class that should be used only by a render system for internal use.
Class that provide convenient interface to establish a linkage between custom user application object...
virtual void postRender(SceneManager *sm, RenderSystem *rsys)
Called immediately after the Renderable has been rendered.