wavelength 1.0.0
Loading...
Searching...
No Matches
gizmo.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/interpolator.h"
4#include "math/quaternion.h"
5#include "math/transform.h"
6#include "math/vector3.h"
7#include "rnd/rndmat.h"
8#include "rnd/rndmesh.h"
9#include "rnd/rndmovie.h"
10#include "rnd/rndview.h"
11#include "script/dataarray.h"
12
25class Gizmo {
26public:
35 explicit Gizmo(int nUnused);
36
43 virtual ~Gizmo();
44
51 virtual void Draw();
52
62 virtual void Poll(float fTime);
63
71 static void Init(DataArray *pConfig);
72
80 void SetShowing(bool bShowing);
81
89 bool IsShowing() const;
90
100 void SetShowAvatar(bool bShowAvatar);
101
109 bool IsShowingAvatar() const;
110
119
129 void MoveTo(const Vector3 &position, const Quat &orientation, float fTime);
130
141 void SetTo(const Vector3 &position, const Quat &orientation);
142
143 alignas(16) Vector3 mPos;
144 alignas(16) Quat mRot;
145 alignas(16) Vector3 mFromPos;
146 alignas(16) Quat mFromRot;
147
148private:
155 static float sBeginFrame;
156
163 static float sAnimStart;
164
171 static float sAnimEnd;
172
179 static float sSeverity;
180
181 int mUnused; // +0x40, the constructor's argument. No routine reads it.
182 float mMoveStart;
183 RndView *mView;
184 RndMat *mMat;
185 RndMesh *mMesh;
186 RndMovie *mMovie;
187 ATanInterpolator mInterp;
188};
Interpolator that follows an arctangent, which eases in and out of the range.
Definition interpolator.h:287
Reference-counted array of script data nodes.
Definition dataarray.h:20
void SetShowAvatar(bool bShowAvatar)
Show the avatar texture or the movie on the gizmo's screen.
Transform WorldXfm() const
Report the world transform of the gizmo's mesh.
void SetTo(const Vector3 &position, const Quat &orientation)
Place the gizmo at a position and an orientation.
Quat mRot
Definition gizmo.h:144
bool IsShowing() const
Report whether the gizmo's view shows.
bool IsShowingAvatar() const
Report whether the gizmo's screen shows the avatar texture.
void SetShowing(bool bShowing)
Show or hide the gizmo's view.
static void Init(DataArray *pConfig)
Read the frames of the move from the freq_screen section.
Vector3 mFromPos
Definition gizmo.h:145
void MoveTo(const Vector3 &position, const Quat &orientation, float fTime)
Show the gizmo and start moving it from where it stands to a position and an orientation.
virtual void Draw()
Draw the gizmo, rendering the avatar first while the gizmo shows it.
Vector3 mPos
Definition gizmo.h:143
Quat mFromRot
Definition gizmo.h:146
virtual ~Gizmo()
Destroy the gizmo.
Gizmo(int nUnused)
Construct the gizmo from the loaded gizmo.view, gizmo.mesh, gizmo movie.mov, and freqscreen....
virtual void Poll(float fTime)
Advance the gizmo's move and its animations to a time, and place its mesh.
Rotation quaternion, stored as the vector part followed by the scalar part.
Definition quaternion.h:19
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
Animation that plays a movie file into a texture.
Definition rndmovie.h:19
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
Affine transform stored as three basis rows and a translation row.
Definition transform.h:18
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14