|
resonance 1.0.1
|
Run of consecutive tunnel slices a Rnd::TunnelSeeker highlights on one ring. More...
#include <tunnelseekstrip.h>

Public Member Functions | |
| TunnelSeekStrip () | |
| Construct an empty strip with a white colour. | |
| ~TunnelSeekStrip () | |
| Release the material reference and destroy the strip. | |
| void | Clear () |
| Release the material reference and empty the sections. | |
| void | SetRange (int nFirstSlice, int nSliceCount, int nRing) |
| Place the strip on a run of slices. | |
| void | Refresh () |
| Place the strip again on the run it last received. | |
| void | Build (Tunnel *pTunnel, TunnelSeeker *pOwner, int nIndex) |
| Generate the sections for a tunnel. | |
| void | SetMat (Mat *pMat) |
| Replace the material and hand it to the finest mesh of every section. | |
| void | SetColor (const Color &color) |
| Store a colour and recolour every section already updated. | |
| void | DrawSection (int nSlice, float flScreenSize) |
| Draw the section placed on one slice. | |
| void | Replace (Object *pFrom, Object *pTo, Object *pReferrer) |
| Replace the material reference. | |
Public Attributes | |
| int | mFirstSlice |
| int | mSliceCount |
| int | mRing |
| Color | mColor |
| Mat * | mMat |
| Tunnel * | mTunnel |
| TunnelSeeker * | mOwner |
| int | mStepNumerator |
| int | mStepSize |
| int | mStepCount |
| std::vector< TunnelSeekSection > | mSections |
Run of consecutive tunnel slices a Rnd::TunnelSeeker highlights on one ring.
The record is not polymorphic and has no RTTI. The name is inferred from its owner, the record the tunnel stores one of per seeker, and from the "_seek" titles of the meshes its sections generate.
The record is 0x50 bytes and is the first member of Rnd::TunnelSeeker. The sections form a ring buffer of three, indexed by slice modulo the section count, so the strip never shows more than three slices at once.
The copy constructor is the implicit one, emitted at 0x00471e90. It copies the leading members word by word, mColor as one quadword, and then mSections element by element through the implicit copy constructor of Rnd::TunnelSeekSection.
| Rnd::TunnelSeekStrip::TunnelSeekStrip | ( | ) |
Construct an empty strip with a white colour.
The step counters at +0x30 and +0x34 are left unset until Build().
|
inline |
Release the material reference and destroy the strip.
The image has no separate copy. The body is inlined into the implicit destructor of Rnd::TunnelSeeker at 0x00477cc0, which calls Clear() and then frees the section storage.
| void Rnd::TunnelSeekStrip::Clear | ( | ) |
Release the material reference and empty the sections.
mTunnel is cleared as well, and mMat is not.
| void Rnd::TunnelSeekStrip::SetRange | ( | int | nFirstSlice, |
| int | nSliceCount, | ||
| int | nRing ) |
Place the strip on a run of slices.
Every section is invalidated first. The count is clamped to the section count, and each slice of the run is placed in the section its slice index selects, with the first flagged as the start cap and the last as the end cap.
| nFirstSlice | The first slice of the run. |
| nSliceCount | The number of slices. |
| nRing | The ring. |
| void Rnd::TunnelSeekStrip::Refresh | ( | ) |
Place the strip again on the run it last received.
| void Rnd::TunnelSeekStrip::Build | ( | Tunnel * | pTunnel, |
| TunnelSeeker * | pOwner, | ||
| int | nIndex ) |
Generate the sections for a tunnel.
Creates three sections called "[<tunnel>_seek<index>.<section>]" from the first cell of the tunnel mesh grid, hands mMat to the finest mesh of each, copies the tunnel step counters, takes a reference on mMat on behalf of the tunnel, and then calls Refresh().
| pTunnel | The tunnel. |
| pOwner | The seeker that owns the strip. |
| nIndex | The index of the seeker, used in the mesh titles. |
| void Rnd::TunnelSeekStrip::SetMat | ( | Mat * | pMat | ) |
Replace the material and hand it to the finest mesh of every section.
| pMat | The material, or null. |
| void Rnd::TunnelSeekStrip::SetColor | ( | const Color & | color | ) |
Store a colour and recolour every section already updated.
A dirty section takes the colour when Update() next copies its geometry.
| color | The colour. |
| void Rnd::TunnelSeekStrip::DrawSection | ( | int | nSlice, |
| float | flScreenSize ) |
Draw the section placed on one slice.
Does nothing unless the section the slice selects is placed on that slice. A dirty section is updated first, and the level of detail is chosen against flScreenSize the way Rnd::LodMesh chooses it.
| nSlice | The slice being drawn. |
| flScreenSize | The screen size used to pick the level of detail. |
Replace the material reference.
| pFrom | The object being replaced. |
| pTo | The replacement, which must be a Rnd::Mat or null. |
| pReferrer | The object the reference is held on behalf of. |
| int Rnd::TunnelSeekStrip::mFirstSlice |
The first slice of the run.
| int Rnd::TunnelSeekStrip::mSliceCount |
The number of slices in the run.
| int Rnd::TunnelSeekStrip::mRing |
The ring of the run.
| Color Rnd::TunnelSeekStrip::mColor |
The vertex colour of the sections.
| Mat* Rnd::TunnelSeekStrip::mMat |
The material of the sections.
| Tunnel* Rnd::TunnelSeekStrip::mTunnel |
The tunnel, which holds the references.
| TunnelSeeker* Rnd::TunnelSeekStrip::mOwner |
The owning seeker.
| int Rnd::TunnelSeekStrip::mStepNumerator |
The tunnel step numerator, truncated.
| int Rnd::TunnelSeekStrip::mStepSize |
mStepNumerator divided by mStepCount.
| int Rnd::TunnelSeekStrip::mStepCount |
The tunnel step divisor.
| std::vector<TunnelSeekSection> Rnd::TunnelSeekStrip::mSections |
The section ring buffer.