diff options
author | Anilforextra <anilforextra@gmail.com> | 2022-01-13 10:14:59 +0545 |
---|---|---|
committer | Anilforextra <anilforextra@gmail.com> | 2022-01-13 10:14:59 +0545 |
commit | 8a9c9a67efaf28f0223e29bf857e92c0ab1212ec (patch) | |
tree | f823240bc9b730446b8b0f5d55374d08388ab3e7 /scene/3d | |
parent | 189662e5bdd5347ed9f8c2a4711bddd7037c5362 (diff) |
CameraMatrix: Pre-allocate Vector in get_projection_planes().
Diffstat (limited to 'scene/3d')
-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; } |