29#ifndef __OgreManualObject_H__
30#define __OgreManualObject_H__
398 bool extrudeVertices,
Real extrusionDist,
unsigned long flags = 0);
459 bool createSeparateLightCap,
bool isLightCap =
false);
476 bool debugRenderables =
false);
#define OGRE_MAX_TEXTURE_COORD_SETS
Define number of texture coordinate sets allowed per vertex.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
A 3D box aligned with the x/y/z axes.
A viewpoint from which the scene will be rendered.
Class representing colour.
This class contains the information required to describe the edge connectivity of a given set of vert...
Shared pointer implementation used to share index buffers.
Shared pointer implementation used to share vertex buffers.
Representation of a dynamic light source in the scene.
Factory object for creating ManualObject instances.
static String FACTORY_TYPE_NAME
const String & getType(void) const
Get the type of the object to be created.
void destroyInstance(MovableObject *obj)
Destroy an instance of the object.
MovableObject * createInstanceImpl(const String &name, const NameValuePairList *params)
Internal implementation of create method - must be overridden.
Nested class to allow shadows.
HardwareVertexBufferSharedPtr mPositionBuffer
void getWorldTransforms(Matrix4 *xform) const
Overridden from ShadowRenderable.
HardwareVertexBufferSharedPtr getPositionBuffer(void)
ManualObjectSectionShadowRenderable(ManualObject *parent, HardwareIndexBufferSharedPtr *indexBuffer, const VertexData *vertexData, bool createSeparateLightCap, bool isLightCap=false)
~ManualObjectSectionShadowRenderable()
virtual void rebindIndexBuffer(const HardwareIndexBufferSharedPtr &indexBuffer)
Overridden from ShadowRenderable.
HardwareVertexBufferSharedPtr mWBuffer
HardwareVertexBufferSharedPtr getWBuffer(void)
Built, renderable section of geometry.
virtual ~ManualObjectSection()
void setMaterialName(const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
update the material name in use
RenderOperation * getRenderOperation(void)
Retrieve render operation for manipulation.
void getRenderOperation(RenderOperation &op)
Gets the render operation required to send this object to the frame buffer.
bool get32BitIndices() const
Get whether we need 32-bit indices.
void set32BitIndices(bool n32)
Set whether we need 32-bit indices.
const String & getMaterialGroup(void) const
Retrieve the material group in use.
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
RenderOperation mRenderOperation
const MaterialPtr & getMaterial(void) const
Retrieves a weak reference to the material this renderable object uses.
Real getSquaredViewDepth(const Ogre::Camera *) const
Returns the camera-relative squared depth of this renderable.
void getWorldTransforms(Matrix4 *xform) const
Gets the world transform matrix / matrices for this renderable object.
ManualObjectSection(ManualObject *parent, const String &materialName, RenderOperation::OperationType opType, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
const String & getMaterialName(void) const
Retrieve the material name in use.
Class providing a much simplified interface to generating manual objects with custom geometry.
bool getUseIdentityView(void) const
Returns whether or not to use an 'identity' view.
virtual void textureCoord(const Vector4 &xyzw)
Add a texture coordinate to the current vertex.
virtual void beginUpdate(size_t sectionIndex)
Start the definition of an update to a part of the object.
bool mAnyIndexed
Any indexed geometry on any sections?
ManualObjectSection * mCurrentSection
Current section.
virtual void quad(uint32 i1, uint32 i2, uint32 i3, uint32 i4)
Add a set of 4 vertex indices to construct a quad (out of 2 triangles); this is a shortcut to calling...
virtual void textureCoord(Real u)
Add a texture coordinate to the current vertex.
bool mUseIdentityProjection
Whether to use identity projection for sections.
virtual void normal(Real x, Real y, Real z)
Add a vertex normal to the current vertex.
const String & getMovableType(void) const
Returns the type name of this object.
void setBoundingBox(const AxisAlignedBox &box)
Sets the bounding box.
uint32 * mTempIndexBuffer
System-memory buffer whilst we establish the size required.
bool mUseIdentityView
Whether to use identity view for sections.
virtual void copyTempVertexToBuffer(void)
Copy current temp vertex into buffer.
virtual void tangent(const Vector3 &tan)
Add a vertex tangent to the current vertex.
virtual void triangle(uint32 i1, uint32 i2, uint32 i3)
Add a set of 3 vertex indices to construct a triangle; this is a shortcut to calling index() 3 times.
virtual void position(Real x, Real y, Real z)
Add a vertex position, starting a new vertex at the same time.
virtual void estimateIndexCount(size_t icount)
Estimate the number of indices ahead of time.
virtual void normal(const Vector3 &norm)
Add a vertex normal to the current vertex.
ushort mTexCoordIndex
Current texture coordinate.
virtual MeshPtr convertToMesh(const String &meshName, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Convert this object to a Mesh.
void setUseIdentityView(bool useIdentityView)
Sets whether or not to use an 'identity' view.
virtual void begin(const String &materialName, RenderOperation::OperationType opType=RenderOperation::OT_TRIANGLE_LIST, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Start defining a part of the object.
bool hasEdgeList(void)
Overridden member from ShadowCaster.
bool mCurrentUpdating
Are we updating?
virtual void colour(const ColourValue &col)
Add a vertex colour to a vertex.
virtual void colour(Real r, Real g, Real b, Real a=1.0f)
Add a vertex colour to a vertex.
virtual void textureCoord(Real x, Real y, Real z, Real w)
Add a texture coordinate to the current vertex.
virtual void resizeTempIndexBufferIfNeeded(size_t numInds)
Resize the temp index buffer?
void setUseIdentityProjection(bool useIdentityProjection)
Sets whether or not to use an 'identity' projection.
ShadowRenderableList mShadowRenderables
List of shadow renderables.
bool getKeepDeclarationOrder() const
Gets whether or not the declaration order is to be kept or not.
virtual void setDynamic(bool dyn)
Use before defining geometry to indicate that you intend to update the geometry regularly and want th...
virtual void tangent(Real x, Real y, Real z)
Add a vertex tangent to the current vertex.
ShadowRenderableListIterator getShadowVolumeRenderableIterator(ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDist, unsigned long flags=0)
Implement this method to enable stencil shadows.
ManualObject(const String &name)
virtual void textureCoord(Real u, Real v, Real w)
Add a texture coordinate to the current vertex.
size_t mTempIndexSize
System memory allocation size, in bytes.
virtual void estimateVertexCount(size_t vcount)
Estimate the number of vertices ahead of time.
unsigned int getNumSections(void) const
Retrieves the number of ManualObjectSection objects making up this ManualObject.
virtual ManualObjectSection * end(void)
Finish defining the object and compile the final renderable version.
virtual void position(const Vector3 &pos)
Add a vertex position, starting a new vertex at the same time.
bool mTempVertexPending
Temp vertex data to copy?
virtual size_t getCurrentIndexCount() const
Get the number of indices in the section currently being defined (returns 0 if no section is in progr...
Real getBoundingRadius(void) const
Retrieves the radius of the origin-centered bounding sphere for this object.
bool getUseIdentityProjection(void) const
Returns whether or not to use an 'identity' projection.
virtual bool getDynamic() const
Gets whether this object is marked as dynamic.
void setKeepDeclarationOrder(bool keepOrder)
Sets whether or not to keep the original declaration order when queuing the renderables.
virtual void textureCoord(const Vector2 &uv)
Add a texture coordinate to the current vertex.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
virtual size_t getCurrentVertexCount() const
Get the number of vertices in the section currently being defined (returns 0 if no section is in prog...
virtual void resetTempAreas(void)
Delete temp buffers and reset init counts.
EdgeData * mEdgeList
Edge list, used if stencil shadow casting is enabled.
SectionList mSectionList
List of subsections.
virtual void textureCoord(Real u, Real v)
Add a texture coordinate to the current vertex.
bool mKeepDeclarationOrder
Keep declaration order or let the queue optimize it.
virtual void index(uint32 idx)
Add a vertex index to construct faces / lines / points via indexing rather than just by a simple list...
virtual void clear(void)
Completely clear the contents of the object.
ManualObjectSection * getSection(unsigned int index) const
Gets a pointer to a ManualObjectSection, i.e.
size_t mDeclSize
Current declaration vertex size.
Real mRadius
Bounding sphere.
virtual void setMaterialName(size_t subIndex, const String &name, const String &group=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Alter the material for a subsection of this object after it has been specified.
virtual void textureCoord(const Vector3 &uvw)
Add a texture coordinate to the current vertex.
bool mFirstVertex
First vertex indicator.
size_t mEstIndexCount
Estimated index count.
EdgeData * getEdgeList(void)
Implement this method to enable stencil shadows.
AxisAlignedBox mAABB
Bounding box.
size_t mTempVertexSize
System memory allocation size, in bytes.
void _updateRenderQueue(RenderQueue *queue)
Internal method by which the movable object must add Renderable subclass instances to the rendering q...
TempVertex mTempVertex
Temp storage.
vector< ManualObjectSection * >::type SectionList
const AxisAlignedBox & getBoundingBox(void) const
Retrieves the local axis-aligned bounding box for this object.
size_t mEstVertexCount
Estimated vertex count.
virtual void resizeTempVertexBufferIfNeeded(size_t numVerts)
Resize the temp vertex buffer?
char * mTempVertexBuffer
System-memory buffer whilst we establish the size required.
Class encapsulating a standard 4x4 homogeneous matrix.
Interface definition for a factory class which produces a certain kind of MovableObject,...
Abstract class defining a movable object in a scene.
'New' rendering operation using vertex buffers.
OperationType
The rendering operation type to perform.
@ OT_TRIANGLE_LIST
A list of triangles, 3 vertices per triangle.
Class to manage the scene object rendering queue.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
Abstract class defining the interface all renderable objects must implement.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
static String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
vector< ShadowRenderable * >::type ShadowRenderableList
Class which represents the renderable aspects of a set of shadow volume faces.
Standard 2-dimensional vector.
Standard 3-dimensional vector.
4-dimensional homogeneous vector.
Concrete IteratorWrapper for nonconst access to the underlying container.
Summary class collecting together vertex source information.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
ShadowTechnique
An enumeration of broad shadow techniques.
float Real
Software floating point type.
Temporary vertex structure.