Go to the documentation of this file.
28 #ifndef __StaticGeometry_H__
29 #define __StaticGeometry_H__
212 void copyIndexes(
const T* src, T* dst,
size_t count,
size_t indexOffset)
214 if (indexOffset == 0)
216 memcpy(dst, src,
sizeof(T) * count);
222 *dst++ = static_cast<T>(*src++ + indexOffset);
239 void getWorldTransforms(
Matrix4* xform)
const;
240 Real getSquaredViewDepth(
const Camera* cam)
const;
242 bool getCastsShadows(
void)
const;
249 void build(
bool stencilShadows);
251 void dump(std::ofstream& of)
const;
287 void build(
bool stencilShadows);
300 void dump(std::ofstream& of)
const;
327 bool createSeparateLightCap,
bool isLightCap =
false);
330 void getWorldTransforms(
Matrix4* xform)
const;
364 void build(
bool stencilShadows);
373 void dump(std::ofstream& of)
const;
378 void updateShadowRenderables(
381 bool extrudeVertices,
Real extrusionDistance,
unsigned long flags = 0 );
444 void build(
bool stencilShadows);
449 const String& getMovableType(
void)
const;
450 void _notifyCurrentCamera(
Camera* cam);
452 Real getBoundingRadius(
void)
const;
456 bool debugRenderables =
false);
457 bool isVisible(
void)
const;
458 uint32 getTypeFlags(
void)
const;
467 bool extrudeVertices,
Real extrusionDistance,
unsigned long flags = 0 );
471 bool hasEdgeList(
void);
474 void dump(std::ofstream& of)
const;
524 virtual Region* getRegion(
const Vector3& point,
bool autoCreate);
531 virtual void getRegionIndexes(
const Vector3& point,
561 template <
typename T>
565 for (
size_t i = 0; i < numIndexes; ++i)
568 remap.insert(IndexRemap::value_type(*pBuffer++, remap.size()));
574 template <
typename T>
578 for (
size_t i = 0; i < numIndexes; ++i)
581 IndexRemap::const_iterator ix = remap.find(*src++);
582 assert(ix != remap.end());
583 *dst++ = static_cast<T>(ix->second);
635 virtual void addSceneNode(
const SceneNode* node);
647 virtual void build(
void);
654 virtual void destroy(
void);
659 virtual void reset(
void);
671 mUpperDistance = dist;
672 mSquaredUpperDistance = mUpperDistance * mUpperDistance;
680 {
return mSquaredUpperDistance; }
683 virtual void setVisible(
bool visible);
705 virtual void setCastShadows(
bool castShadows);
720 mRegionDimensions = size;
721 mHalfRegionDimensions = size * 0.5;
741 void setVisibilityFlags(
uint32 flags);
743 uint32 getVisibilityFlags()
const;
756 virtual void setRenderQueueGroup(
uint8 queueID);
759 virtual uint8 getRenderQueueGroup(
void)
const;
762 bool debugRenderables =
false);
772 virtual void dump(
const String& filename)
const;
QueuedGeometryList mQueuedGeometryList
Geometry queued for a single LOD (deallocated here)
static const Vector3 UNIT_SCALE
map< size_t, size_t >::type IndexRemap
vector< Real >::type LodValueList
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
map< uint32, Region * >::type RegionMap
Indexed region map based on packed x/y/z region index, 10 bits for each axis.
String mFormatString
String identifying the vertex / index format.
ShadowCaster::ShadowRenderableList mShadowRenderables
List of shadow renderables.
vector< ShadowRenderable * >::type ShadowRenderableList
A viewpoint from which the scene will be rendered.
HardwareVertexBufferSharedPtr mWBuffer
StaticGeometry * getParent(void) const
QueuedGeometryList mQueuedGeometry
Geometry which has been queued up pre-build (not for deallocation)
MapIterator< MaterialBucketMap > MaterialIterator
Iterator over the materials in this LOD.
SubMeshLodGeometryLinkList * geometryLodList
Link to LOD list of geometry, potentially optimised.
MapIterator< RegionMap > RegionIterator
Iterator for iterating over contained regions.
Class which represents the renderable aspects of a set of shadow volume faces.
SubMeshLodGeometryLink * geometry
uint32 getID(void) const
Get the region ID of this region.
ShadowTechnique
An enumeration of broad shadow techniques.
Concrete IteratorWrapper for nonconst access to the underlying container.
Representation of a dynamic light source in the scene.
Vector3 mCentre
Center of the region.
OptimisedSubMeshGeometryList mOptimisedSubMeshGeometryList
List of geometry which has been optimised for SubMesh use This is the primary storage used for cleani...
map< String, GeometryBucket * >::type CurrentGeometryMap
Struct holding geometry optimised per SubMesh / LOD level, ready for copying to instances.
ShadowCaster::ShadowRenderableList & getShadowRenderableList()
Abstract class defining a movable object in a scene.
virtual const Vector3 & getRegionDimensions(void) const
Gets the size of a single batch of geometry.
Shared pointer implementation used to share index buffers.
vector< SubMeshLodGeometryLink >::type SubMeshLodGeometryLinkList
void remapIndexes(T *src, T *dst, const IndexRemap &remap, size_t numIndexes)
Method for altering indexes based on a remap.
uint8 mRenderQueueID
The render queue to use when rendering this object.
HardwareIndexBuffer::IndexType mIndexType
Size of indexes.
The details of a topological region which is the highest level of partitioning for this class.
StaticGeometry * mParent
Parent static geometry.
Vector3 mHalfRegionDimensions
A MaterialBucket is a collection of smaller buckets with the same Material (and implicitly the same L...
Real mSquaredUpperDistance
virtual bool getCastShadows(void)
Will the geometry from this object cast shadows?
Pre-transforms and batches up meshes for efficient use as static geometry in a scene.
size_t mMaxVertexIndex
Maximum vertex indexable.
void buildIndexRemap(T *pBuffer, size_t numIndexes, IndexRemap &remap)
Method for figuring out which vertices are used by an index buffer and calculating a remap lookup for...
Class representing an approach to rendering this particular Material.
void copyIndexes(const T *src, T *dst, size_t count, size_t indexOffset)
Vector3 mRegionDimensions
Defines an instance of a discrete, movable object based on a Mesh.
Class representing a node in the scene graph.
LODBucketList mLodBucketList
List of LOD buckets
Camera * mCamera
Current camera.
EdgeData * getEdgeList() const
Summary class collecting together vertex source information.
MaterialBucket * mParent
Pointer to parent bucket.
Implementation of a Quaternion, i.e.
Strategy for determining level of detail.
const MaterialPtr & getMaterial(void) const
Get the material for this bucket.
OptimisedSubMeshGeometry()
Class encapsulating a standard 4x4 homogeneous matrix.
~OptimisedSubMeshGeometry()
CurrentGeometryMap mCurrentGeometryMap
SceneNode * mNode
Scene node.
uint32 mVisibilityFlags
Stores the visibility flags for the regions.
Manages the organisation and rendering of a 'scene' i.e.
virtual Real getSquaredRenderingDistance(void) const
Gets the squared distance at which batches are no longer rendered.
HardwareVertexBufferSharedPtr mPositionBuffer
A LODBucket is a collection of smaller buckets with the same LOD.
bool isVertexProgramInUse() const
Shared pointer implementation used to share vertex buffers.
Defines a part of a complete mesh.
Region * mParent
Pointer to parent region.
Structure recording a queued submesh for the build.
list< OptimisedSubMeshGeometry * >::type OptimisedSubMeshGeometryList
map< String, MaterialBucket * >::type MaterialBucketMap
Lookup of Material Buckets in this region.
Technique * getCurrentTechnique(void) const
Get the current Technique.
Technique * mTechnique
Active technique.
vector< LODBucket * >::type LODBucketList
list of LOD Buckets in this region
A 3D box aligned with the x/y/z axes.
VectorIterator< LODBucketList > LODIterator
ushort getLod(void) const
Get the LOD index.
VectorIterator< GeometryBucketList > GeometryIterator
Iterator over geometry.
unsigned short mLod
LOD level (0 == full LOD)
String mMaterialName
Material being used.
virtual void setOrigin(const Vector3 &origin)
Sets the origin of the geometry.
LODBucket * getParent(void)
virtual bool isVisible(void) const
Are the batches visible?
MaterialPtr mMaterial
Pointer to material being used.
virtual const Vector3 & getOrigin(void) const
Gets the origin of this geometry.
AxisAlignedBox mAABB
Local AABB relative to region centre.
vector< QueuedSubMesh * >::type QueuedSubMeshList
const String & getName(void) const
Get the name of this object.
SubMeshGeometryLookup mSubMeshGeometryLookup
Cached links from SubMeshes to (potentially optimised) geometry This is not used for deletion since t...
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
MaterialBucket * getParent(void)
ushort mCurrentLod
The current LOD level, as determined from the last camera.
VertexData * mVertexData
Vertex information, includes current number of vertices committed to be a part of this bucket.
std::map< K, V, P, A > type
vector< QueuedGeometry * >::type QueuedGeometryList
4-dimensional homogeneous vector.
Saved link between SubMesh at a LOD and vertex/index data May point to original or optimised geometry...
QueuedSubMeshList mQueuedSubMeshes
Structure recording a queued geometry for low level builds.
HardwareVertexBufferSharedPtr getPositionBuffer(void)
const IndexData * getIndexData(void) const
Get the index data for this geometry.
virtual void setRegionDimensions(const Vector3 &size)
Sets the size of a single region of geometry.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
const Vector3 & getCentre(void) const
Get the centre point of the region.
EdgeData * mEdgeList
Edge list, used if stencil shadow casting is enabled.
uint32 mRegionID
Unique identifier for the region.
Abstract class defining the interface all renderable objects must implement.
LODBucket * mParent
Pointer to parent LODBucket.
virtual void setRenderingDistance(Real dist)
Sets the distance at which batches are no longer rendered.
ulong mLightListUpdated
The last frame that this light list was updated in.
AxisAlignedBox worldBounds
Pre-transformed world AABB.
Real getLodValue(void) const
Get the LOD value.
QueuedSubMeshList mQueuedSubMeshes
Local list of queued meshes (not used for deallocation)
static const Quaternion IDENTITY
float Real
Software floating point type.
IndexData * mIndexData
Index information, includes index type which limits the max number of vertices which are allowed in o...
Real mLodValue
Current LOD value, passed on to do material LOD later.
const String & getMaterialName(void) const
Get the material name.
This class contains the information required to describe the edge connectivity of a given set of vert...
Real mLodValue
LOD value at which this LOD starts to apply (squared)
const VertexData * getVertexData(void) const
Get the vertex data for this geometry.
virtual Real getRenderingDistance(void) const
Gets the distance at which batches are no longer rendered.
bool mRenderQueueIDSet
Flags whether the RenderQueue's default should be used.
Nested class to allow shadows.
Real mBoundingRadius
Local bounding radius.
Mesh::LodValueList mLodValues
LOD values as built up - use the max at each level.
bool mVertexProgramInUse
Is a vertex program in use somewhere in this group?
const LodStrategy * mLodStrategy
LOD strategy reference.
Summary class collecting together index data source information.
RegionMap mRegionMap
Map of regions.
GeometryBucketList mGeometryBucketList
list of Geometry Buckets in this region
Standard 3-dimensional vector.
A GeometryBucket is a the lowest level bucket where geometry with the same vertex & index format is s...
SceneManager * mSceneMgr
Scene manager link.
'New' rendering operation using vertex buffers.
Real mSquaredViewDepth
Cached squared view depth value to avoid recalculation by GeometryBucket.
vector< GeometryBucket * >::type GeometryBucketList
list of Geometry Buckets in this region
Class to manage the scene object rendering queue.
map< SubMesh *, SubMeshLodGeometryLinkList * >::type SubMeshGeometryLookup
MaterialBucketMap mMaterialBucketMap
Lookup of Material Buckets in this region.
LightList mLightList
List of lights for this region.
HardwareVertexBufferSharedPtr getWBuffer(void)
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.