![]() |
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.

Classes | |
| struct | DrawPassData |
| struct | StagingPoint |
| struct | TopoPoint |
Public Member Functions | |
| virtual | ~DtDecalProjectorComponent () |
| virtual void | setProjectionRange (float projNear, float projFar) |
| virtual void | projectionRange (float &projNear, float &projFar) const |
| virtual void | resizeStagingVertexCount (size_t size) |
| virtual void | setStagingVertexPosition (unsigned int index, double x, double y, double z) |
| virtual void | expandStagingPointsToLines () |
| virtual void | expandStagingPointsToLineQuads (float lineWidth) |
| virtual void | stagingGeometryUpdated () |
| virtual void | setColor (float r, float g, float b, float a) |
| virtual void | getColor (float &r, float &g, float &b, float &a) const |
| virtual void | projectUVCoordinates (const DtVector &origin, const DtVector &axisU, const DtVector &axisV) |
| virtual void | getUVCoordinateProjection (DtVector3< float > &origin, DtVector3< float > &axisU, DtVector3< float > &axisV) const |
| virtual void | setStipplePattern (unsigned int stipplePattern[32]=0) |
| virtual const unsigned int * | getStipplePattern () const |
| virtual void | setFillPatternFrequency (float frequency) override |
| virtual float | fillPatternFrequency () const override |
| virtual void | setAllowAltitudeTileMultiplier (bool allow) |
| virtual bool | allowAltitudeTileMultiplier () const |
| virtual bool | allowSparseTiling () const |
| virtual void | setTexture (DtTextureInterface *texture) |
| virtual DtTextureInterface * | texture () const |
| virtual bool | pick (double x, double y, double z) const |
Public Member Functions inherited from makVrv::DtDecalProjectorComponentInterface | |
| DtDecalProjectorComponentInterface () | |
| virtual | ~DtDecalProjectorComponentInterface () |
Protected Member Functions | |
| DtDecalProjectorComponent (DtDecalProjectorRenderer &renderer) | |
| void | setStagingPointFromVector (StagingPoint &outPoint, const DtVector &inPoint) const |
| virtual void | computeTopoTransform (DtCoordTransform &geocToTopo, DtVector &geocentricOrigin, const DtVector &localOrigin, DtCoordinateSystem &coordinateSystem) const |
| virtual void | updateProjectedUVCoordinates () |
| virtual void | computeDrawPasses () |
| virtual void | computeDrawPassBounds () |
| virtual void | computeProjectionRangeFromArea (float boundsSizeX, float boundsSizeY) |
| void | drawPassTransform (DtVector3< double > &origin, float *rotation) const |
| void | drawPassBoundingSphere (DtVector3< float > ¢er, float &radius) const |
| size_t | drawPassCount () const |
| size_t | passPointCount (unsigned int pass) const |
| const void * | passPoints (unsigned int pass) const |
| const void * | passPointsUVs (unsigned int pass) const |
| void | passBounds (unsigned int pass, DtVector &boundsMin, DtVector &boundsMax) |
| bool | pickTriangles (const DtVector3< float > &localPoint) const |
| bool | pickLines (const DtVector3< float > &localPoint, float radius) const |
| bool | pointInTriangle (const DtVector3< float > &point, const DtDecalProjectorComponent::TopoPoint pointA, const DtDecalProjectorComponent::TopoPoint pointB, const DtDecalProjectorComponent::TopoPoint pointC) const |
| float | squaredDistanceToLine (const DtVector3< float > &point, const DtDecalProjectorComponent::TopoPoint pointA, const DtDecalProjectorComponent::TopoPoint pointB) const |
Static Protected Member Functions | |
| static void | setPickLineRadius (float radius) |
Protected Attributes | |
| DtDecalProjectorRenderer & | myRenderer |
| float | myProjectionRangeNear |
| float | myProjectionRangeFar |
| bool | myAutoProjectionRange |
| unsigned int | myStipplePattern [32] |
| float | myColor [4] |
| float | myFillPatternFrequency |
| DtTextureInterface * | myTexture |
| bool | myAllowAltitudeTileMultiplier |
| bool | myUseProjectedTextureCoordinates |
| DtVector3< float > | myProjCoordsOrigin |
| DtVector3< float > | myProjCoordsAxisU |
| DtVector3< float > | myProjCoordsAxisV |
| DtVector | myDrawPassOrigin |
| DtQuat | myDrawPassRotationInvQuat |
| float | myDrawPassRotation [16] |
| DtVector3< float > | myDrawPassBoundsCenter |
| float | myDrawPassBoundsRadius |
| std::vector< StagingPoint > | myStagingPoints |
| std::vector< TopoPoint > | myTopoPoints |
| std::vector< TopoPoint > | myTopoPointsUVs |
| std::vector< DrawPassData > | myDrawPasses |
Static Protected Attributes | |
| static float | thePickLineRadius |
Friends | |
| class | DtDecalProjectorComponentCreator |
| class | DtDecalProjectorRenderer |
| class | DtDecalProjectorLineRenderer |
Additional Inherited Members | |
Public Types inherited from makVrv::DtDecalProjectorComponentInterface | |
| enum | RenderingType { RenderingTypeLine = 0, RenderingTypeTriangle } |
|
virtual |
DTOR.
|
protected |
CTOR.
|
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. |
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Gets the back/forward projection range of the decal. (see setProjectionRange)
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Sets the current staging vertex count.
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Sets the position of a staging vertex.
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Takes the current staging points and treats them as a segmented line. Expands staging points to hold unique points for each primitive.
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Takes the current staging points and treats them as a segmented line. 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 |
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Called after all staging gemoetry has been updated. Internally computes bounding information, and prepares data for rendering draw passes.
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Set the color of all vertices.
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Get the color of all vertices.
Implements makVrv::DtDecalProjectorComponentInterface.
|
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 |
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Set a stipple pattern to be used for rendering.
Implements makVrv::DtDecalProjectorComponentInterface.
Get the stipple pattern used for rendering.
Implements makVrv::DtDecalProjectorComponentInterface.
|
overridevirtual |
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.
Implements makVrv::DtDecalProjectorComponentInterface.
|
overridevirtual |
Returns the fill pattern tiling frequency.
Implements makVrv::DtDecalProjectorComponentInterface.
|
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.
Implements makVrv::DtDecalProjectorComponentInterface.
|
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.
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
The texture image can be set up to use a sparse tiling effect when texture tiling is used. In the case where texture uv coordinates were specifically defined and not automatically projected,the sparse tiling effect should not be used. This method returns true if the sparse tiling is allowed.
|
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. |
Implements makVrv::DtDecalProjectorComponentInterface.
|
virtual |
Gets the texture handle used for rendering.
Implements makVrv::DtDecalProjectorComponentInterface.
Returns true if the given location would be in the decal projection space.
| (x,y,z) | The surface location in local VRV space |
Implements makVrv::DtDecalProjectorComponentInterface.
|
protected |
Helper to set a staging point position value from a DtVector.
|
protectedvirtual |
Helper method to compute the current topo coordinate transform based on the current coordinate system and first vertex location.
|
protectedvirtual |
Updates uv coordinates for the current geometry with the current uv projection settings.
|
protectedvirtual |
Computes the draw pass data needed based on the renderer point count limit and the primitive topology (triangle, line, etc...). Creates "bins" of data that can then be aquired by the renderer for each draw pass.
|
protectedvirtual |
Computes the bounds for each draw pass. XY planer bounds is computed from points and Z bounds is set from the member variable (myProjectionRangeNear and myProjectionRangeFar).
|
protectedvirtual |
This is called to compute the projection range based on the given xy bounds size. This is olny called when myAutoProjectionRange is true. myAutoProjectionRange is true by default, but set to false if the projection range is set manually with setProjectionRange.
| boundsSizeX | - The current bounds size in the x direction |
| boundsSizeY | - The current bounds size in the y direction |
|
protected |
Gets the transform used for drawing the decals.
| origin | The parameter to receive the origin |
| rotation | The parameter to receive the rotation in the form of a 4x4 matrix array of 16 floats |
|
protected |
Gets the bounding sphere of all draw passes.
|
protected |
Returns the number of points available for the given pass index.
| pass | The draw pass index. |
Returns the 3D points local to the transform for the given draw pass index.
| pass | The draw pass index. |
Returns the 3D points uv's for the given draw pass index.
| pass | The draw pass index. |
|
protected |
Gets the local bounds for the given draw pass index.
| pass | The draw pass index. |
|
protected |
Helper for pick method to pick local triangles. Returns true if the point is in a triangle.
|
protected |
Helper for pick method to pick local lines. Returns true if the point is within the radius of the line.
|
protected |
Checks if the given point is in the given triangle. This check is 2D only. This method is in an inner loop so no virtual.
|
protected |
Computes the distance from the given point to the given line. This check is 2D only. This method is in an inner loop so no virtual.
|
staticprotected |
This sets the physical line radius (in meters) when computing if a line was picked or not during line picking. This may or may not match the size of the visual.
| radius | - The desired radius in meters |
|
friend |
|
friend |
|
friend |
|
staticprotected |
This is used as the physical line radius (in meters) when computing if a line was picked or not during line picking. This may or may not match the size of the visual. A customer could override this if desired.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |