wavelength 1.0.0
Loading...
Searching...
No Matches
freestylus.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/rampanimator.h"
4#include "gfx/gfxtunnel.h"
5#include "gfx/particlearm.h"
7#include "math/vector3.h"
8#include "rnd/rndanimatable.h"
11#include "rnd/rndview.h"
12
21public:
23 enum Type {
26 };
27
36 Freestylus(GfxTunnel *pTunnel, int nType);
37
45
53 void Setup(float flScale);
54
61 void Reset();
62
71 void SetPitchColor(float flPitch, float flColor);
72
82 void Spin(float flTime, float flTumbleX, float flTumbleY);
83
90 void Flash();
91
99
110 void Update(bool bPlaying, float flTicks, float flTime, float flScale);
111
120 void Draw(RndTransformable *pParent, int bAssembled);
121
128 static float sTumbleAnglePerMs;
129
132 return mBeamGrow;
133 }
134
137 return mSample;
138 }
139
140private:
141 RndView *mView;
142 RndView *mTempo;
143 RndAnimatable *mPitch;
144 RndAnimatable *mColor;
145 RndView *mTumble;
146 RndView *mBeams;
147 RampAnimator mBeamGrow;
148 RampAnimator mSample;
149 ParticleArm mArm;
150 RndParticleSys *mParticles;
151 SubstepParticles mButton;
152 Vector3 mButtonForce;
153 float mTime;
154 RndView *mFlash;
155 float mFlashTime;
156 Vector3 mBasis[3];
157 float mScale;
158
160 static constexpr float kNoFlash = -1e9f;
161
163 static constexpr float kNotSetUp = -1.0f;
164};
void Update(bool bPlaying, float flTicks, float flTime, float flScale)
Advance the animations and scale the freestylus.
void SetPitchColor(float flPitch, float flColor)
Pose the pitch and the colour of the freestylus.
Freestylus(GfxTunnel *pTunnel, int nType)
Find the views, animations, and particle systems of the freestylus.
~Freestylus()
Destroy the freestylus.
void Flash()
Start the flash.
void Draw(RndTransformable *pParent, int bAssembled)
Draw the freestylus under a parent.
Type
The kinds of freestyle.
Definition freestylus.h:23
@ kTypeScratch
Definition freestylus.h:25
@ kTypeAxe
Definition freestylus.h:24
static float sTumbleAnglePerMs
The angle of the tumble per unit of its rate, tumble_angle_per_ms.
Definition freestylus.h:128
void Reset()
End the flash and restart the particles of the button.
void Spin(float flTime, float flTumbleX, float flTumbleY)
Turn the basis of the tumble about its X and Y axes, and keep it orthonormal.
void Setup(float flScale)
Scale the freestylus and its particles, the first time only.
void ClearParticles()
Free every particle of the freestylus and of its arm.
RampAnimator & GetSample()
Definition freestylus.h:136
RampAnimator & GetBeamGrow()
Definition freestylus.h:131
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
Particle system that hangs from a transform and is drawn as a reflection of it.
Definition particlearm.h:12
Value that moves toward a target along an interpolator, and poses an animation on the value.
Definition rampanimator.h:14
Mix-in for an object driven by a frame.
Definition rndanimatable.h:16
Emitter that spawns, moves, and fades a population of particles.
Definition rndparticlesys.h:69
Mix-in for an object with a local transform and a world transform derived from its parent's.
Definition rndtransformable.h:17
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
Particle system that emits in several steps along the path its transform moved since the last update,...
Definition substepparticles.h:12
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14