diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-13 11:13:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 11:13:31 +0100 |
commit | dbab0a94877004d18f1cf51f11c56c3f9861fb12 (patch) | |
tree | fd81b3c35935cdce8c3887e60464fa52a0c535ec /scene | |
parent | 35fff9a55e61934c84bc402a5a94073496d60709 (diff) | |
parent | 8a9c9a67efaf28f0223e29bf857e92c0ab1212ec (diff) |
Merge pull request #56740 from AnilBK/camera-pre-allocate
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/camera_3d.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 55fa05d3fd..2c95010eb4 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -331,11 +331,13 @@ Vector<Vector3> Camera3D::get_near_plane_points() const { Vector3 endpoints[8]; cm.get_endpoints(Transform3D(), endpoints); - Vector<Vector3> points; - points.push_back(Vector3()); - for (int i = 0; i < 4; i++) { - points.push_back(endpoints[i + 4]); - } + Vector<Vector3> points = { + Vector3(), + endpoints[4], + endpoints[5], + endpoints[6], + endpoints[7] + }; return points; } |