Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
718ded9d
Commit
718ded9d
authored
3 years ago
by
Sebastian Gaida
Browse files
Options
Downloads
Patches
Plain Diff
[
#69
] change some properties for visibility
parent
5d961c25
No related branches found
No related tags found
1 merge request
!56
Resolve "Partikelsystem"
Pipeline
#25696
failed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/particle_simulation/src/ParticleSystem.cpp
+1
-1
1 addition, 1 deletion
projects/particle_simulation/src/ParticleSystem.cpp
projects/particle_simulation/src/main.cpp
+10
-6
10 additions, 6 deletions
projects/particle_simulation/src/main.cpp
with
11 additions
and
7 deletions
projects/particle_simulation/src/ParticleSystem.cpp
+
1
−
1
View file @
718ded9d
...
@@ -19,7 +19,7 @@ void ParticleSystem::updateParticles( const float deltaTime ){
...
@@ -19,7 +19,7 @@ void ParticleSystem::updateParticles( const float deltaTime ){
for
(
Particle
&
particle
:
m_particles
){
for
(
Particle
&
particle
:
m_particles
){
bool
alive
=
particle
.
isAlive
();
bool
alive
=
particle
.
isAlive
();
particle
.
setPosition
(
particle
.
getPosition
()
*
static_cast
<
float
>
(
alive
)
+
static_cast
<
float
>
(
!
alive
)
*
m_respawnPos
);
particle
.
setPosition
(
particle
.
getPosition
()
*
static_cast
<
float
>
(
alive
)
+
static_cast
<
float
>
(
!
alive
)
*
m_respawnPos
);
particle
.
setVelocity
(
particle
.
getVelocity
()
*
static_cast
<
float
>
(
alive
)
+
static_cast
<
float
>
(
!
alive
)
*
glm
::
vec3
(
m_rdmVel
(
m_rdmEngine
),
m_rdmVel
(
m_rdmEngine
),
m_rdmVel
(
m_rdmEngine
)
));
particle
.
setVelocity
(
particle
.
getVelocity
()
*
static_cast
<
float
>
(
alive
)
+
static_cast
<
float
>
(
!
alive
)
*
glm
::
vec3
(
m_rdmVel
(
m_rdmEngine
),
m_rdmVel
(
m_rdmEngine
),
0.0
f
));
particle
.
setLifeTime
(
(
particle
.
getLifeTime
()
*
alive
+
!
alive
*
m_maxLifeTime
)
-
deltaTime
);
particle
.
setLifeTime
(
(
particle
.
getLifeTime
()
*
alive
+
!
alive
*
m_maxLifeTime
)
-
deltaTime
);
particle
.
update
(
deltaTime
);
particle
.
update
(
deltaTime
);
}
}
...
...
This diff is collapsed.
Click to expand it.
projects/particle_simulation/src/main.cpp
+
10
−
6
View file @
718ded9d
...
@@ -19,6 +19,7 @@ int main(int argc, const char** argv) {
...
@@ -19,6 +19,7 @@ int main(int argc, const char** argv) {
);
);
vkcv
::
CameraManager
cameraManager
(
window
,
windowWidth
,
windowHeight
);
vkcv
::
CameraManager
cameraManager
(
window
,
windowWidth
,
windowHeight
);
cameraManager
.
getCamera
().
setNearFar
(
0.000000001
f
,
10.
f
);
window
.
initEvents
();
window
.
initEvents
();
...
@@ -80,9 +81,9 @@ int main(int argc, const char** argv) {
...
@@ -80,9 +81,9 @@ int main(int argc, const char** argv) {
{
core
.
getDescriptorSet
(
descriptorSet
).
layout
},
{
core
.
getDescriptorSet
(
descriptorSet
).
layout
},
true
);
true
);
const
std
::
vector
<
glm
::
vec3
>
vertices
=
{
glm
::
vec3
(
-
0.
1
,
0.
1
,
0
),
const
std
::
vector
<
glm
::
vec3
>
vertices
=
{
glm
::
vec3
(
-
0.
02
,
0.
02
,
0
),
glm
::
vec3
(
0.
1
,
0.
1
,
0
),
glm
::
vec3
(
0.
02
,
0.
02
,
0
),
glm
::
vec3
(
0
,
-
0.
1
,
0
)};
glm
::
vec3
(
0
,
-
0.
02
,
0
)};
vertexBuffer
.
fill
(
vertices
);
vertexBuffer
.
fill
(
vertices
);
...
@@ -134,9 +135,12 @@ int main(int argc, const char** argv) {
...
@@ -134,9 +135,12 @@ int main(int argc, const char** argv) {
glm
::
vec3
vel1
=
glm
::
vec3
(
rdmVel
(
rdmEngine
)
,
rdmVel
(
rdmEngine
),
0.0
f
);
glm
::
vec3
vel1
=
glm
::
vec3
(
rdmVel
(
rdmEngine
)
,
rdmVel
(
rdmEngine
),
0.0
f
);
glm
::
vec3
vel2
=
glm
::
vec3
(
rdmVel
(
rdmEngine
)
,
rdmVel
(
rdmEngine
),
0.0
f
);
glm
::
vec3
vel2
=
glm
::
vec3
(
rdmVel
(
rdmEngine
)
,
rdmVel
(
rdmEngine
),
0.0
f
);
particleSystem
.
addParticles
({
particleSystem
.
addParticles
({
Particle
(
glm
::
vec3
(
0.
f
,
1.
f
,
0.
f
),
vel0
,
1.
f
),
Particle
(
glm
::
vec3
(
0.
f
,
1.
f
,
0.0
f
),
vel0
,
1.
f
),
Particle
(
glm
::
vec3
(
0.2
f
,
0.1
f
,
0.
f
),
vel1
,
2.
f
),
Particle
(
glm
::
vec3
(
0.2
f
,
0.1
f
,
0.0
f
),
vel1
,
1.5
f
),
Particle
(
glm
::
vec3
(
0.15
f
,
0.
f
,
0.1
f
),
vel2
,
3.
f
)});
Particle
(
glm
::
vec3
(
0.15
f
,
0.
f
,
0.0
f
),
vel2
,
2.
f
),
Particle
(
glm
::
vec3
(
-
0.15
f
,
0.1
f
,
0.0
f
),
vel2
,
2.5
f
),
Particle
(
glm
::
vec3
(
0.25
f
,
0.
f
,
0.0
f
),
vel2
,
3.
f
),
Particle
(
glm
::
vec3
(
-
0.15
f
,
0.2
f
,
0.0
f
),
vel2
,
3.5
f
)});
std
::
vector
<
glm
::
mat4
>
modelMatrices
;
std
::
vector
<
glm
::
mat4
>
modelMatrices
;
std
::
vector
<
vkcv
::
DrawcallInfo
>
drawcalls
;
std
::
vector
<
vkcv
::
DrawcallInfo
>
drawcalls
;
...
...
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