![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
3D object class. More...
3D object class.
Object3D objects are 2-level entities:
The biggest addition of Object3D to VertexTransfer is the renderability.
Definition at line 69 of file PureObject3DManager.h.
#include <PureObject3DManager.h>
Classes | |
class | PureObject3DImpl |
Public Member Functions | |
virtual | ~PureObject3D () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
virtual TPureBool | isLevel1 () const |
Tells if the mesh is a level-1 parent mesh. | |
virtual TPureBool | isLevel2 () const |
Tells if the mesh is a level-2 submesh. | |
virtual TPURE_PRIMITIVE_FORMAT | getPrimitiveFormat () const |
Gets the primitives' format. | |
virtual TPureUInt | getVerticesCount () const |
Gets the number of total vertices. | |
virtual const TXYZ * | getVertices (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to vertices. | |
virtual TXYZ * | getVertices (TPureBool implicitAccessSubobject=true) |
Gets the pointer to vertices. | |
virtual TPureUInt | getVertexIndicesCount () const |
Gets the number of total vertex indices. | |
virtual const void * | getVertexIndices (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to vertex indices. | |
virtual unsigned int | getVertexIndicesType (TPureBool implicitAccessSubobject=true) const |
Gets the type of the indices. | |
virtual TPureUInt | getMinVertexIndex (TPureBool implicitAccessSubobject=true) const |
Gets the smallest index in the vertex indices array. | |
virtual TPureUInt | getMaxVertexIndex (TPureBool implicitAccessSubobject=true) const |
Gets the greatest index in the vertex indices array. | |
virtual TPureUInt | getVertexIndex (TPureUInt index, TPureBool implicitAccessSubobject=true) const |
Gets an index value from the vertex indices array. | |
virtual const TXYZ * | getNormals (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to normals. | |
virtual TPureUInt | getFaceCount () const |
Gets the number of faces/polygons formed by the vertices. | |
virtual TPureUInt | getTriangleCount () const |
Gets the number of triangles formed by the vertices. | |
virtual TPURE_VERTEX_MODIFYING_HABIT | getVertexModifyingHabit () const |
Gets vertex modifying habit. | |
virtual TPURE_VERTEX_REFERENCING_MODE | getVertexReferencingMode () const |
Gets vertex referencing mode. | |
virtual TPURE_VERTEX_TRANSFER_MODE | getVertexTransferMode () const |
Gets vertex transfer mode. | |
virtual TPureBool | setVertexTransferMode (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Sets vertex transfer mode. | |
virtual TPureUInt | getLastTransferredVertexCount () const |
Gets the number of vertices sent to graphics pipeline by the last transferVertices() call. | |
virtual TPureUInt | getLastTransferredTriangleCount () const |
Gets the number of triangles sent to graphics pipeline by the last transferVertices() call. | |
PureObject3D * | getReferredObject () const |
Gets the original object which was cloned to create this object. | |
const std::set< PureObject3D * > & | getReferrerObjects () const |
Gets the cloned objects referring to this object. | |
const TPURE_TRANSFORMED_VERTEX * | getTransformedVertices (TPureBool implicitAccessSubobject=true) const |
Gets the pointer to transformed vertices. | |
TPURE_TRANSFORMED_VERTEX * | getTransformedVertices (TPureBool implicitAccessSubobject=true) |
Gets the pointer to transformed vertices. | |
PureVector & | getAngleVec () |
Gets the rotation angles. | |
const PureVector & | getAngleVec () const |
Gets the rotation angles. | |
virtual const PureVector & | getRelPosVec () const |
Gets the mesh-local relative position. | |
virtual const PureVector & | getSizeVec () const |
Gets the base sizes. | |
PureVector | getScaledSizeVec () const |
Gets the real sizes considering the geometry size calculated from vertex data and the current scaling factor. | |
const PureVector & | getScaling () const |
Gets the scaling factor. | |
void | SetScaling (TPureFloat value) |
Sets the scaling factor to given scalar. | |
void | SetScaling (const PureVector &value) |
Sets the scaling factor to given vector. | |
void | Scale (TPureFloat value) |
Scales by the given scalar value. | |
void | Scale (const PureVector &value) |
Scales by the given vector. | |
TPureFloat | getBiggestAreaScaled () const |
Gets the biggest area of the object on either plane (XY, XZ or YZ), scaled by current scaling factor. | |
TPureFloat | recalculateBiggestAreaScaled () |
Recalculates biggest area of object on either plane (XY, XZ or YZ), scaled by current scaling factor. | |
TPureBool | isRenderingAllowed () const |
Gets if rendering is allowed. | |
void | SetRenderingAllowed (TPureBool state) |
Sets if rendering is allowed. | |
void | Show () |
Enables rendering of this object. | |
void | Hide () |
Disables rendering of this object. | |
TPureBool | isColliding_TO_BE_REMOVED () const |
Gets whether colliding is enabled. | |
void | SetColliding_TO_BE_REMOVED (TPureBool value) |
Sets whether colliding is enabled. | |
TPURE_ROTATION_ORDER | getRotationOrder () const |
Gets the rotation order. | |
void | SetRotationOrder (TPURE_ROTATION_ORDER value) |
Sets the rotation order. | |
TPureBool | isLit () const |
Gets the lit state. | |
void | SetLit (TPureBool value) |
Sets the lit state. | |
TPureBool | isDoubleSided () const |
Gets the double sided state. | |
void | SetDoubleSided (TPureBool value) |
Sets the double sided state. | |
TPureBool | isWireframed () const |
Gets the wireframed state. | |
void | SetWireframed (TPureBool value) |
Sets the wireframed state. | |
TPureBool | isWireframedCulled () const |
Gets the wireframed culling state. | |
void | SetWireframedCulled (TPureBool value) |
Sets the wireframed culling state. | |
TPureBool | isAffectingZBuffer () const |
Gets whether we write to the Z-Buffer while rendering. | |
void | SetAffectingZBuffer (TPureBool value) |
Sets whether we write to the Z-Buffer while rendering. | |
TPureBool | isTestingAgainstZBuffer () const |
Gets whether we test against the Z-Buffer while rendering. | |
void | SetTestingAgainstZBuffer (TPureBool value) |
Sets whether we test against the Z-Buffer while rendering. | |
TPureBool | isStickedToScreen () const |
Gets the sticked-to-screen state. | |
void | SetStickedToScreen (TPureBool value) |
Sets the sticked-to-screen state. | |
TPureBool | isOccluder () const |
Gets whether this object should be considered as an occluder during rendering. | |
void | SetOccluder (TPureBool value) |
Sets whether this object should be considered as an occluder during rendering. | |
TPureBool | isOccluded () const |
Gets whether this object was occluded or not based on the last finished occlusion test. | |
TPureBool | isOcclusionTested () const |
Gets whether this object is being tested if it is occluded or not. | |
void | SetOcclusionTested (TPureBool state) |
Sets whether this object should be tested if it is occluded or not. | |
const PureObject3D * | getBoundingBoxObject () const |
Gets the bounding box object used for occlusion tests. | |
void | ForceFinishOcclusionTest () |
Waits for any pending occlusion test to be finished and reset occluded state. | |
virtual TPureUInt | getUsedSystemMemory () const |
Gets the amount of allocated system memory. | |
virtual TPureUInt | getUsedVideoMemory () const |
Gets the amount of allocated video memory. | |
TPureUInt | draw (const TPURE_RENDER_PASS &renderPass, TPureBool bASyncQuery, TPureBool bRenderIfQueryPending) |
Draws the object. | |
![]() | |
virtual | ~PureVertexTransfer () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
virtual TPureBool | setVertexModifyingHabit (TPURE_VERTEX_MODIFYING_HABIT vmod) |
Sets vertex modifying habit. | |
virtual TPureBool | setVertexReferencingMode (TPURE_VERTEX_REFERENCING_MODE vref) |
Sets vertex referencing mode. | |
![]() | |
virtual | ~PureMesh3D () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
PureVector & | getPosVec () |
Gets the position. | |
const PureVector & | getPosVec () const |
Gets the position. | |
void | RecalculateSize () |
Recalculates the sizes. | |
const PureMaterial & | getMaterial (TPureBool implicitAccessSubobject=true) const |
Gets the material. | |
PureMaterial & | getMaterial (TPureBool implicitAccessSubobject=true) |
Gets the material. | |
![]() | |
PureFiledManaged () | |
virtual | ~PureFiledManaged () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
const std::string & | getFilename () const |
Gets the filename. | |
![]() | |
PureManaged () | |
virtual | ~PureManaged () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
const PureManaged * | getUtiliser () const |
Returns the managed that utilizes this managed. | |
PureManaged * | getUtiliser () |
Returns the managed that utilizes this managed. | |
void | SetUtiliser (PureManaged *pUtiliser) |
Sets the managed that utilizes this managed. | |
void | DetachFrom () |
Removes the managed from its manager. | |
PureManager * | getManager () const |
Gets the manager of the managed. | |
const std::string & | getName () const |
Gets the name. | |
void | SetName (const std::string &name) |
Sets the name. | |
virtual void | FlushResources () |
This can be used if the specialized managed object has some resources that may be released from memory when not needed anymore. | |
![]() | |
PureFiledManager () | |
virtual | ~PureFiledManager () |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
PureFiledManaged * | getByFilename (const char *filename) const |
Gets the FiledManaged by the specified filename. | |
virtual PureFiledManaged * | createFromFile (const char *filename) |
Should create a new managed from the given file. | |
void | WriteList () const |
From PureManager, adding logging file names. | |
![]() | |
PureManager () | |
virtual | ~PureManager () |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
TPureInt | getCount () const |
Gets the number of managed objects. | |
TPureBool | isEmpty () const |
Is the number of manageds 0? | |
TPureInt | getSize () const |
Gets the number of allocated slots for managed objects; getSize() >= getCount(). | |
PureManaged * | getAttachedAt (TPureInt ind) const |
Gets the pointer to the managed at the given index. | |
TPureInt | getAttachedIndex (const PureManaged &m) const |
Gets the index of the given managed. | |
void | PreAlloc (TPureInt count) |
Allocates count free slots for manageds. | |
TPureBool | hasAttached (const PureManaged &m) const |
Gets whether the given managed is managed by this manager. | |
virtual void | Attach (PureManaged &m) |
Adds the given managed to the manager, if the managed has no manager yet. | |
virtual void | Detach (PureManaged &m) |
Removes the given managed from the manager, so the managed will have no manager. | |
void | DeleteAttachedInstance (PureManaged &m) |
Removes the given managed from the manager and destructs it. | |
void | DeleteAll () |
Removes and destructs every managed element in the manager. | |
virtual void | HandleManagedPropertyChanged (PureManaged &m) |
Should be invoked when a managed's property got changed from a different kind of manager or managed. | |
Static Public Member Functions | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static TPureBool | isVertexTransferModeSelectable (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode is available on the current hardware. | |
static TPureBool | isVertexReferencingIndexed (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode references vertices by indexing. | |
static TPureBool | isVertexModifyingDynamic (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode means dynamic modifying habit. | |
static TPureBool | isVideoMemoryUsed (TPURE_VERTEX_TRANSFER_MODE vtrans) |
Tells whether the given Vertex Transfer Mode uses VRAM. | |
static TPURE_VERTEX_TRANSFER_MODE | selectVertexTransferMode (TPURE_VERTEX_MODIFYING_HABIT vmod, TPURE_VERTEX_REFERENCING_MODE vref, TPureBool bForceUseClientMemory) |
Selects a suitable vertex transfer mode. | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
Private Attributes | |
PureObject3DImpl * | pImpl |
Friends | |
class | PureObject3DManager |
|
virtual |
Definition at line 1555 of file PureObject3D.cpp.
|
protected |
Only PureObject3DManager creates it.
matMgr | A MaterialManager instance to be used for constructing of ancestor class. |
vmod | What vertex modifying habit to be set for the new Object3D instance. |
vref | What vertex referencing mode to be set for the new Object3D instance. |
bForceUseClientMemory | Force-select a vertex transfer mode storing geometry in client memory instead of server memory. Please note that this is considered only if dynamic modifying habit is specified. Specifying static modifying habit will always select a mode which places geometry data into server memory. |
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 2573 of file PureObject3D.cpp.
|
protected |
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 2588 of file PureObject3D.cpp.
TPureUInt PureObject3D::draw | ( | const TPURE_RENDER_PASS & | renderPass, |
TPureBool | bASyncQuery, | ||
TPureBool | bRenderIfQueryPending ) |
Draws the object.
This is only valid from outside for level-1 objects. The call is ignored by level-2 subobjects. Only their level-1 parent object can call on its subobjects.
renderPass | Which pass/mode of rendering we are doing now for this object. Some render passes depend on the effect of other passes, so order is important. |
bASyncQuery | If true, it just checks if query is complete, but won't wait for it. If false, it will wait until query is finished. |
bRenderIfQueryPending | If true, and we do not have query result yet, the function will respond as if the object is NOT occluded. If false, and we do not have query result yet, the function will respond based on the last occlusion state of this object, meaning that: if the last finished query said the object was occluded, the function will respond as the object was occluded, otherwise it will respond as the object was not occluded. This parameter is used only with async queries. |
Definition at line 2552 of file PureObject3D.cpp.
void PureObject3D::ForceFinishOcclusionTest | ( | ) |
Waits for any pending occlusion test to be finished and reset occluded state.
This is actually a helper function for a renderer in rare cases when rendering path change requires all pending queries to be finished. This is called forced, so it waits for finish even when rendering path implements async occlusion query handling. Ignored for level-2 objects, as only level-1 objects can have occlusion test.
Definition at line 2483 of file PureObject3D.cpp.
PureVector & PureObject3D::getAngleVec | ( | ) |
Gets the rotation angles.
Rotation angle is currently ignored for level-2 objects, they are rotated by the same factor as their level-1 parent object using the same pivot point. By default this property is (0.0f, 0.0f, 0.0f).
Definition at line 1922 of file PureObject3D.cpp.
const PureVector & PureObject3D::getAngleVec | ( | ) | const |
Gets the rotation angles.
Rotation angle is currently ignored for level-2 objects, they are rotated by the same factor as their level-1 parent object using the same pivot point. By default this property is (0.0f, 0.0f, 0.0f).
Definition at line 1934 of file PureObject3D.cpp.
TPureFloat PureObject3D::getBiggestAreaScaled | ( | ) | const |
Gets the biggest area of the object on either plane (XY, XZ or YZ), scaled by current scaling factor.
Note that if you change the geometry on your own without a call to setVertexTransferMode(), this may give outdated area. See details at recalculateBiggestAreaScaled(). This value is used by the engine to determine which object should be an occluder. Although occluder state can be turned on or off manually by SetOccluder(), the engine automatically sets this state whenever recalculateBiggestAreaScaled() is invoked either automatically or manually.
Definition at line 2053 of file PureObject3D.cpp.
const PureObject3D * PureObject3D::getBoundingBoxObject | ( | ) | const |
Gets the bounding box object used for occlusion tests.
Level-2 objects never have bounding box, only their level-1 parent object might have one.
Definition at line 2471 of file PureObject3D.cpp.
|
virtual |
Gets the number of faces/polygons formed by the vertices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1734 of file PureObject3D.cpp.
|
virtual |
Gets the number of triangles sent to graphics pipeline by the last transferVertices() call.
Same functionality as defined originally in PureVertexTransfer::getLastTransferredTriangleCount() but extended with awareness of:
Reimplemented from PureVertexTransfer.
Definition at line 1844 of file PureObject3D.cpp.
|
virtual |
Gets the number of vertices sent to graphics pipeline by the last transferVertices() call.
Same functionality as defined originally in PureVertexTransfer::getLastTransferredVertexCount() but extended with awareness of:
Reimplemented from PureVertexTransfer.
Definition at line 1816 of file PureObject3D.cpp.
|
static |
Returns the logger module name of this class.
Intentionally not virtual, so derived class should hide this instead of overriding. Not even private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.
Definition at line 1581 of file PureObject3D.cpp.
CConsole & PureObject3D::getManagedConsole | ( | ) | const |
Returns access to console preset with logger module name as this class.
Intentionally not virtual, so the getConsole() in derived class should hide this instead of overriding.
Definition at line 1568 of file PureObject3D.cpp.
Gets the greatest index in the vertex indices array.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1702 of file PureObject3D.cpp.
Gets the smallest index in the vertex indices array.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1692 of file PureObject3D.cpp.
Gets the pointer to normals.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1723 of file PureObject3D.cpp.
|
virtual |
Gets the primitives' format.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1613 of file PureObject3D.cpp.
PureObject3D * PureObject3D::getReferredObject | ( | ) | const |
Gets the original object which was cloned to create this object.
Definition at line 1868 of file PureObject3D.cpp.
const std::set< PureObject3D * > & PureObject3D::getReferrerObjects | ( | ) | const |
Gets the cloned objects referring to this object.
Definition at line 1878 of file PureObject3D.cpp.
|
virtual |
Gets the mesh-local relative position.
This position tells the offset of the vertex positions relative to the center of the mesh [0,0,0]. For level-2 (sub)mesh, this vector is always expected to be [0,0,0] since the position of submeshes is calculated with vertex positions and size.
Addition to PureMesh3D behavior: the Mesh3D part of a cloned object does not have its own geometry, thus even Mesh3D::RecalculateSize() would calculate it to 0. Thus if we are a cloned object, we need to return the relative position vector of the object we are referring to.
Reimplemented from PureMesh3D.
Definition at line 1950 of file PureObject3D.cpp.
TPURE_ROTATION_ORDER PureObject3D::getRotationOrder | ( | ) | const |
Gets the rotation order.
Rotation order is currently ignored for level-2 objects, they are rotated the same way as their level-1 parent object. By default this property is PURE_YXZ.
Definition at line 2162 of file PureObject3D.cpp.
PureVector PureObject3D::getScaledSizeVec | ( | ) | const |
Gets the real sizes considering the geometry size calculated from vertex data and the current scaling factor.
Definition at line 1974 of file PureObject3D.cpp.
const PureVector & PureObject3D::getScaling | ( | ) | const |
Gets the scaling factor.
By default this property is (1.0f, 1.0f, 1.0f).
Definition at line 1985 of file PureObject3D.cpp.
|
virtual |
Gets the base sizes.
Addition to PureMesh3D behavior: the Mesh3D part of a cloned object does not have its own geometry, thus even Mesh3D::RecalculateSize() would calculate it to 0. Thus if we are a cloned object, we need to return the size of the object we are referring to.
Reimplemented from PureMesh3D.
Definition at line 1964 of file PureObject3D.cpp.
TPURE_TRANSFORMED_VERTEX * PureObject3D::getTransformedVertices | ( | TPureBool | implicitAccessSubobject = true | ) |
Gets the pointer to transformed vertices.
These are generated only during first rendering. This value is irrelevant for a level-1 object since the geometry is owned by its level-2 subobjects. Still the returned value for a level-1 object can be a non-NULL value, see below.
Definition at line 1910 of file PureObject3D.cpp.
const TPURE_TRANSFORMED_VERTEX * PureObject3D::getTransformedVertices | ( | TPureBool | implicitAccessSubobject = true | ) | const |
Gets the pointer to transformed vertices.
These are generated only during first rendering. This value is irrelevant for a level-1 object since the geometry is owned by its level-2 subobjects. Still the returned value for a level-1 object can be a non-NULL value, see below.
Definition at line 1894 of file PureObject3D.cpp.
|
virtual |
Gets the number of triangles formed by the vertices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1744 of file PureObject3D.cpp.
|
virtual |
Gets the amount of allocated system memory.
It includes the allocated Material size as well (getMaterial(false)). Level-1 (parent) objects summarize the memory usage of their level-2 subobjects and include it in the returned value.
Reimplemented from PureVertexTransfer.
Definition at line 2497 of file PureObject3D.cpp.
|
virtual |
Gets the amount of allocated video memory.
The details of this function are described in VertexTransfer class.
If this is a cloned object, the returned value is usually 0 since it just refers to the mesh- and bounding box geometries of the original object. Small amount of extra video memory might be also used for the bounding box object utilized by this object.
Reimplemented from PureVertexTransfer.
Definition at line 2520 of file PureObject3D.cpp.
|
virtual |
Gets an index value from the vertex indices array.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1712 of file PureObject3D.cpp.
|
virtual |
Gets the pointer to vertex indices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1670 of file PureObject3D.cpp.
|
virtual |
Gets the number of total vertex indices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry, but it would be misleading to report 0.
Reimplemented from PureMesh3D.
Definition at line 1659 of file PureObject3D.cpp.
|
virtual |
Gets the type of the indices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1681 of file PureObject3D.cpp.
|
virtual |
Gets vertex modifying habit.
The details of this function are described in PureVertexTransfer class.
Addition to PureVertexTransfer behavior: if this is a cloned object, the returned value is the same as the referred object's value.
Reimplemented from PureVertexTransfer.
Definition at line 1754 of file PureObject3D.cpp.
|
virtual |
Gets vertex referencing mode.
The details of this function are described in PureVertexTransfer class.
Addition to PureVertexTransfer behavior: if this is a cloned object, the returned value is the same as the referred object's value.
Reimplemented from PureVertexTransfer.
Definition at line 1764 of file PureObject3D.cpp.
|
virtual |
Gets vertex transfer mode.
The details of this function are described in PureVertexTransfer class.
Addition to PureVertexTransfer behavior: if this is a cloned object, the returned value is the same as the referred object's value.
Reimplemented from PureVertexTransfer.
Definition at line 1774 of file PureObject3D.cpp.
Gets the pointer to vertices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1647 of file PureObject3D.cpp.
Gets the pointer to vertices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry.
Reimplemented from PureMesh3D.
Definition at line 1636 of file PureObject3D.cpp.
|
virtual |
Gets the number of total vertices.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, the returned value is the referred object's relevant value. This additional behavior is needed since a cloned object doesn't have its own geometry, but it would be misleading to report 0.
Reimplemented from PureMesh3D.
Definition at line 1625 of file PureObject3D.cpp.
void PureObject3D::Hide | ( | ) |
Disables rendering of this object.
Equivalent to SetRenderingAllowed(false). See the details there.
Definition at line 2125 of file PureObject3D.cpp.
TPureBool PureObject3D::isAffectingZBuffer | ( | ) | const |
Gets whether we write to the Z-Buffer while rendering.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is true.
Definition at line 2289 of file PureObject3D.cpp.
TPureBool PureObject3D::isColliding_TO_BE_REMOVED | ( | ) | const |
Gets whether colliding is enabled.
Legacy function unrelated to the purpose of this class, will need to be removed! By default this property is false.
Definition at line 2137 of file PureObject3D.cpp.
TPureBool PureObject3D::isDoubleSided | ( | ) | const |
Gets the double sided state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false.
Definition at line 2212 of file PureObject3D.cpp.
|
virtual |
Tells if the mesh is a level-1 parent mesh.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, it is definitely level-1 since only level-1 objects can be cloned, and although they don't have their own level-2 subobject, they use the referred level-1 object's subobjects like they were their own.
Reimplemented from PureMesh3D.
Definition at line 1592 of file PureObject3D.cpp.
|
virtual |
Tells if the mesh is a level-2 submesh.
The details of this function are described in PureMesh3D class.
Addition to PureMesh3D behavior: if this is a cloned object, it is definitely level-1 since only level-1 objects can be cloned, and although they don't have their own level-2 subobject, they use the referred level-1 object's subobjects like they were their own.
Reimplemented from PureMesh3D.
Definition at line 1602 of file PureObject3D.cpp.
TPureBool PureObject3D::isLit | ( | ) | const |
Gets the lit state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is true.
Definition at line 2187 of file PureObject3D.cpp.
TPureBool PureObject3D::isOccluded | ( | ) | const |
Gets whether this object was occluded or not based on the last finished occlusion test.
This last state might be a few rendered frames behind the current occlusion status, as occlusion tests might not be finished in the same frame they are started. By default this property is false after creating the object, but might be changed after the first few rendered frames.
For more details on occlusion testing, read description of SetOcclusionTested().
Definition at line 2416 of file PureObject3D.cpp.
TPureBool PureObject3D::isOccluder | ( | ) | const |
Gets whether this object should be considered as an occluder during rendering.
Occluders are rendered before non-occluder objects. This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is decided based on the size of the object compared to other objects. More info about this can be read at the description of SetOccluder().
Definition at line 2375 of file PureObject3D.cpp.
TPureBool PureObject3D::isOcclusionTested | ( | ) | const |
Gets whether this object is being tested if it is occluded or not.
For more details on occlusion testing, read description of SetOcclusionTested().
Definition at line 2428 of file PureObject3D.cpp.
TPureBool PureObject3D::isRenderingAllowed | ( | ) | const |
Gets if rendering is allowed.
If rendering is not allowed, it is not rendered. This property is manual user setting, not related to any visibility testing that might be done by renderer. This means that even if the object is seen by the camera, not occluded by other object, it won't be rendered if this property is manually set to false. Similarly, if the object is occluded by other objects and isOccluded() returns true, this manual visibility setting can stay true, since it is user's preference. By default this property is true.
Definition at line 2088 of file PureObject3D.cpp.
TPureBool PureObject3D::isStickedToScreen | ( | ) | const |
Gets the sticked-to-screen state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false.
Definition at line 2340 of file PureObject3D.cpp.
TPureBool PureObject3D::isTestingAgainstZBuffer | ( | ) | const |
Gets whether we test against the Z-Buffer while rendering.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is true.
Definition at line 2315 of file PureObject3D.cpp.
TPureBool PureObject3D::isWireframed | ( | ) | const |
Gets the wireframed state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false.
Definition at line 2237 of file PureObject3D.cpp.
TPureBool PureObject3D::isWireframedCulled | ( | ) | const |
Gets the wireframed culling state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false.
Definition at line 2264 of file PureObject3D.cpp.
|
protected |
Definition at line 2594 of file PureObject3D.cpp.
TPureFloat PureObject3D::recalculateBiggestAreaScaled | ( | ) |
Recalculates biggest area of object on either plane (XY, XZ or YZ), scaled by current scaling factor.
This function is automatically called when scaling factor is changed or when setVertexTransferMode() is invoked. However, getBiggestAreaScaled() may sometimes give you stale result, for example, after you change the mesh geometry (e.g. through accessing them with PureMesh3D::getVertices() ), and don't invoke setVertexTransferMode() to upload changed geometry to host (e.g. because you keep geometry in client memory). In such case it is recommended to invoke this function yourself. This value is used by the engine to determine which object should be an occluder. Although occluder state can be turned on or off manually by SetOccluder(), the engine automatically sets this state whenever recalculateBiggestAreaScaled() is invoked either automatically or manually.
Definition at line 2072 of file PureObject3D.cpp.
|
protectedvirtual |
Reset counters used for measuring number of vertices, triangles, etc.
Same functionality as defined originally in PureVertexTransfer::ResetLastTransferredCounts() but extended with awareness of:
sent to the graphics pipeline by the last transferVertices().
Reimplemented from PureVertexTransfer.
Definition at line 2608 of file PureObject3D.cpp.
void PureObject3D::Scale | ( | const PureVector & | value | ) |
Scales by the given vector.
Scaling factor is currently ignored for level-2 objects, they are scaled by the same factor as their level-1 parent object. By default this property is (1.0f, 1.0f, 1.0f).
value | The vector to be scalen by. |
Definition at line 2037 of file PureObject3D.cpp.
void PureObject3D::Scale | ( | TPureFloat | value | ) |
Scales by the given scalar value.
Scaling factor is currently ignored for level-2 objects, they are scaled by the same factor as their level-1 parent object. By default this property is (1.0f, 1.0f, 1.0f).
value | The factor to be scalen by. |
Definition at line 2024 of file PureObject3D.cpp.
void PureObject3D::SetAffectingZBuffer | ( | TPureBool | value | ) |
Sets whether we write to the Z-Buffer while rendering.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is true. If set to false, the object's occluder state will be also forced to false.
value | The desired state. |
Definition at line 2303 of file PureObject3D.cpp.
void PureObject3D::SetColliding_TO_BE_REMOVED | ( | TPureBool | value | ) |
Sets whether colliding is enabled.
Legacy function unrelated to the purpose of this class, will need to be removed! By default this property is false.
value | The desired state. |
Definition at line 2150 of file PureObject3D.cpp.
void PureObject3D::SetDoubleSided | ( | TPureBool | value | ) |
Sets the double sided state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false.
value | The desired state. |
Definition at line 2225 of file PureObject3D.cpp.
void PureObject3D::SetLit | ( | TPureBool | value | ) |
Sets the lit state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is true.
value | The desired state. |
Definition at line 2200 of file PureObject3D.cpp.
void PureObject3D::SetOccluder | ( | TPureBool | value | ) |
Sets whether this object should be considered as an occluder during rendering.
Occluders are rendered before non-occluder objects. This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is decided based on the size of the object compared to other objects. The following properties are incompatible with occluder state:
Note that renderer might invoke PureObject3DManager::UpdateOccluderStates() that can override your manual setting. This function is mostly for the engine to switch occluder state, not for the user. In the future this might change though.
value | The desired state. |
Definition at line 2399 of file PureObject3D.cpp.
void PureObject3D::SetOcclusionTested | ( | TPureBool | state | ) |
Sets whether this object should be tested if it is occluded or not.
Sets whether this object should be tested for occlusion or not.
Creates or deletes an occlusion query object and bounding box for the given object. If it failes to generate occlusion query id, the object won't be tested for occlusion later. Check state with isOcclusionTested() member function. This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object.
Important: if you turn occlusion testing off for an object referred by other cloned objects, the occlusion testing is also implicitly turned off for those referring cloned objects. However, later you can still turn occlusion testing on for the specific cloned objects if you want to, without affecting the occlusion testing state of the original object referred by the cloned object.
Occlusion status of objects having occlusion test enabled are continuously checked by renderer, so rendering the scene is needed to have these test done. The result can be obtained with isOccluded() member function after rendering at least a few frames. The renderer can optimize scene rendering by not skipping occluded objects, however occlusion testing is needed to decide if an object is occluded or not. Too many occlusion tests might also impact performance negatively, hence it is not recommended to turn occlusion testing on for every single objects in the scene.
By default this property is decided based on the geometric complexity of the object.
Occlusion tests are curently based on hardware occlusion queries, so this is not available on all hardware. Usually it is available since 2003 on desktop computers. Mobile is not yet supported by PURE. Occlusion tests are not supported when software rendering is active.
std::runtime_error | - In case of inability of creating bounding box object or if this object instance doesn't have manager associated. |
Definition at line 2459 of file PureObject3D.cpp.
void PureObject3D::SetRenderingAllowed | ( | TPureBool | state | ) |
Sets if rendering is allowed.
If rendering is not allowed, it is not rendered. This property is manual user setting, not related to any visibility testing that might be done by renderer. This means that even if the object is seen by the camera, not occluded by other object, it won't be rendered if this property is manually set to false. Similarly, if the object is occluded by other objects and isOccluded() returns true, this manual visibility state can stay true, since it is user's preference. By default this property is true. If set to false, the object's occluder state will be also forced to false.
value | The desired state: true to let the object be rendered, false to hide (skip rendering) it. |
Definition at line 2105 of file PureObject3D.cpp.
void PureObject3D::SetRotationOrder | ( | TPURE_ROTATION_ORDER | value | ) |
Sets the rotation order.
Rotation order is currently ignored for level-2 objects, they are rotated the same way as their level-1 parent object. By default this property is PURE_YXZ.
value | The desired state. |
Definition at line 2175 of file PureObject3D.cpp.
void PureObject3D::SetScaling | ( | const PureVector & | value | ) |
Sets the scaling factor to given vector.
Scaling factor is currently ignored for level-2 objects, they are scaled by the same factor as their level-1 parent object. By default this property is (1.0f, 1.0f, 1.0f).
value | The desired scaling factor. |
Definition at line 2011 of file PureObject3D.cpp.
void PureObject3D::SetScaling | ( | TPureFloat | value | ) |
Sets the scaling factor to given scalar.
Scaling factor is currently ignored for level-2 objects, they are scaled by the same factor as their level-1 parent object. By default this property is (1.0f, 1.0f, 1.0f).
value | The desired scaling factor. |
Definition at line 1998 of file PureObject3D.cpp.
void PureObject3D::SetStickedToScreen | ( | TPureBool | value | ) |
Sets the sticked-to-screen state.
Sticked to screen means the object is rendered with orthogonal projection and not overlapped by non-sticked objects. Suitable for 2D object rendering such as GUI elements. Note that this call not only changes sticked state of the object but also calls the following methods:
value | The desired state. |
Definition at line 2360 of file PureObject3D.cpp.
void PureObject3D::SetTestingAgainstZBuffer | ( | TPureBool | value | ) |
Sets whether we test against the Z-Buffer while rendering.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is true.
value | The desired state. |
Definition at line 2328 of file PureObject3D.cpp.
|
virtual |
Sets vertex transfer mode.
The details of this function are described in PureVertexTransfer class.
Same functionality as defined originally in PureVertexTransfer::setVertexTransferMode() but extended with a check for being a cloned object or not. This function has no effect when called for a cloned object.
vtrans | Vertex referencing mode to be set. |
Reimplemented from PureVertexTransfer.
Definition at line 1787 of file PureObject3D.cpp.
void PureObject3D::SetWireframed | ( | TPureBool | value | ) |
Sets the wireframed state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false. If set to true, the object's occluder state will be forced to false.
value | The desired state. |
Definition at line 2251 of file PureObject3D.cpp.
void PureObject3D::SetWireframedCulled | ( | TPureBool | value | ) |
Sets the wireframed culling state.
This property is currently ignored for level-2 objects, they inherit this property from their level-1 parent object. By default this property is false.
value | The desired state. |
Definition at line 2277 of file PureObject3D.cpp.
void PureObject3D::Show | ( | ) |
Enables rendering of this object.
Equivalent to SetRenderingAllowed(true). See the details there.
Definition at line 2115 of file PureObject3D.cpp.
|
friend |
Definition at line 209 of file PureObject3DManager.h.
|
private |
Definition at line 207 of file PureObject3DManager.h.