Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Brave 2
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Börcsök Barnabás
Brave 2
Commits
fe6e896c
Commit
fe6e896c
authored
Nov 29, 2020
by
bobarna
Browse files
Options
Downloads
Patches
Plain Diff
put back previous working propagation
parent
79ed7b7f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/geometries/PBDSimulation.cpp
+14
-2
14 additions, 2 deletions
src/geometries/PBDSimulation.cpp
with
14 additions
and
2 deletions
src/geometries/PBDSimulation.cpp
+
14
−
2
View file @
fe6e896c
...
@@ -20,11 +20,23 @@ PBDSimulation::PBDSimulation(HeadObject *_head, size_t _nr_sims, size_t _nr_segm
...
@@ -20,11 +20,23 @@ PBDSimulation::PBDSimulation(HeadObject *_head, size_t _nr_sims, size_t _nr_segm
}
}
void
PBDSimulation
::
propagateHead
()
{
void
PBDSimulation
::
propagateHead
()
{
vec3
origin
(
0
,
0
,
0
);
srand
(
time
(
nullptr
));
vec3
head
(
0
,
0
,
0
);
float
step
=
M_PI
/
nrStrands
;
float
currAngle
=
M_PI
;
float
r
=
0.20f
;
// if there is only one strand, then place it in the middle
if
(
nrStrands
==
1
)
r
=
0.0
;
for
(
size_t
i
=
0
;
i
<
nrStrands
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
nrStrands
;
i
++
)
{
vec3
color
=
util
::
getRandomRGBColorAround
(
vec3
(
222.0f
,
101.0f
,
32.0f
),
vec3
(
40.0f
,
20.0f
,
20.0f
));
vec3
color
=
util
::
getRandomRGBColorAround
(
vec3
(
222.0f
,
101.0f
,
32.0f
),
vec3
(
40.0f
,
20.0f
,
20.0f
));
strands
.
emplace_back
(
CreateStrand
(
nrSegments
,
lSeg
,
origin
,
color
));
vec3
curr_pos
(
head
.
x
+
cosf
(
currAngle
)
*
r
*
1.2f
,
head
.
y
+
sinf
(
currAngle
)
*
r
*
1.1f
,
head
.
z
);
strands
.
emplace_back
(
CreateStrand
(
nrSegments
,
lSeg
,
curr_pos
,
color
));
currAngle
-=
step
;
}
}
}
}
void
PBDSimulation
::
update
(
float
dt
)
{
void
PBDSimulation
::
update
(
float
dt
)
{
...
...
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