summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2022-01-13 10:14:59 +0545
committerAnilforextra <anilforextra@gmail.com>2022-01-13 10:14:59 +0545
commit8a9c9a67efaf28f0223e29bf857e92c0ab1212ec (patch)
treef823240bc9b730446b8b0f5d55374d08388ab3e7 /scene
parent189662e5bdd5347ed9f8c2a4711bddd7037c5362 (diff)
CameraMatrix: Pre-allocate Vector in get_projection_planes().
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/camera_3d.cpp12
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;
}