Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
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
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
791f7ca3
Unverified
Commit
791f7ca3
authored
Aug 8, 2021
by
Alexander Rose
Committed by
GitHub
Aug 8, 2021
Browse files
Options
Downloads
Plain Diff
Merge pull request #245 from sukolsak/optimize-setCylinderMat
parents
fc2765d3
c14d50e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-geo/geometry/mesh/builder/cylinder.ts
+2
-3
2 additions, 3 deletions
src/mol-geo/geometry/mesh/builder/cylinder.ts
with
2 additions
and
3 deletions
src/mol-geo/geometry/mesh/builder/cylinder.ts
+
2
−
3
View file @
791f7ca3
...
@@ -21,7 +21,6 @@ const tmpCylinderCenter = Vec3();
...
@@ -21,7 +21,6 @@ const tmpCylinderCenter = Vec3();
const
tmpCylinderMat
=
Mat4
();
const
tmpCylinderMat
=
Mat4
();
const
tmpCylinderMatRot
=
Mat4
();
const
tmpCylinderMatRot
=
Mat4
();
const
tmpCylinderScale
=
Vec3
();
const
tmpCylinderScale
=
Vec3
();
const
tmpCylinderMatScale
=
Mat4
();
const
tmpCylinderStart
=
Vec3
();
const
tmpCylinderStart
=
Vec3
();
const
tmpUp
=
Vec3
();
const
tmpUp
=
Vec3
();
...
@@ -32,9 +31,9 @@ function setCylinderMat(m: Mat4, start: Vec3, dir: Vec3, length: number, matchDi
...
@@ -32,9 +31,9 @@ function setCylinderMat(m: Mat4, start: Vec3, dir: Vec3, length: number, matchDi
// direction so the triangles of adjacent cylinder will line up
// direction so the triangles of adjacent cylinder will line up
if
(
matchDir
)
Vec3
.
matchDirection
(
tmpUp
,
up
,
tmpCylinderMatDir
);
if
(
matchDir
)
Vec3
.
matchDirection
(
tmpUp
,
up
,
tmpCylinderMatDir
);
else
Vec3
.
copy
(
tmpUp
,
up
);
else
Vec3
.
copy
(
tmpUp
,
up
);
Mat4
.
fromScaling
(
tmpCylinderMatScale
,
Vec3
.
set
(
tmpCylinderScale
,
1
,
length
,
1
)
)
;
Vec3
.
set
(
tmpCylinderScale
,
1
,
length
,
1
);
Vec3
.
makeRotation
(
tmpCylinderMatRot
,
tmpUp
,
tmpCylinderMatDir
);
Vec3
.
makeRotation
(
tmpCylinderMatRot
,
tmpUp
,
tmpCylinderMatDir
);
Mat4
.
mul
(
m
,
tmpCylinderMatRot
,
tmpCylinder
Mat
Scale
);
Mat4
.
scale
(
m
,
tmpCylinderMatRot
,
tmpCylinderScale
);
return
Mat4
.
setTranslation
(
m
,
tmpCylinderCenter
);
return
Mat4
.
setTranslation
(
m
,
tmpCylinderCenter
);
}
}
...
...
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