Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
qpong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
qpong
Commits
3641f27d
Commit
3641f27d
authored
4 years ago
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring
parent
e8c5b3d2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
App/GameLayer.cpp
+7
-7
7 additions, 7 deletions
App/GameLayer.cpp
QPong/Particle.cpp
+1
-1
1 addition, 1 deletion
QPong/Particle.cpp
QPong/Particle.hpp
+1
-1
1 addition, 1 deletion
QPong/Particle.hpp
with
9 additions
and
9 deletions
App/GameLayer.cpp
+
7
−
7
View file @
3641f27d
...
...
@@ -29,12 +29,12 @@ const QPong::Particle::Properties initialParticleSettings = {
.
size
=
512
,
.
position
=
{
0.0
,
0.0
,
0.0
},
.
momentum
=
{
0.0
,
0.0
,
0.0
},
.
pointUn
sharpness
=
64.0
,
.
sharpness
=
64.0
,
.
startValue
=
0.01
,
.
hbar
=
0.000125
};
const
QPong
::
Particle
::
GameOptions
intialOptions
=
{
const
QPong
::
Particle
::
GameOptions
in
i
tialOptions
=
{
.
potentialsEnabled
=
true
,
.
absorbtionEnabled
=
true
,
.
momentumEnabled
=
false
...
...
@@ -46,7 +46,7 @@ QPong::GameLayer::GameLayer(int resolution, int threads)
,
m_propagate
{
false
}
,
m_leftBat
(
-
0.8
,
0.0
,
Key
::
W
,
Key
::
S
)
,
m_rightBat
(
0.8
,
0.0
,
Key
::
Up
,
Key
::
Down
)
,
m_options
{
intialOptions
}
,
m_options
{
in
i
tialOptions
}
,
m_properties
{
initialParticleSettings
}
,
m_speedScale
{
5.0
f
}
,
m_randomMomentum
{
true
}
...
...
@@ -245,14 +245,14 @@ void QPong::GameLayer::onGuiRender()
ImGui
::
DragFloat2
(
"Momentum [x,y]"
,
glm
::
value_ptr
(
m_properties
.
momentum
),
0.01
f
,
-
3.0
f
,
3.0
f
);
ImGui
::
Checkbox
(
"Random Momentum"
,
&
m_randomMomentum
);
float
pointUn
sharpness
=
m_properties
.
pointUn
sharpness
;
if
(
ImGui
::
DragFloat
(
"Sharpness"
,
&
pointUn
sharpness
,
1.0
f
,
5.0
f
,
1000.0
f
))
float
sharpness
=
m_properties
.
sharpness
;
if
(
ImGui
::
DragFloat
(
"Sharpness"
,
&
sharpness
,
1.0
f
,
5.0
f
,
1000.0
f
))
{
m_properties
.
pointUn
sharpness
=
pointUn
sharpness
;
m_properties
.
sharpness
=
sharpness
;
}
// Select hbar, changes apply on the fly.
float
hbar
=
m_properties
.
hbar
;
if
(
ImGui
::
DragFloat
(
"hbar"
,
&
hbar
,
0.000001
f
,
0.000001
f
,
1.0
f
,
"%.
6
f"
))
if
(
ImGui
::
DragFloat
(
"hbar"
,
&
hbar
,
0.00000
0
1
f
,
0.
0
000001
f
,
1.0
f
,
"%.
7
f"
))
{
m_properties
.
hbar
=
hbar
;
}
...
...
This diff is collapsed.
Click to expand it.
QPong/Particle.cpp
+
1
−
1
View file @
3641f27d
...
...
@@ -154,7 +154,7 @@ void Particle::initialiseParticleMomentum()
const
double
py0
=
m_properties
.
momentum
.
y
/
20.0
;
const
double
x0
=
m_properties
.
position
.
x
;
const
double
y0
=
m_properties
.
position
.
y
;
const
double
lambda
=
m_properties
.
pointUn
sharpness
;
const
double
lambda
=
m_properties
.
sharpness
;
double
sum
{
0.0
};
double
m_particleAbsoluteSumStart
=
0.0
;
...
...
This diff is collapsed.
Click to expand it.
QPong/Particle.hpp
+
1
−
1
View file @
3641f27d
...
...
@@ -33,7 +33,7 @@ namespace QPong
int
size
;
glm
::
vec3
position
;
glm
::
vec3
momentum
;
double
pointUn
sharpness
;
double
sharpness
;
double
startValue
;
double
hbar
;
int
threads
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment