|
wavelength 1.0.0
|
Line through points, drawn as a ribbon of constant screen width that faces the camera. More...
#include <rndline.h>


Classes | |
| class | Point |
| One point and what drawing derives from it. More... | |
| struct | PointVerts |
| The mesh vertices of a point. More... | |
Public Member Functions | |
| RndLine (const char *pszName) | |
| Construct a white, unit-width line without points, with caps and a fold at a quarter turn. | |
| ~RndLine () override | |
| Delete the mesh. | |
| void | ListDrawObjects (std::list< RndObject * > &objects) override |
| Add the material of the mesh to a list. | |
| void | ListDrawables (std::list< RndDrawable * > &drawables) override |
| Add the line, when its mesh has something to draw, then the children, to a list. | |
| void | SetHighlight (int nHighlight) override |
| Set the highlight of the mesh. | |
| int | DrawShowing () override |
| Build the ribbon facing the current camera and draw it. | |
| void | Collide (const Segment &segment, std::list< Collision > &collisions) override |
| Add each face of the mesh the segment strikes, as strikes of the line, then what the children strike, to a list. | |
| void | DumpText (PrnStream &stream) override |
| Write a description of the line and its bases. | |
| void | Save (BinStream &stream) override |
| Write the line and its bases. | |
| void | Replace (RndObject *pFrom, RndObject *pTo) override |
| Replace a referenced object with another in the bases. | |
| const char * | ClassName () const override |
| Report the class name. | |
| void | Copy (const RndObject *pSource, int nFlags) override |
| Copy another line and its bases, then rebuild the mesh. | |
| void | Load (BinStream &stream) override |
| Read what Save() wrote, or an earlier version of it, then rebuild the mesh. | |
| RndMat * | Mat () const |
| Report the material of the mesh. | |
| void | SetMat (RndMat *pMat) |
| Set the material of the mesh. | |
| void | SetFoldAngle (float fAngle) |
| Set the angle between segments at and beyond which the ribbon folds over. | |
| void | SetNumPoints (int nPoints) |
| Set the number of points, then size the mesh, its texture coordinates, colours, and faces to match. | |
| void | SetPoint (int nIndex, const Vector3 &point) |
| Set the position of a point. | |
| void | SetPointColor (int nIndex, const Color &color) |
| Set the colour of a point and of its mesh vertices. | |
| void | FindPointVerts (int nIndex, PointVerts &verts) |
| Find the mesh vertices of a point. | |
| void | ReleaseMesh () |
| Delete the mesh. | |
| void | BuildMesh () |
| Create the mesh for the points. | |
| void | BuildStrip (Point *pFirst, Point *pLast) |
| Fill the mesh positions with a ribbon through a run of points, extending the clipped points outside the run to its ends. | |
| void | BuildPair (Point *pFirst, Point *pSecond) |
| Fill the mesh positions with one segment of a line of pairs, or collapse it when both points are the same. | |
| const std::vector< Point > & | GetPoints () const |
| float | GetWidth () const |
| void | SetWidth (float fWidth) |
| virtual void | Collide (const Vector2 &point, std::list< Collision > &collisions) |
| Test a screen point against the collideable and add what it strikes to a list. | |
| Public Member Functions inherited from RndDrawable | |
| RndDrawable () | |
| Construct a showing drawable without a highlight or children. | |
| ~RndDrawable () override | |
| Drop the references on the children. | |
| virtual void | SetShowing (int nShowing) |
| Set whether the drawable draws at all. | |
| RndDrawable * | Parent () |
| Find the drawable whose children include this one. | |
| void | Draw () |
| Draw the drawable and then its children, when it is showing. | |
| bool | AddDraw (RndDrawable *pDraw, RndDrawable *pBefore) |
| Add a child before another. | |
| void | RemoveDraw (RndDrawable *pDraw) |
| Remove a child. | |
| void | ClearDraws () |
| Remove every child. | |
| int | GetShowing () const |
| const std::list< RndDrawable * > & | GetDraws () const |
| Public Member Functions inherited from RndObject | |
| RndObject (const char *pszName) | |
| Construct an object and register it under a name. | |
| virtual | ~RndObject () |
| Notify every referrer, then erase the registration. | |
| void | SetName (const char *pszName) |
| Register the object under a different name. | |
| void | AddRef (RndObject *pReferrer) |
| Register an object as a store of a pointer to this one. | |
| void | RemoveRef (RndObject *pReferrer) |
| Drop the first registration AddRef() made for a referrer. | |
| const char * | GetName () const |
| const std::list< RndObject * > & | GetRefs () const |
| int | GetInternal () const |
| void | SetInternal (int nInternal) |
| Public Member Functions inherited from RndTransformable | |
| RndTransformable () | |
| Construct a transformable with identity transforms, no origin offset, and no billboard. | |
| ~RndTransformable () override | |
| Drop the references on the children. | |
| virtual void | SetBillboard (int nBillboard) |
| Set the billboard mode. | |
| virtual int | UpdateWorldXfm (RndTransformable *pParent, int bForce) |
| Recompute the world transform when it, or the parent's, changed, and then the children's. | |
| void | DumpText (PrnStream &stream) override |
| Write a description of the transformable. | |
| void | Save (BinStream &stream) override |
| Write the transforms, the names of the children, the billboard mode, and the origin. | |
| void | Replace (RndObject *pFrom, RndObject *pTo) override |
| Replace a child with another object. | |
| void | Copy (const RndObject *pSource, int nFlags) override |
| Copy the transforms, the billboard mode, the origin, and the children when the flags request them. | |
| void | Load (BinStream &stream) override |
| Read what Save() wrote, or an earlier version of it. | |
| void | SetOrigin (const Vector3 &origin) |
| Set the point the world transform subtracts first when there is no billboard. | |
| RndTransformable * | Parent () |
| Find the transformable whose children include this object. | |
| bool | AddTrans (RndTransformable *pTrans) |
| Append a child and mark its world transform dirty. | |
| void | RemoveTrans (RndTransformable *pTrans) |
| Remove a child. | |
| void | ClearTrans () |
| Remove every child. | |
| const Transform & | BillboardXfm () |
| Report the world transform turned to face the current camera. | |
| const Transform & | GetLocalXfm () const |
| Transform & | GetLocalXfm () |
| void | SetLocalXfm (const Transform &xfm) |
| const Transform & | GetWorldXfm () const |
| Transform & | GetWorldXfm () |
| int | GetDirty () const |
| void | SetDirty (int nDirty) |
| const std::list< RndTransformable * > & | GetTransList () const |
| Public Member Functions inherited from RndCollideable | |
| RndCollideable () | |
| Construct a collideable without children. | |
| ~RndCollideable () override | |
| Drop the references on the children. | |
| RndCollideable * | Parent () |
| Find the collideable whose children include this one. | |
| bool | AddCollide (RndCollideable *pCollide) |
| Append a child. | |
| void | RemoveCollide (RndCollideable *pCollide) |
| Remove a child. | |
Static Public Member Functions | |
| static RndObject * | New (const char *pszName) |
| Create a line. | |
| Static Public Member Functions inherited from RndDrawable | |
| static void | CollectChildren (std::list< RndObject * > &objects, RndDrawable *pDrawable) |
| Append every draw descendant of a drawable, depth first, each before its descendants. | |
| Static Public Member Functions inherited from RndTransformable | |
| static void | CollectChildren (std::list< RndObject * > &objects, RndTransformable *pTransformable) |
| Append every transform descendant of a transformable, depth first, each before its descendants. | |
| Static Public Member Functions inherited from RndCollideable | |
| static void | CollectChildren (std::list< RndObject * > &objects, RndCollideable *pCollideable) |
| Append every collision descendant of a collideable, depth first, each before its descendants. | |
Static Public Attributes | |
| static const char * | sClassName |
| The class name a .rnd file writes, Line. | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| Static Public Attributes inherited from RndDrawable | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| Static Public Attributes inherited from RndObject | |
| static constexpr int | kCopyChildLists = 0x200 |
| The bit of the Copy() flags that copies the child lists of the mix-ins. | |
| Static Public Attributes inherited from RndTransformable | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| Static Public Attributes inherited from RndCollideable | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
Additional Inherited Members | |
| Public Types inherited from RndTransformable | |
| enum | Billboard { kBillboardNone = 0 , kBillboardX = 1 , kBillboardY = 2 , kBillboardZ = 4 , kBillboardXZ = 8 , kBillboardXYZ = 16 , kBillboardSimpleXYZ = 32 , kBillboardLocalRotate = 64 , kBillboardScale = 128 , kBillboardScaleX = 129 , kBillboardScaleY = 130 , kBillboardScaleZ = 132 , kBillboardScaleXZ = 136 , kBillboardScaleXYZ = 144 , kBillboardScaleSimpleXYZ = 160 } |
| How the world transform turns to face the current camera. More... | |
| Protected Member Functions inherited from RndDrawable | |
| void | ReleaseDrawRefs () |
| Drop the reference on every child without emptying the list. | |
| void | AcquireDrawRefs () |
| Take a reference on every child. | |
| Protected Member Functions inherited from RndTransformable | |
| void | ReleaseTransRefs () |
| Drop the reference on every child without emptying the list. | |
| void | AcquireTransRefs () |
| Take a reference on every child. | |
| Protected Member Functions inherited from RndCollideable | |
| void | ReleaseCollideRefs () |
| Drop the reference on every child without emptying the list. | |
| void | AcquireCollideRefs () |
| Take a reference on every child. | |
| Protected Attributes inherited from RndDrawable | |
| int | mShowing |
| Protected Attributes inherited from RndObject | |
| std::list< RndObject * > | mRefs |
| String | mName |
| Protected Attributes inherited from RndTransformable | |
| std::list< RndTransformable * > | mTransList |
| Transform | mLocalXfm |
| Transform | mWorldXfm |
| Vector3 | mOrigin |
| int | mDirty |
| int | mBillboard |
Line through points, drawn as a ribbon of constant screen width that faces the camera.
The RTTI includes the class name and records RndDrawable, RndTransformable, and RndCollideable as bases. The ribbon is a mesh the line rebuilds each time it is drawn. A line of pairs draws each pair of points as a separate segment.
|
explicit |
Construct a white, unit-width line without points, with caps and a fold at a quarter turn.
| pszName | The registry key. |
|
override |
Delete the mesh.
|
overridevirtual |
Add the material of the mesh to a list.
The children are not added.
| objects | The list to add to. |
Reimplemented from RndDrawable.
|
overridevirtual |
Add the line, when its mesh has something to draw, then the children, to a list.
| drawables | The list to add to. |
Reimplemented from RndDrawable.
|
overridevirtual |
Set the highlight of the mesh.
The line's own highlight is unchanged.
| nHighlight | Non-zero to highlight. |
Reimplemented from RndDrawable.
|
overridevirtual |
Build the ribbon facing the current camera and draw it.
Points nearer than the camera's near plane are clipped. A line wholly behind it, or with fewer than two points, is not drawn.
Reimplemented from RndDrawable.
|
overridevirtual |
Add each face of the mesh the segment strikes, as strikes of the line, then what the children strike, to a list.
A hidden line adds nothing.
| segment | The segment, in world space. |
| collisions | The list to add to. |
Reimplemented from RndCollideable.
|
overridevirtual |
Write a description of the line and its bases.
| stream | The stream to write to. |
Reimplemented from RndDrawable.
|
overridevirtual |
Write the line and its bases.
| stream | The stream to write to. |
Reimplemented from RndDrawable.
Replace a referenced object with another in the bases.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Reimplemented from RndDrawable.
|
inlineoverridevirtual |
Report the class name.
Implements RndObject.
|
overridevirtual |
Copy another line and its bases, then rebuild the mesh.
| pSource | The line to copy from. |
| nFlags | The set of fields to copy. |
Reimplemented from RndDrawable.
|
overridevirtual |
Read what Save() wrote, or an earlier version of it, then rebuild the mesh.
| stream | The stream to read from. |
Reimplemented from RndDrawable.
| RndMat * RndLine::Mat | ( | ) | const |
Report the material of the mesh.
| void RndLine::SetMat | ( | RndMat * | pMat | ) |
Set the material of the mesh.
| pMat | The material, or null. |
| void RndLine::SetFoldAngle | ( | float | fAngle | ) |
Set the angle between segments at and beyond which the ribbon folds over.
The name is inferred.
| fAngle | The angle in radians. |
| void RndLine::SetNumPoints | ( | int | nPoints | ) |
Set the number of points, then size the mesh, its texture coordinates, colours, and faces to match.
| nPoints | The number of points. |
| void RndLine::SetPoint | ( | int | nIndex, |
| const Vector3 & | point ) |
Set the position of a point.
| nIndex | The point. |
| point | The position. |
| void RndLine::SetPointColor | ( | int | nIndex, |
| const Color & | color ) |
Set the colour of a point and of its mesh vertices.
The name is inferred.
| nIndex | The point. |
| color | The colour. |
| void RndLine::FindPointVerts | ( | int | nIndex, |
| PointVerts & | verts ) |
Find the mesh vertices of a point.
The name is inferred.
| nIndex | The point. |
| verts | Receives the vertices. |
| void RndLine::ReleaseMesh | ( | ) |
Delete the mesh.
The name is inferred.
| void RndLine::BuildMesh | ( | ) |
Create the mesh for the points.
The name is inferred.
Fill the mesh positions with a ribbon through a run of points, extending the clipped points outside the run to its ends.
The name is inferred.
| pFirst | The first point of the run. |
| pLast | The last point of the run. |
Fill the mesh positions with one segment of a line of pairs, or collapse it when both points are the same.
The name is inferred.
| pFirst | The first point. |
| pSecond | The second point. |
|
inlinestatic |
Create a line.
| pszName | The registry key. |
|
inline |
|
inline |
|
inline |
| fWidth | The width of the ribbon on the screen. |
|
virtual |
Test a screen point against the collideable and add what it strikes to a list.
The base body tests the children.
| point | The screen point. |
| collisions | The list to add to. |
Reimplemented from RndCollideable.
|
static |
The class name a .rnd file writes, Line.
|
static |