100 static void *
operator new(
size_t nSize);
109 static void operator delete(
void *pBlock);
271 int nRing,
Transform *pOut,
float flAnimFrame,
float flRingBlend,
float flTangentScale);
461 float flFloorEdgeWeight,
462 float flCellEdgeBlendPerStep);
540 void SaveSectionMaterials(
Stream &stream);
552 void LoadSectionMaterials(
Stream &stream);
575 void BuildSliceMeshes();
586 void BuildLaneMeshes();
596 void BuildCellMeshes();
604 void ClearMaterialSectionLists();
617 void SetRingSectionFrames();
620 static int WrapIndex(
int nIndex,
int nCount) {
621 const int nRemainder = nIndex % nCount;
622 return nRemainder > -1 ? nRemainder : nRemainder + nCount;
660 float mFloorEdgeWeight;
661 float mCellEdgeBlendPerStep;
683 float mLaneChangeFrames;
716 std::vector<int> mPlacedSlices;
719 float mCellEdgeBlend;
721 float mSlicesPerFrame;
731 std::vector<LodMesh> mCellChains;
734 std::vector<LodMesh> mSliceChains;
737 int mWindowStartSlice;
740 std::vector<Transform> mRingXfms;
742 std::vector<LaneProfile> mLaneProfiles;
746 std::list<TunnelEvent> mEvents;
749 std::vector<TunnelSeeker> mSeekers;
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Animatable()
Construct an animatable with no children, no filters, and a zero frame.
Collideable()
Construct a collideable with no children.
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
Drawable()
Construct a visible drawable with no children.
Indexed triangle mesh with one material.
Definition mesh.h:46
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
Animation that drives one transformable from three keyframe channels.
Definition transanim.h:49
Procedural tunnel the game flies the player through.
Definition tunnel.h:72
virtual void SetFrameSelf(float flFrame)
Advance the tunnel to a frame.
virtual void FindCollisions(const Segment &ray, std::list< Collision > &collisions)
Test a ray against the tunnel and append what it strikes to sink.
void ApplyMeshLodScreenSizes(const std::vector< float > &screenSizes)
Replace the level of detail thresholds and apply them to every generated mesh.
virtual const HxStr & ClassName() const
Return the registered class name, "Tunnel".
int mRingCount
Definition tunnel.h:647
virtual void Copy(const Object *pSource, unsigned nFlags)
Copy another tunnel over this one.
friend class TunnelSeekStrip
Definition tunnel.h:752
void ResizeSeekers(unsigned nCount)
Set the number of seekers and attach each one to this tunnel.
void ScrollRings()
Bring every slice of the current window up to the advanced slice.
std::vector< float > mLodScreenSizes
Definition tunnel.h:691
void SetLaneChangeFrames(float flFrames)
Set mLaneChangeFrames.
TransAnim * mPath
Definition tunnel.h:667
void SetPath(TransAnim *pPath)
Replace the path the tunnel follows.
Mesh * GetRingSection(int nRing, int nSlice)
Report the first mesh of one ring of one slice.
void LerpRingSectionTangent(int nRing, Vector3 *pOut, float flWeight)
Blend the translation of one ring transform towards the next.
virtual void Save(Stream &stream)
Serialise the tunnel.
void AddEvent(Drawable *pObject, float flFrame, int nId, int nUser)
Schedule a drawable at a frame.
virtual void Load(Stream &stream)
Load the tunnel.
int mSliceCount
Definition tunnel.h:651
int MoveEvent(int nId, float flFrame)
Move the first event with an identifier to a new frame.
TunnelSeeker * GetSeeker(unsigned nIndex)
Report one seeker.
void GetPathXfm(Transform *pOut, float flFrame)
Evaluate the path at a frame.
void AdvanceRing(int nSlice)
Advance one slice and refresh the section frames.
void Update()
Regenerate the geometry that the current state calls for.
int RemoveEventsInRange(float flFrom, float flTo)
Remove every event whose frame lies in a half open range, dropping each reference.
int RemoveEvent(int nId)
Remove the first event with an identifier and drop its reference.
friend class TunnelSeeker
Definition tunnel.h:753
virtual void Replace(Object *pFrom, Object *pTo)
Replace one object reference with another.
void ForEachEvent(void(*pfnVisit)(Drawable *pObject, float flFrame, int nId, void *pUser), void *pUser)
Call a function once for every event, in frame order.
int mDrawPanels
Definition tunnel.h:700
Mesh * GetRingSection(int nSlice)
Report the first mesh of one slice.
int mDrawLattice
Definition tunnel.h:696
void Configure(float flRingRadius, int nRingCount, int nSliceCount, int nLodCount, float flFloorPull, float flLaneEdgeGap, float flFloorEdgeWeight, float flCellEdgeBlendPerStep)
Set the shape parameters and rebuild the geometry.
void SetLaneDividerColor(int nRing, int nSlice, const Color &color)
Colour the wall between one lane and the next on one slice.
void SetLaneFloorColor(const Color &color)
Colour the floor and the second end cap of every lane on every slice.
virtual void DumpText(Dbg &sink)
Write the tunnel to the engine text sink.
void ProjectSectionToCameraSpace(int nRing, Transform *pOut, float flAnimFrame, float flRingBlend, float flTangentScale)
Build the frame of a point on one ring at a path frame, with the ring pushed outwards.
int FrameToSlice(float flFrame)
Convert a frame to a slice.
void GetRingXfm(int nRing, Transform *pOut, float flFrame, float flBlend)
Build the frame of a point on one ring at a path frame.
int mCulledFarSlices
Definition tunnel.h:678
friend class TunnelSeekSection
Definition tunnel.h:751
virtual int DrawShowing()
Draw the tunnel.
Tunnel(const HxStr &name)
Construct a tunnel with no sections.
The rendering engine.
Definition animhelper.h:3
HxStr g_tunnelClassName
Registered class name of Rnd::Tunnel, the string "Tunnel".
int g_nTunnelLoadVersion
Stream revision of the tunnel currently being read.
Manager TheManager
The renderer's object registry.
void RegisterTunnelClass()
Register the "Tunnel" class with Rnd::Manager.
Definition tunnel.h:799
Object * CreateRegisteredTunnel(const HxStr &name)
Build a tunnel for the registered "Tunnel" class.
Tunnel * NewTunnel(const HxStr &name)
Allocate and construct a tunnel.
Linear colour with four float components.
Definition color.h:10
Line segment a collision query is run along.
Definition collideable.h:22
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:12