|
resonance 1.0.1
|
Live trail of one held durable gem, a two-point ribbon that grows with the playhead. More...
#include <durgemstrip.h>
Public Member Functions | |
| DurGemStrip (Rnd::View *pView) | |
| Create the free strip's hidden two-point ribbon and add it to pView. | |
| ~DurGemStrip () | |
| Delete the ribbon. | |
| bool | Start (int nLane, const Color &color, int nId, float flFrame, float flBlend, float flWidth, Rnd::Mat *pMat) |
| Claim the strip for trail nId when it is free. | |
| void | Update (float flFrame) |
| Extend the head of the trail to flFrame and free the strip once the trail is behind. | |
| bool | Stop (int nId, float flFrame) |
| Extend and then stop the trail when it is trail nId. | |
| bool | GetHeadPos (float flFrame, Vector3 *pOut) |
| Report the lane position at flFrame when flFrame lies on the trail. | |
Live trail of one held durable gem, a two-point ribbon that grows with the playhead.
The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from the growing two-point strip it draws. DurGemTrails allocates six with the untagged scalar allocator (0x1c bytes) and hands each new trail to the first free one.
The trail runs from mStart to mEnd along lane mLane, at most 720 frames long. Once stopped, it stays in place until the playhead passes mEnd by 480 frames and the strip is freed.
|
explicit |
Create the free strip's hidden two-point ribbon and add it to pView.
The ribbon takes the next DurGemTrails::NewStringName() name.
| pView | The view that draws the ribbon. |
| DurGemStrip::~DurGemStrip | ( | ) |
Delete the ribbon.
The destructor of DurGemTrails inlines it. The out-of-line copy is the deleting form, which frees the object only when bit 0 of the flag is set, and it has no caller. Its place at the head of this unit, ahead of Start(), is what assigns it to this class rather than to DurGemRowString, whose destructor has the same body.
| bool DurGemStrip::Start | ( | int | nLane, |
| const Color & | color, | ||
| int | nId, | ||
| float | flFrame, | ||
| float | flBlend, | ||
| float | flWidth, | ||
| Rnd::Mat * | pMat ) |
Claim the strip for trail nId when it is free.
Both ends start at flFrame. DurGemTrails::StartStrip() inlines the body.
| nLane | The lane the trail follows. |
| color | The colour of both ends. |
| nId | The identifier of the trail. |
| flFrame | The tunnel frame the trail starts at. |
| flBlend | The position across the lane. |
| flWidth | The width of the ribbon. |
| pMat | The material the ribbon draws with. |
| void DurGemStrip::Update | ( | float | flFrame | ) |
Extend the head of the trail to flFrame and free the strip once the trail is behind.
A stopped trail does not extend. A trail longer than 720 frames moves its tail up behind the head. The strip is hidden and freed once flFrame passes mEnd by more than 480 frames.
| flFrame | The current tunnel frame. |
| bool DurGemStrip::Stop | ( | int | nId, |
| float | flFrame ) |
Extend and then stop the trail when it is trail nId.
DurGemTrails::StopStrip() inlines the body.
| nId | The identifier of the trail to stop. |
| flFrame | The tunnel frame the trail ends at. |
| bool DurGemStrip::GetHeadPos | ( | float | flFrame, |
| Vector3 * | pOut ) |
Report the lane position at flFrame when flFrame lies on the trail.
DurGemTrails::Update() inlines the body.
| flFrame | The tunnel frame to test. |
| pOut | Receives the position. |