Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
26318f3b
Commit
26318f3b
authored
Oct 05, 2019
by
bruvzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Vector3 ambiguities and out of bounds init.
parent
fb739f9d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
9 deletions
+7
-9
vector3.cpp
core/math/vector3.cpp
+2
-2
editor_scene_importer_gltf.cpp
editor/import/editor_scene_importer_gltf.cpp
+1
-1
test_math.cpp
main/tests/test_math.cpp
+2
-2
editor_scene_importer_assimp.cpp
modules/assimp/editor_scene_importer_assimp.cpp
+1
-2
rasterizer_canvas_rd.cpp
servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
+1
-2
No files found.
core/math/vector3.cpp
View file @
26318f3b
...
...
@@ -103,7 +103,7 @@ Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a,
Vector3
out
;
out
=
0.5
*
((
p1
*
2.0
)
+
(
-
p0
+
p2
)
*
t
+
(
2.0
*
p0
-
5.0
*
p1
+
4
*
p2
-
p3
)
*
t2
+
(
2.0
*
p0
-
5.0
*
p1
+
4
.0
*
p2
-
p3
)
*
t2
+
(
-
p0
+
3.0
*
p1
-
3.0
*
p2
+
p3
)
*
t3
);
return
out
;
}
...
...
@@ -122,7 +122,7 @@ Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, c
Vector3
out
;
out
=
0.5
*
((
p1
*
2.0
)
+
(
-
p0
+
p2
)
*
t
+
(
2.0
*
p0
-
5.0
*
p1
+
4
*
p2
-
p3
)
*
t2
+
(
2.0
*
p0
-
5.0
*
p1
+
4
.0
*
p2
-
p3
)
*
t2
+
(
-
p0
+
3.0
*
p1
-
3.0
*
p2
+
p3
)
*
t3
);
return
out
;
}
...
...
editor/import/editor_scene_importer_gltf.cpp
View file @
26318f3b
...
...
@@ -2618,7 +2618,7 @@ struct EditorSceneImporterGLTFInterpolate {
const
float
t2
=
t
*
t
;
const
float
t3
=
t2
*
t
;
return
0.5
f
*
((
2.0
f
*
p1
)
+
(
-
p0
+
p2
)
*
t
+
(
2.0
f
*
p0
-
5.0
f
*
p1
+
4
*
p2
-
p3
)
*
t2
+
(
-
p0
+
3.0
f
*
p1
-
3.0
f
*
p2
+
p3
)
*
t3
);
return
0.5
f
*
((
2.0
f
*
p1
)
+
(
-
p0
+
p2
)
*
t
+
(
2.0
f
*
p0
-
5.0
f
*
p1
+
4
.0
f
*
p2
-
p3
)
*
t2
+
(
-
p0
+
3.0
f
*
p1
-
3.0
f
*
p2
+
p3
)
*
t3
);
}
T
bezier
(
T
start
,
T
control_1
,
T
control_2
,
T
end
,
float
t
)
{
...
...
main/tests/test_math.cpp
View file @
26318f3b
...
...
@@ -618,8 +618,8 @@ MainLoop *test() {
print_line
(
"minus: "
+
(
Vector3
(
1
,
2
,
3
)
-
Vector3
(
Vector3
(
4
,
5
,
7
))));
print_line
(
"mul: "
+
(
Vector3
(
1
,
2
,
3
)
*
Vector3
(
Vector3
(
4
,
5
,
7
))));
print_line
(
"div: "
+
(
Vector3
(
1
,
2
,
3
)
/
Vector3
(
Vector3
(
4
,
5
,
7
))));
print_line
(
"mul scalar: "
+
(
Vector3
(
1
,
2
,
3
)
*
2
));
print_line
(
"premul scalar: "
+
(
2
*
Vector3
(
1
,
2
,
3
)));
print_line
(
"mul scalar: "
+
(
Vector3
(
1
,
2
,
3
)
*
2
.0
));
print_line
(
"premul scalar: "
+
(
2
.0
*
Vector3
(
1
,
2
,
3
)));
print_line
(
"div scalar: "
+
(
Vector3
(
1
,
2
,
3
)
/
3.0
));
print_line
(
"length: "
+
rtos
(
Vector3
(
1
,
2
,
3
).
length
()));
print_line
(
"length squared: "
+
rtos
(
Vector3
(
1
,
2
,
3
).
length_squared
()));
...
...
modules/assimp/editor_scene_importer_assimp.cpp
View file @
26318f3b
...
...
@@ -167,8 +167,7 @@ struct EditorSceneImporterAssetImportInterpolate {
float
t2
=
t
*
t
;
float
t3
=
t2
*
t
;
return
0.5
f
*
((
2.0
f
*
p1
)
+
(
-
p0
+
p2
)
*
t
+
(
2.0
f
*
p0
-
5.0
f
*
p1
+
4
*
p2
-
p3
)
*
t2
+
(
-
p0
+
3.0
f
*
p1
-
3.0
f
*
p2
+
p3
)
*
t3
);
return
0.5
f
*
((
2.0
f
*
p1
)
+
(
-
p0
+
p2
)
*
t
+
(
2.0
f
*
p0
-
5.0
f
*
p1
+
4.0
f
*
p2
-
p3
)
*
t2
+
(
-
p0
+
3.0
f
*
p1
-
3.0
f
*
p2
+
p3
)
*
t3
);
}
T
bezier
(
T
start
,
T
control_1
,
T
control_2
,
T
end
,
float
t
)
{
...
...
servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
View file @
26318f3b
...
...
@@ -517,9 +517,8 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
push_constant
.
color_texture_pixel_size
[
0
]
=
0
;
push_constant
.
color_texture_pixel_size
[
1
]
=
0
;
push_constant
.
pad
[
0
]
=
0
;
push_constant
.
pad
[
1
]
=
0
;
push_constant
.
pad
[
2
]
=
0
;
push_constant
.
pad
[
3
]
=
0
;
push_constant
.
lights
[
0
]
=
0
;
push_constant
.
lights
[
1
]
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment