wavelength 1.0.0
Loading...
Searching...
No Matches
hudhilitebox.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/interpolator.h"
4#include "math/vector2.h"
5#include "math/vector3.h"
6#include "rnd/rndmat.h"
7#include "rnd/rndmesh.h"
8#include "rnd/rndview.h"
9
18public:
26
28 static constexpr int kNumBoxVerts = 16;
29
38
45 void Reset();
46
57 static void UnitToScreen(float *pfX0, float *pfY0, float *pfX1, float *pfY1);
58
70 void SetBoxRect(float fX0, float fY0, float fX1, float fY1, float fDuration);
71
79 void ShowBox(bool bShow);
80
91 void SetArrowTarget(float fX, float fY, float fAngle, float fDuration);
92
100 void ShowArrow(bool bShow);
101
109 void Update(float fTick);
110
111private:
112 RndView *mArrow;
113 RndMat *mArrowMat;
114 RndMesh *mBox;
115 RndMat *mBoxMat;
116 int mReserved10[5]; // +0x10, not written by any routine recovered so far.
117 unsigned char mBoxVerts[kNumBoxVerts];
118 Vector2 mCornerSize;
119 Vector2 mFromSize;
120 Vector2 mToSize;
121 Vector3 mFromPos;
122 Vector3 mToPos;
123 LinearInterpolator mBoxMove;
124 LinearInterpolator mBoxFade;
125 LinearInterpolator mArrowFade;
126 ATanInterpolator mArrowMove;
127 Vector3 mFromArrowPos;
128 float mFromArrowAngle;
129 Vector3 mToArrowPos;
130 float mToArrowAngle;
131 unsigned char mChanging;
132};
Interpolator that follows an arctangent, which eases in and out of the range.
Definition interpolator.h:287
HudHiliteBox()
Construct a hidden box and arrow from HUD hilite_box.mesh, HUD hilite_box.mat, HUD hilite arrow....
static constexpr int kNumBoxVerts
The number of vertices of the box.
Definition hudhilitebox.h:28
Changing
The bits of mChanging, which say what Update() still moves.
Definition hudhilitebox.h:20
@ kChangingArrowMove
Definition hudhilitebox.h:24
@ kChangingArrowFade
Definition hudhilitebox.h:23
@ kChangingBoxMove
Definition hudhilitebox.h:22
@ kChangingBoxFade
Definition hudhilitebox.h:21
void ShowArrow(bool bShow)
Fade the arrow in or out over 240 ticks.
void SetArrowTarget(float fX, float fY, float fAngle, float fDuration)
Move and turn the arrow to point at a place of the screen.
void SetBoxRect(float fX0, float fY0, float fX1, float fY1, float fDuration)
Move and stretch the box to a rectangle of the screen.
void Update(float fTick)
Advance every change that runs.
void Reset()
Hide the box and the arrow at once and stop every change.
static void UnitToScreen(float *pfX0, float *pfY0, float *pfX1, float *pfY1)
Convert a rectangle in the unit square of the screen to the coordinates of the display.
void ShowBox(bool bShow)
Fade the box in or out over 480 ticks.
Straight-line interpolator.
Definition interpolator.h:99
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Triangle mesh with a material.
Definition rndmesh.h:31
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
Two-component vector, used for texture coordinates.
Definition vector2.h:12
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14