![]() |
VR-Forces Developer's Guide
|
A class which represents a component for a decal projector.
This is part of a component/system concept. In this case the system portion is handled by DtDecalProjectorRenderer.
To use this component, you get the DtDecalProjectorRenderer from the DtOverlayRenderer that you are working with. Then call createComponent using the DtDecalProjectorRenderer::createComponent method. The component takes care of registering/unregistering itself with the DtDecalProjectorRenderer, but you must handle freeing the component when no longer using it because DtDecalProjectorRenderer does not own it.
This component is used for projecting geometry onto a surface/terrain. Triangles and lines are currently supported by the renderer. The staging geometry in general is meant to lay on the same plane but it does not have to be perfectly flat.

Public Types | |
| enum | RenderingType { RenderingTypeLine = 0, RenderingTypeTriangle } |
Public Member Functions | |
| DtDecalProjectorComponentInterface () | |
| virtual | ~DtDecalProjectorComponentInterface () |
| virtual void | setProjectionRange (float projNear, float projFar)=0 |
| virtual void | projectionRange (float &projNear, float &projFar) const =0 |
| virtual void | resizeStagingVertexCount (size_t size)=0 |
| virtual void | setStagingVertexPosition (unsigned int index, double x, double y, double z)=0 |
| virtual void | expandStagingPointsToLines ()=0 |
| virtual void | expandStagingPointsToLineQuads (float lineWidth)=0 |
| virtual void | stagingGeometryUpdated ()=0 |
| virtual void | setColor (float r, float g, float b, float a)=0 |
| virtual void | getColor (float &r, float &g, float &b, float &a) const =0 |
| virtual void | projectUVCoordinates (const DtVector &origin, const DtVector &axisU, const DtVector &axisV)=0 |
| virtual void | getUVCoordinateProjection (DtVector3< float > &origin, DtVector3< float > &axisU, DtVector3< float > &axisV) const =0 |
| virtual void | setStipplePattern (unsigned int stipplePattern[32]=0)=0 |
| virtual const unsigned int * | getStipplePattern () const =0 |
| virtual void | setFillPatternFrequency (float frequency)=0 |
| virtual float | fillPatternFrequency () const =0 |
| virtual void | setAllowAltitudeTileMultiplier (bool allow)=0 |
| virtual bool | allowAltitudeTileMultiplier () const =0 |
| virtual void | setTexture (DtTextureInterface *texture)=0 |
| virtual DtTextureInterface * | texture () const =0 |
| virtual bool | pick (double x, double y, double z) const =0 |
| makVrv::DtDecalProjectorComponentInterface::DtDecalProjectorComponentInterface | ( | ) |
CTOR.
|
virtual |
DTOR.
|
pure virtual |
Sets the back/forward projection range of the decal. The range is in reference to the origin of the points. This is similar to a near/far clip range.
| projNear | The near distance to project (can be negative behind the origin) |
| projFar | The far distance to project (should be > projNear) example: setProjectionRange(-100.0, 500.0) would project on something up to 100 meters behind the origin and 500 meters in front of the origin. |
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Gets the back/forward projection range of the decal. (see setProjectionRange)
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Sets the current staging vertex count.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Sets the position of a staging vertex.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Takes the current staging points and treats them as a line loop. Expands staging points to hold unique points for each primitive.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Takes the current staging points and treats them as a line loop. Each line will be converted to 2 triangles that form a quad in the topo plane. Expands staging points to hold unique points for each primitive.
| lineWidth | The width in meters of the line quad |
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Called after all staging gemoetry has been updated. Internally computes bounding information, and prepares data for rendering draw passes.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Set the color of all vertices.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Get the color of all vertices.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Does uv coordinate projection based on the current vertex positions and the given projection parameters.
| origin | - each vertex position will subtract the origin |
| axisU | - the X axis to project the position along for the u coordinate |
| axisV | - the Y axis to project the position along for the v coordinate |
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Set a stipple pattern to be used for rendering.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Get the stipple pattern used for rendering.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Sets the fill pattern tiling frequency. The frequency needs to be 1 / x where x is a whole number. examples: frequency = 1.0 : the tiled pattern will tile normally frequency = 0.5 : the tiled pattern will appear half as often.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Returns the fill pattern tiling frequency.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
The texture tiling will be modified at descrete levels based on viewing from different altitudes. This method sets whether or not that should be allowed.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
The texture tiling will be modified at descrete levels based on viewing from different altitudes. This method returns whether or not that should be allowed.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Sets a texture handle to use for rendering. The texture will be used instead of the stipple pattern.
| texture | The texture handle from DtOverlayResourceProvider. |
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Gets the texture handle used for rendering.
Implemented in makVrv::DtDecalProjectorComponent.
|
pure virtual |
Returns true if the given location would be in the decal projection space.
| (x,y,z) | The surface location in local VRV space |
Implemented in makVrv::DtDecalProjectorComponent.