DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
wind.cpp
1
#include "wind.hpp"
2
3
#include <cstdlib>
4
5
void
CWind::SetDir
(
float
*direction) {
6
sceVu0Normalize(
dir
, direction);
7
}
8
9
void
CWind::SetVelocity
(
float
speed) {
10
velocity
= speed;
11
}
12
13
void
CWind::GetWind
(
float
*out) {
14
sceVu0ScaleVector(out,
dir
,
velocity
);
15
}
16
17
void
CWind::GetWindNoise
(
float
*out) {
18
sceVu0ScaleVector(out,
dir
,
velocity
*
gust
);
19
}
20
21
void
CWind::Step
() {
22
// A random walk of at most a tenth of the range per step, held inside it.
23
gust
=
gust
+ 0.2f * ((float) rand() / 2147483648.0f - 0.5f);
24
25
if
(
gust
< 0.0f) {
26
gust
= 0.0f;
27
}
28
29
if
(!(
gust
<= 1.0f)) {
30
gust
= 1.0f;
31
}
32
}
33
34
CWind::CWind
() {
35
velocity
= 0.0f;
36
gust
= (float) rand() / 2147483648.0f;
37
}
CWind::velocity
float velocity
Definition
wind.hpp:16
CWind::SetVelocity
void SetVelocity(float speed)
Definition
wind.cpp:9
CWind::SetDir
void SetDir(float *direction)
Definition
wind.cpp:5
CWind::gust
float gust
Definition
wind.hpp:14
CWind::GetWind
void GetWind(float *out)
Definition
wind.cpp:13
CWind::GetWindNoise
void GetWindNoise(float *out)
Definition
wind.cpp:17
CWind::dir
sceVu0FVECTOR dir
Definition
wind.hpp:15
CWind::CWind
CWind()
Definition
wind.cpp:34
CWind::Step
void Step()
Definition
wind.cpp:21
ps2
src
wind.cpp
Generated by
1.9.8