summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp8
-rw-r--r--scene/3d/baked_lightmap.cpp22
-rw-r--r--scene/3d/baked_lightmap.h6
-rw-r--r--scene/3d/collision_polygon.cpp6
-rw-r--r--scene/3d/cpu_particles.cpp52
-rw-r--r--scene/3d/cpu_particles.h26
-rw-r--r--scene/3d/gi_probe.cpp30
-rw-r--r--scene/3d/gi_probe.h12
-rw-r--r--scene/3d/immediate_geometry.cpp4
-rw-r--r--scene/3d/immediate_geometry.h2
-rw-r--r--scene/3d/light.cpp4
-rw-r--r--scene/3d/light.h2
-rw-r--r--scene/3d/mesh_instance.cpp6
-rw-r--r--scene/3d/mesh_instance.h2
-rw-r--r--scene/3d/multimesh_instance.cpp4
-rw-r--r--scene/3d/multimesh_instance.h2
-rw-r--r--scene/3d/particles.cpp4
-rw-r--r--scene/3d/particles.h2
-rw-r--r--scene/3d/reflection_probe.cpp4
-rw-r--r--scene/3d/reflection_probe.h2
-rw-r--r--scene/3d/soft_body.cpp38
-rw-r--r--scene/3d/soft_body.h10
-rw-r--r--scene/3d/sprite_3d.cpp10
-rw-r--r--scene/3d/sprite_3d.h2
-rw-r--r--scene/3d/visual_instance.h2
-rw-r--r--scene/3d/voxelizer.cpp54
-rw-r--r--scene/3d/voxelizer.h8
27 files changed, 161 insertions, 163 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 189ac1d1b3..ae70e2e1ac 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -45,12 +45,12 @@ private:
mutable real_t squared_gain; // temporary
};
- PoolVector<Speaker> speakers;
+ Vector<Speaker> speakers;
public:
Spcap(unsigned int speaker_count, const Vector3 *speaker_directions) {
this->speakers.resize(speaker_count);
- PoolVector<Speaker>::Write w = this->speakers.write();
+ Speaker *w = this->speakers.ptrw();
for (unsigned int speaker_num = 0; speaker_num < speaker_count; speaker_num++) {
w[speaker_num].direction = speaker_directions[speaker_num];
w[speaker_num].squared_gain = 0.0;
@@ -66,11 +66,11 @@ public:
}
Vector3 get_speaker_direction(unsigned int index) const {
- return this->speakers.read()[index].direction;
+ return this->speakers.ptr()[index].direction;
}
void calculate(const Vector3 &source_direction, real_t tightness, unsigned int volume_count, real_t *volumes) const {
- PoolVector<Speaker>::Read r = this->speakers.read();
+ const Speaker *r = this->speakers.ptr();
real_t sum_squared_gains = 0.0;
for (unsigned int speaker_num = 0; speaker_num < (unsigned int)this->speakers.size(); speaker_num++) {
real_t initial_gain = 0.5 * powf(1.0 + r[speaker_num].direction.dot(source_direction), tightness) / r[speaker_num].effective_number_of_speakers;
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index 31a80bc2db..a6b92d5ee6 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -47,12 +47,12 @@ AABB BakedLightmapData::get_bounds() const {
return bounds;
}
-void BakedLightmapData::set_octree(const PoolVector<uint8_t> &p_octree) {
+void BakedLightmapData::set_octree(const Vector<uint8_t> &p_octree) {
VS::get_singleton()->lightmap_capture_set_octree(baked_light, p_octree);
}
-PoolVector<uint8_t> BakedLightmapData::get_octree() const {
+Vector<uint8_t> BakedLightmapData::get_octree() const {
return VS::get_singleton()->lightmap_capture_get_octree(baked_light);
}
@@ -175,7 +175,7 @@ void BakedLightmapData::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "cell_space_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_space_transform", "get_cell_space_transform");
ADD_PROPERTY(PropertyInfo(Variant::INT, "cell_subdiv", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_subdiv", "get_cell_subdiv");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_energy", "get_energy");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "octree", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_octree", "get_octree");
+ ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "octree", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_octree", "get_octree");
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "user_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_user_data", "_get_user_data");
}
@@ -495,13 +495,13 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
if (hdr) {
//just save a regular image
- PoolVector<uint8_t> data;
+ Vector<uint8_t> data;
int s = lm.light.size();
data.resize(lm.light.size() * 2);
{
- PoolVector<uint8_t>::Write w = data.write();
- PoolVector<float>::Read r = lm.light.read();
+ uint8_t* w = data.ptrw();
+ const float* r = lm.light.ptr();
uint16_t *hfw = (uint16_t *)w.ptr();
for (int i = 0; i < s; i++) {
hfw[i] = Math::make_half_float(r[i]);
@@ -513,13 +513,13 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
} else {
//just save a regular image
- PoolVector<uint8_t> data;
+ Vector<uint8_t> data;
int s = lm.light.size();
data.resize(lm.light.size());
{
- PoolVector<uint8_t>::Write w = data.write();
- PoolVector<float>::Read r = lm.light.read();
+ uint8_t* w = data.ptrw();
+ const float* r = lm.light.ptr();
for (int i = 0; i < s; i += 3) {
Color c(r[i + 0], r[i + 1], r[i + 2]);
c = c.to_srgb();
@@ -775,8 +775,8 @@ String BakedLightmap::get_image_path() const {
AABB BakedLightmap::get_aabb() const {
return AABB(-extents, extents * 2);
}
-PoolVector<Face3> BakedLightmap::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+Vector<Face3> BakedLightmap::get_faces(uint32_t p_usage_flags) const {
+ return Vector<Face3>();
}
void BakedLightmap::_bind_methods() {
diff --git a/scene/3d/baked_lightmap.h b/scene/3d/baked_lightmap.h
index 0633ffa641..bc9e3f55ea 100644
--- a/scene/3d/baked_lightmap.h
+++ b/scene/3d/baked_lightmap.h
@@ -64,8 +64,8 @@ public:
void set_bounds(const AABB &p_bounds);
AABB get_bounds() const;
- void set_octree(const PoolVector<uint8_t> &p_octree);
- PoolVector<uint8_t> get_octree() const;
+ void set_octree(const Vector<uint8_t> &p_octree);
+ Vector<uint8_t> get_octree() const;
void set_cell_space_transform(const Transform &p_xform);
Transform get_cell_space_transform() const;
@@ -202,7 +202,7 @@ public:
String get_image_path() const;
AABB get_aabb() const;
- PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ Vector<Face3> get_faces(uint32_t p_usage_flags) const;
BakeError bake(Node *p_from_node, bool p_create_visual_debug = false);
BakedLightmap();
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index cc07072962..342159d80f 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -53,11 +53,11 @@ void CollisionPolygon::_build_polygon() {
for (int i = 0; i < decomp.size(); i++) {
Ref<ConvexPolygonShape> convex = memnew(ConvexPolygonShape);
- PoolVector<Vector3> cp;
+ Vector<Vector3> cp;
int cs = decomp[i].size();
cp.resize(cs * 2);
{
- PoolVector<Vector3>::Write w = cp.write();
+ Vector3 *w = cp.ptrw();
int idx = 0;
for (int j = 0; j < cs; j++) {
@@ -193,7 +193,7 @@ void CollisionPolygon::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth"), "set_depth", "get_depth");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
+ ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
}
CollisionPolygon::CollisionPolygon() {
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index 6e26f7ce8f..552c15c86b 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -39,9 +39,9 @@ AABB CPUParticles::get_aabb() const {
return AABB();
}
-PoolVector<Face3> CPUParticles::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> CPUParticles::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
void CPUParticles::set_emitting(bool p_emitting) {
@@ -65,7 +65,7 @@ void CPUParticles::set_amount(int p_amount) {
particles.resize(p_amount);
{
- PoolVector<Particle>::Write w = particles.write();
+ Particle *w = particles.ptrw();
for (int i = 0; i < p_amount; i++) {
w[i].active = false;
@@ -244,7 +244,7 @@ void CPUParticles::restart() {
{
int pc = particles.size();
- PoolVector<Particle>::Write w = particles.write();
+ Particle *w = particles.ptrw();
for (int i = 0; i < pc; i++) {
w[i].active = false;
@@ -419,17 +419,17 @@ void CPUParticles::set_emission_box_extents(Vector3 p_extents) {
emission_box_extents = p_extents;
}
-void CPUParticles::set_emission_points(const PoolVector<Vector3> &p_points) {
+void CPUParticles::set_emission_points(const Vector<Vector3> &p_points) {
emission_points = p_points;
}
-void CPUParticles::set_emission_normals(const PoolVector<Vector3> &p_normals) {
+void CPUParticles::set_emission_normals(const Vector<Vector3> &p_normals) {
emission_normals = p_normals;
}
-void CPUParticles::set_emission_colors(const PoolVector<Color> &p_colors) {
+void CPUParticles::set_emission_colors(const Vector<Color> &p_colors) {
emission_colors = p_colors;
}
@@ -442,16 +442,16 @@ Vector3 CPUParticles::get_emission_box_extents() const {
return emission_box_extents;
}
-PoolVector<Vector3> CPUParticles::get_emission_points() const {
+Vector<Vector3> CPUParticles::get_emission_points() const {
return emission_points;
}
-PoolVector<Vector3> CPUParticles::get_emission_normals() const {
+Vector<Vector3> CPUParticles::get_emission_normals() const {
return emission_normals;
}
-PoolVector<Color> CPUParticles::get_emission_colors() const {
+Vector<Color> CPUParticles::get_emission_colors() const {
return emission_colors;
}
@@ -597,9 +597,9 @@ void CPUParticles::_particles_process(float p_delta) {
p_delta *= speed_scale;
int pcount = particles.size();
- PoolVector<Particle>::Write w = particles.write();
+ Particle *w = particles.ptrw();
- Particle *parray = w.ptr();
+ Particle *parray = w;
float prev_time = time;
time += p_delta;
@@ -1025,23 +1025,23 @@ void CPUParticles::_update_particle_data_buffer() {
int pc = particles.size();
- PoolVector<int>::Write ow;
+ int *ow;
int *order = NULL;
- PoolVector<float>::Write w = particle_data.write();
- PoolVector<Particle>::Read r = particles.read();
- float *ptr = w.ptr();
+ float *w = particle_data.ptrw();
+ const Particle *r = particles.ptr();
+ float *ptr = w;
if (draw_order != DRAW_ORDER_INDEX) {
- ow = particle_order.write();
- order = ow.ptr();
+ ow = particle_order.ptrw();
+ order = ow;
for (int i = 0; i < pc; i++) {
order[i] = i;
}
if (draw_order == DRAW_ORDER_LIFETIME) {
SortArray<int, SortLifetime> sorter;
- sorter.compare.particles = r.ptr();
+ sorter.compare.particles = r;
sorter.sort(order, pc);
} else if (draw_order == DRAW_ORDER_VIEW_DEPTH) {
Camera *c = get_viewport()->get_camera();
@@ -1058,7 +1058,7 @@ void CPUParticles::_update_particle_data_buffer() {
}
SortArray<int, SortAxis> sorter;
- sorter.compare.particles = r.ptr();
+ sorter.compare.particles = r;
sorter.compare.axis = dir;
sorter.sort(order, pc);
}
@@ -1185,9 +1185,9 @@ void CPUParticles::_notification(int p_what) {
int pc = particles.size();
- PoolVector<float>::Write w = particle_data.write();
- PoolVector<Particle>::Read r = particles.read();
- float *ptr = w.ptr();
+ float *w = particle_data.ptrw();
+ const Particle *r = particles.ptr();
+ float *ptr = w;
for (int i = 0; i < pc; i++) {
@@ -1403,9 +1403,9 @@ void CPUParticles::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "emission_box_extents"), "set_emission_box_extents", "get_emission_box_extents");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "emission_points"), "set_emission_points", "get_emission_points");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "emission_normals"), "set_emission_normals", "get_emission_normals");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY, "emission_colors"), "set_emission_colors", "get_emission_colors");
+ ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "emission_points"), "set_emission_points", "get_emission_points");
+ ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "emission_normals"), "set_emission_normals", "get_emission_normals");
+ ADD_PROPERTY(PropertyInfo(Variant::PACKED_COLOR_ARRAY, "emission_colors"), "set_emission_colors", "get_emission_colors");
ADD_GROUP("Flags", "flag_");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_align_y"), "set_particle_flag", "get_particle_flag", FLAG_ALIGN_Y_TO_VELOCITY);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flag_rotate_y"), "set_particle_flag", "get_particle_flag", FLAG_ROTATE_Y);
diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h
index d5a549b976..1a5537e4f2 100644
--- a/scene/3d/cpu_particles.h
+++ b/scene/3d/cpu_particles.h
@@ -106,9 +106,9 @@ private:
RID multimesh;
- PoolVector<Particle> particles;
- PoolVector<float> particle_data;
- PoolVector<int> particle_order;
+ Vector<Particle> particles;
+ Vector<float> particle_data;
+ Vector<int> particle_order;
struct SortLifetime {
const Particle *particles;
@@ -167,9 +167,9 @@ private:
EmissionShape emission_shape;
float emission_sphere_radius;
Vector3 emission_box_extents;
- PoolVector<Vector3> emission_points;
- PoolVector<Vector3> emission_normals;
- PoolVector<Color> emission_colors;
+ Vector<Vector3> emission_points;
+ Vector<Vector3> emission_normals;
+ Vector<Color> emission_colors;
int emission_point_count;
Vector3 gravity;
@@ -191,7 +191,7 @@ protected:
public:
AABB get_aabb() const;
- PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ Vector<Face3> get_faces(uint32_t p_usage_flags) const;
void set_emitting(bool p_emitting);
void set_amount(int p_amount);
@@ -264,17 +264,17 @@ public:
void set_emission_shape(EmissionShape p_shape);
void set_emission_sphere_radius(float p_radius);
void set_emission_box_extents(Vector3 p_extents);
- void set_emission_points(const PoolVector<Vector3> &p_points);
- void set_emission_normals(const PoolVector<Vector3> &p_normals);
- void set_emission_colors(const PoolVector<Color> &p_colors);
+ void set_emission_points(const Vector<Vector3> &p_points);
+ void set_emission_normals(const Vector<Vector3> &p_normals);
+ void set_emission_colors(const Vector<Color> &p_colors);
void set_emission_point_count(int p_count);
EmissionShape get_emission_shape() const;
float get_emission_sphere_radius() const;
Vector3 get_emission_box_extents() const;
- PoolVector<Vector3> get_emission_points() const;
- PoolVector<Vector3> get_emission_normals() const;
- PoolVector<Color> get_emission_colors() const;
+ Vector<Vector3> get_emission_points() const;
+ Vector<Vector3> get_emission_normals() const;
+ Vector<Color> get_emission_colors() const;
int get_emission_point_count() const;
void set_gravity(const Vector3 &p_gravity);
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 34540525af..918646fd9e 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -47,14 +47,14 @@ void GIProbeData::_set_data(const Dictionary &p_data) {
AABB bounds = p_data["bounds"];
Vector3 octree_size = p_data["octree_size"];
- PoolVector<uint8_t> octree_cells = p_data["octree_cells"];
- PoolVector<uint8_t> octree_data = p_data["octree_data"];
+ Vector<uint8_t> octree_cells = p_data["octree_cells"];
+ Vector<uint8_t> octree_data = p_data["octree_data"];
- PoolVector<uint8_t> octree_df;
+ Vector<uint8_t> octree_df;
if (p_data.has("octree_df")) {
octree_df = p_data["octree_df"];
} else if (p_data.has("octree_df_png")) {
- PoolVector<uint8_t> octree_df_png = p_data["octree_df_png"];
+ Vector<uint8_t> octree_df_png = p_data["octree_df_png"];
Ref<Image> img;
img.instance();
Error err = img->load_png_from_buffer(octree_df_png);
@@ -62,7 +62,7 @@ void GIProbeData::_set_data(const Dictionary &p_data) {
ERR_FAIL_COND(img->get_format() != Image::FORMAT_L8);
octree_df = img->get_data();
}
- PoolVector<int> octree_levels = p_data["level_counts"];
+ Vector<int> octree_levels = p_data["level_counts"];
Transform to_cell_xform = p_data["to_cell_xform"];
allocate(to_cell_xform, bounds, octree_size, octree_cells, octree_data, octree_df, octree_levels);
@@ -79,11 +79,11 @@ Dictionary GIProbeData::_get_data() const {
Ref<Image> img;
img.instance();
img->create(otsize.x * otsize.y, otsize.z, false, Image::FORMAT_L8, get_distance_field());
- PoolVector<uint8_t> df_png = img->save_png_to_buffer();
+ Vector<uint8_t> df_png = img->save_png_to_buffer();
ERR_FAIL_COND_V(df_png.size() == 0, Dictionary());
d["octree_df_png"] = df_png;
} else {
- d["octree_df"] = PoolVector<uint8_t>();
+ d["octree_df"] = Vector<uint8_t>();
}
d["level_counts"] = get_level_counts();
@@ -91,7 +91,7 @@ Dictionary GIProbeData::_get_data() const {
return d;
}
-void GIProbeData::allocate(const Transform &p_to_cell_xform, const AABB &p_aabb, const Vector3 &p_octree_size, const PoolVector<uint8_t> &p_octree_cells, const PoolVector<uint8_t> &p_data_cells, const PoolVector<uint8_t> &p_distance_field, const PoolVector<int> &p_level_counts) {
+void GIProbeData::allocate(const Transform &p_to_cell_xform, const AABB &p_aabb, const Vector3 &p_octree_size, const Vector<uint8_t> &p_octree_cells, const Vector<uint8_t> &p_data_cells, const Vector<uint8_t> &p_distance_field, const Vector<int> &p_level_counts) {
VS::get_singleton()->gi_probe_allocate(probe, p_to_cell_xform, p_aabb, p_octree_size, p_octree_cells, p_data_cells, p_distance_field, p_level_counts);
bounds = p_aabb;
to_cell_xform = p_to_cell_xform;
@@ -104,17 +104,17 @@ AABB GIProbeData::get_bounds() const {
Vector3 GIProbeData::get_octree_size() const {
return octree_size;
}
-PoolVector<uint8_t> GIProbeData::get_octree_cells() const {
+Vector<uint8_t> GIProbeData::get_octree_cells() const {
return VS::get_singleton()->gi_probe_get_octree_cells(probe);
}
-PoolVector<uint8_t> GIProbeData::get_data_cells() const {
+Vector<uint8_t> GIProbeData::get_data_cells() const {
return VS::get_singleton()->gi_probe_get_data_cells(probe);
}
-PoolVector<uint8_t> GIProbeData::get_distance_field() const {
+Vector<uint8_t> GIProbeData::get_distance_field() const {
return VS::get_singleton()->gi_probe_get_distance_field(probe);
}
-PoolVector<int> GIProbeData::get_level_counts() const {
+Vector<int> GIProbeData::get_level_counts() const {
return VS::get_singleton()->gi_probe_get_level_counts(probe);
}
Transform GIProbeData::get_to_cell_xform() const {
@@ -492,7 +492,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
bake_step_function(pmc++, RTR("Generating Distance Field"));
}
- PoolVector<uint8_t> df = baker.get_sdf_3d_image();
+ Vector<uint8_t> df = baker.get_sdf_3d_image();
probe_data->allocate(baker.get_to_cell_space_xform(), AABB(-extents, extents * 2.0), baker.get_giprobe_octree_size(), baker.get_giprobe_octree_cells(), baker.get_giprobe_data_cells(), df, baker.get_giprobe_level_cell_count());
@@ -519,9 +519,9 @@ AABB GIProbe::get_aabb() const {
return AABB(-extents, extents * 2);
}
-PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
String GIProbe::get_configuration_warning() const {
diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h
index 60aa1d952c..354eaad7c0 100644
--- a/scene/3d/gi_probe.h
+++ b/scene/3d/gi_probe.h
@@ -63,13 +63,13 @@ protected:
void _validate_property(PropertyInfo &property) const;
public:
- void allocate(const Transform &p_to_cell_xform, const AABB &p_aabb, const Vector3 &p_octree_size, const PoolVector<uint8_t> &p_octree_cells, const PoolVector<uint8_t> &p_data_cells, const PoolVector<uint8_t> &p_distance_field, const PoolVector<int> &p_level_counts);
+ void allocate(const Transform &p_to_cell_xform, const AABB &p_aabb, const Vector3 &p_octree_size, const Vector<uint8_t> &p_octree_cells, const Vector<uint8_t> &p_data_cells, const Vector<uint8_t> &p_distance_field, const Vector<int> &p_level_counts);
AABB get_bounds() const;
Vector3 get_octree_size() const;
- PoolVector<uint8_t> get_octree_cells() const;
- PoolVector<uint8_t> get_data_cells() const;
- PoolVector<uint8_t> get_distance_field() const;
- PoolVector<int> get_level_counts() const;
+ Vector<uint8_t> get_octree_cells() const;
+ Vector<uint8_t> get_data_cells() const;
+ Vector<uint8_t> get_distance_field() const;
+ Vector<int> get_level_counts() const;
Transform get_to_cell_xform() const;
void set_dynamic_range(float p_range);
@@ -164,7 +164,7 @@ public:
void bake(Node *p_from_node = NULL, bool p_create_visual_debug = false);
virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
virtual String get_configuration_warning() const;
diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp
index afe60226b6..f5b08b86e1 100644
--- a/scene/3d/immediate_geometry.cpp
+++ b/scene/3d/immediate_geometry.cpp
@@ -90,9 +90,9 @@ AABB ImmediateGeometry::get_aabb() const {
return aabb;
}
-PoolVector<Face3> ImmediateGeometry::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> ImmediateGeometry::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
void ImmediateGeometry::add_sphere(int p_lats, int p_lons, float p_radius, bool p_add_uv) {
diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h
index 7f506ce9ef..77a20e8d4d 100644
--- a/scene/3d/immediate_geometry.h
+++ b/scene/3d/immediate_geometry.h
@@ -64,7 +64,7 @@ public:
void add_sphere(int p_lats, int p_lons, float p_radius, bool p_add_uv = true);
virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
ImmediateGeometry();
~ImmediateGeometry();
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 8d3b9bbaf0..90d3f71b95 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -152,9 +152,9 @@ AABB Light::get_aabb() const {
return AABB();
}
-PoolVector<Face3> Light::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> Light::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
void Light::set_bake_mode(BakeMode p_mode) {
diff --git a/scene/3d/light.h b/scene/3d/light.h
index 7287518ae9..16e0c47083 100644
--- a/scene/3d/light.h
+++ b/scene/3d/light.h
@@ -124,7 +124,7 @@ public:
BakeMode get_bake_mode() const;
virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
Light();
~Light();
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index 6d0216d99c..3188a8d5b1 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -204,13 +204,13 @@ AABB MeshInstance::get_aabb() const {
return AABB();
}
-PoolVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const {
if (!(p_usage_flags & (FACES_SOLID | FACES_ENCLOSING)))
- return PoolVector<Face3>();
+ return Vector<Face3>();
if (mesh.is_null())
- return PoolVector<Face3>();
+ return Vector<Face3>();
return mesh->get_faces();
}
diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h
index fd5f60a5d7..d49d9ed98f 100644
--- a/scene/3d/mesh_instance.h
+++ b/scene/3d/mesh_instance.h
@@ -94,7 +94,7 @@ public:
void create_debug_tangents();
virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
MeshInstance();
~MeshInstance();
diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp
index 245dbdaf58..075eb0a1ec 100644
--- a/scene/3d/multimesh_instance.cpp
+++ b/scene/3d/multimesh_instance.cpp
@@ -51,9 +51,9 @@ Ref<MultiMesh> MultiMeshInstance::get_multimesh() const {
return multimesh;
}
-PoolVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
AABB MultiMeshInstance::get_aabb() const {
diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h
index 855bd54910..2b59c3b96c 100644
--- a/scene/3d/multimesh_instance.h
+++ b/scene/3d/multimesh_instance.h
@@ -44,7 +44,7 @@ protected:
// bind helpers
public:
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
void set_multimesh(const Ref<MultiMesh> &p_multimesh);
Ref<MultiMesh> get_multimesh() const;
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index 9fe626474e..787638053c 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -39,9 +39,9 @@ AABB Particles::get_aabb() const {
return AABB();
}
-PoolVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> Particles::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
void Particles::set_emitting(bool p_emitting) {
diff --git a/scene/3d/particles.h b/scene/3d/particles.h
index 69be7da29a..95c6de15ec 100644
--- a/scene/3d/particles.h
+++ b/scene/3d/particles.h
@@ -78,7 +78,7 @@ protected:
public:
AABB get_aabb() const;
- PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ Vector<Face3> get_faces(uint32_t p_usage_flags) const;
void set_emitting(bool p_emitting);
void set_amount(int p_amount);
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index 2a5a84741f..0c44f21e76 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -186,9 +186,9 @@ AABB ReflectionProbe::get_aabb() const {
aabb.size = origin_offset + extents;
return aabb;
}
-PoolVector<Face3> ReflectionProbe::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> ReflectionProbe::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
void ReflectionProbe::_validate_property(PropertyInfo &property) const {
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h
index 28ca680e9f..57c1b0a320 100644
--- a/scene/3d/reflection_probe.h
+++ b/scene/3d/reflection_probe.h
@@ -103,7 +103,7 @@ public:
UpdateMode get_update_mode() const;
virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
ReflectionProbe();
~ReflectionProbe();
diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp
index 931e786455..1c20677f64 100644
--- a/scene/3d/soft_body.cpp
+++ b/scene/3d/soft_body.cpp
@@ -73,11 +73,11 @@ void SoftBodyVisualServerHandler::clear() {
}
void SoftBodyVisualServerHandler::open() {
- write_buffer = buffer.write();
+ write_buffer = buffer.ptrw();
}
void SoftBodyVisualServerHandler::close() {
- write_buffer.release();
+ //write_buffer.release();
}
void SoftBodyVisualServerHandler::commit_changes() {
@@ -149,7 +149,7 @@ bool SoftBody::_get(const StringName &p_name, Variant &r_ret) const {
if ("pinned_points" == which) {
Array arr_ret;
const int pinned_points_indices_size = pinned_points.size();
- PoolVector<PinnedPoint>::Read r = pinned_points.read();
+ const PinnedPoint *r = pinned_points.ptr();
arr_ret.resize(pinned_points_indices_size);
for (int i = 0; i < pinned_points_indices_size; ++i) {
@@ -174,7 +174,7 @@ void SoftBody::_get_property_list(List<PropertyInfo> *p_list) const {
const int pinned_points_indices_size = pinned_points.size();
- p_list->push_back(PropertyInfo(Variant::POOL_INT_ARRAY, "pinned_points"));
+ p_list->push_back(PropertyInfo(Variant::PACKED_INT_ARRAY, "pinned_points"));
for (int i = 0; i < pinned_points_indices_size; ++i) {
p_list->push_back(PropertyInfo(Variant::INT, "attachments/" + itos(i) + "/point_index"));
@@ -188,7 +188,7 @@ bool SoftBody::_set_property_pinned_points_indices(const Array &p_indices) {
const int p_indices_size = p_indices.size();
{ // Remove the pined points on physics server that will be removed by resize
- PoolVector<PinnedPoint>::Read r = pinned_points.read();
+ const PinnedPoint *r = pinned_points.ptr();
if (p_indices_size < pinned_points.size()) {
for (int i = pinned_points.size() - 1; i >= p_indices_size; --i) {
pin_point(r[i].point_index, false);
@@ -198,7 +198,7 @@ bool SoftBody::_set_property_pinned_points_indices(const Array &p_indices) {
pinned_points.resize(p_indices_size);
- PoolVector<PinnedPoint>::Write w = pinned_points.write();
+ PinnedPoint *w = pinned_points.ptrw();
int point_index;
for (int i = 0; i < p_indices_size; ++i) {
point_index = p_indices.get(i);
@@ -218,11 +218,11 @@ bool SoftBody::_set_property_pinned_points_attachment(int p_item, const String &
}
if ("spatial_attachment_path" == p_what) {
- PoolVector<PinnedPoint>::Write w = pinned_points.write();
+ PinnedPoint *w = pinned_points.ptrw();
pin_point(w[p_item].point_index, true, p_value);
_make_cache_dirty();
} else if ("offset" == p_what) {
- PoolVector<PinnedPoint>::Write w = pinned_points.write();
+ PinnedPoint *w = pinned_points.ptrw();
w[p_item].offset = p_value;
} else {
return false;
@@ -235,7 +235,7 @@ bool SoftBody::_get_property_pinned_points(int p_item, const String &p_what, Var
if (pinned_points.size() <= p_item) {
return false;
}
- PoolVector<PinnedPoint>::Read r = pinned_points.read();
+ const PinnedPoint *r = pinned_points.ptr();
if ("point_index" == p_what) {
r_ret = r[p_item].point_index;
@@ -417,7 +417,7 @@ void SoftBody::_update_physics_server() {
_update_cache_pin_points_datas();
// Submit bone attachment
const int pinned_points_indices_size = pinned_points.size();
- PoolVector<PinnedPoint>::Read r = pinned_points.read();
+ const PinnedPoint *r = pinned_points.ptr();
for (int i = 0; i < pinned_points_indices_size; ++i) {
if (r[i].spatial_attachment) {
PhysicsServer::get_singleton()->soft_body_move_point(physics_rid, r[i].point_index, r[i].spatial_attachment->get_global_transform().xform(r[i].offset));
@@ -559,15 +559,15 @@ const NodePath &SoftBody::get_parent_collision_ignore() const {
return parent_collision_ignore;
}
-void SoftBody::set_pinned_points_indices(PoolVector<SoftBody::PinnedPoint> p_pinned_points_indices) {
+void SoftBody::set_pinned_points_indices(Vector<SoftBody::PinnedPoint> p_pinned_points_indices) {
pinned_points = p_pinned_points_indices;
- PoolVector<PinnedPoint>::Read w = pinned_points.read();
+ const PinnedPoint *w = pinned_points.ptr();
for (int i = pinned_points.size() - 1; 0 <= i; --i) {
pin_point(p_pinned_points_indices[i].point_index, true);
}
}
-PoolVector<SoftBody::PinnedPoint> SoftBody::get_pinned_points_indices() {
+Vector<SoftBody::PinnedPoint> SoftBody::get_pinned_points_indices() {
return pinned_points;
}
@@ -721,7 +721,7 @@ SoftBody::~SoftBody() {
void SoftBody::reset_softbody_pin() {
PhysicsServer::get_singleton()->soft_body_remove_all_pinned_points(physics_rid);
- PoolVector<PinnedPoint>::Read pps = pinned_points.read();
+ const PinnedPoint *pps = pinned_points.ptr();
for (int i = pinned_points.size() - 1; 0 < i; --i) {
PhysicsServer::get_singleton()->soft_body_pin_point(physics_rid, pps[i].point_index, true);
}
@@ -737,7 +737,7 @@ void SoftBody::_update_cache_pin_points_datas() {
pinned_points_cache_dirty = false;
- PoolVector<PinnedPoint>::Write w = pinned_points.write();
+ PinnedPoint *w = pinned_points.ptrw();
for (int i = pinned_points.size() - 1; 0 <= i; --i) {
if (!w[i].spatial_attachment_path.is_empty()) {
@@ -786,8 +786,8 @@ void SoftBody::_reset_points_offsets() {
if (!Engine::get_singleton()->is_editor_hint())
return;
- PoolVector<PinnedPoint>::Read r = pinned_points.read();
- PoolVector<PinnedPoint>::Write w = pinned_points.write();
+ const PinnedPoint *r = pinned_points.ptr();
+ PinnedPoint *w = pinned_points.ptrw();
for (int i = pinned_points.size() - 1; 0 <= i; --i) {
if (!r[i].spatial_attachment)
@@ -813,13 +813,13 @@ int SoftBody::_get_pinned_point(int p_point_index, SoftBody::PinnedPoint *&r_poi
r_point = NULL;
return -1;
} else {
- r_point = const_cast<SoftBody::PinnedPoint *>(&pinned_points.read()[id]);
+ r_point = const_cast<SoftBody::PinnedPoint *>(&pinned_points.ptr()[id]);
return id;
}
}
int SoftBody::_has_pinned_point(int p_point_index) const {
- PoolVector<PinnedPoint>::Read r = pinned_points.read();
+ const PinnedPoint *r = pinned_points.ptr();
for (int i = pinned_points.size() - 1; 0 <= i; --i) {
if (p_point_index == r[i].point_index) {
return i;
diff --git a/scene/3d/soft_body.h b/scene/3d/soft_body.h
index 800db12594..d6c35a5989 100644
--- a/scene/3d/soft_body.h
+++ b/scene/3d/soft_body.h
@@ -41,12 +41,12 @@ class SoftBodyVisualServerHandler {
RID mesh;
int surface;
- PoolVector<uint8_t> buffer;
+ Vector<uint8_t> buffer;
uint32_t stride;
uint32_t offset_vertices;
uint32_t offset_normal;
- PoolVector<uint8_t>::Write write_buffer;
+ uint8_t *write_buffer;
private:
SoftBodyVisualServerHandler();
@@ -87,7 +87,7 @@ private:
uint32_t collision_mask;
uint32_t collision_layer;
NodePath parent_collision_ignore;
- PoolVector<PinnedPoint> pinned_points;
+ Vector<PinnedPoint> pinned_points;
bool simulation_started;
bool pinned_points_cache_dirty;
@@ -138,8 +138,8 @@ public:
void set_parent_collision_ignore(const NodePath &p_parent_collision_ignore);
const NodePath &get_parent_collision_ignore() const;
- void set_pinned_points_indices(PoolVector<PinnedPoint> p_pinned_points_indices);
- PoolVector<PinnedPoint> get_pinned_points_indices();
+ void set_pinned_points_indices(Vector<PinnedPoint> p_pinned_points_indices);
+ Vector<PinnedPoint> get_pinned_points_indices();
void set_simulation_precision(int p_simulation_precision);
int get_simulation_precision();
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 04f00a527e..7351b87078 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -197,18 +197,18 @@ AABB SpriteBase3D::get_aabb() const {
return aabb;
}
-PoolVector<Face3> SpriteBase3D::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> SpriteBase3D::get_faces(uint32_t p_usage_flags) const {
- return PoolVector<Face3>();
+ return Vector<Face3>();
}
Ref<TriangleMesh> SpriteBase3D::generate_triangle_mesh() const {
if (triangle_mesh.is_valid())
return triangle_mesh;
- PoolVector<Vector3> faces;
+ Vector<Vector3> faces;
faces.resize(6);
- PoolVector<Vector3>::Write facesw = faces.write();
+ Vector3 *facesw = faces.ptrw();
Rect2 final_rect = get_item_rect();
@@ -254,8 +254,6 @@ Ref<TriangleMesh> SpriteBase3D::generate_triangle_mesh() const {
facesw[j] = vtx;
}
- facesw.release();
-
triangle_mesh = Ref<TriangleMesh>(memnew(TriangleMesh));
triangle_mesh->create(faces);
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index 9c31a667b5..3b3f0265ce 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -137,7 +137,7 @@ public:
virtual Rect2 get_item_rect() const = 0;
virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const;
Ref<TriangleMesh> generate_triangle_mesh() const;
SpriteBase3D();
diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h
index c1d6c2b015..fee6787c87 100644
--- a/scene/3d/visual_instance.h
+++ b/scene/3d/visual_instance.h
@@ -63,7 +63,7 @@ public:
RID get_instance() const;
virtual AABB get_aabb() const = 0;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const = 0;
+ virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const = 0;
virtual AABB get_transformed_aabb() const; // helper
diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp
index 7cf26ab974..0257e6e83d 100644
--- a/scene/3d/voxelizer.cpp
+++ b/scene/3d/voxelizer.cpp
@@ -497,7 +497,7 @@ Vector<Color> Voxelizer::_get_bake_texture(Ref<Image> p_image, const Color &p_co
p_image->convert(Image::FORMAT_RGBA8);
p_image->resize(bake_texture_size, bake_texture_size, Image::INTERPOLATE_CUBIC);
- PoolVector<uint8_t>::Read r = p_image->get_data().read();
+ const uint8_t *r = p_image->get_data().ptr();
ret.resize(bake_texture_size * bake_texture_size);
for (int i = 0; i < bake_texture_size * bake_texture_size; i++) {
@@ -589,32 +589,32 @@ void Voxelizer::plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, const Vec
Array a = p_mesh->surface_get_arrays(i);
- PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];
- PoolVector<Vector3>::Read vr = vertices.read();
- PoolVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV];
- PoolVector<Vector2>::Read uvr;
- PoolVector<Vector3> normals = a[Mesh::ARRAY_NORMAL];
- PoolVector<Vector3>::Read nr;
- PoolVector<int> index = a[Mesh::ARRAY_INDEX];
+ Vector<Vector3> vertices = a[Mesh::ARRAY_VERTEX];
+ const Vector3 *vr = vertices.ptr();
+ Vector<Vector2> uv = a[Mesh::ARRAY_TEX_UV];
+ const Vector2 *uvr;
+ Vector<Vector3> normals = a[Mesh::ARRAY_NORMAL];
+ const Vector3 *nr;
+ Vector<int> index = a[Mesh::ARRAY_INDEX];
bool read_uv = false;
bool read_normals = false;
if (uv.size()) {
- uvr = uv.read();
+ uvr = uv.ptr();
read_uv = true;
}
if (normals.size()) {
read_normals = true;
- nr = normals.read();
+ nr = normals.ptr();
}
if (index.size()) {
int facecount = index.size() / 3;
- PoolVector<int>::Read ir = index.read();
+ const int *ir = index.ptr();
for (int j = 0; j < facecount; j++) {
@@ -886,12 +886,12 @@ int Voxelizer::get_giprobe_cell_count() const {
return bake_cells.size();
}
-PoolVector<uint8_t> Voxelizer::get_giprobe_octree_cells() const {
- PoolVector<uint8_t> data;
+Vector<uint8_t> Voxelizer::get_giprobe_octree_cells() const {
+ Vector<uint8_t> data;
data.resize((8 * 4) * bake_cells.size()); //8 uint32t values
{
- PoolVector<uint8_t>::Write w = data.write();
- uint32_t *children_cells = (uint32_t *)w.ptr();
+ uint8_t *w = data.ptrw();
+ uint32_t *children_cells = (uint32_t *)w;
const Cell *cells = bake_cells.ptr();
uint32_t cell_count = bake_cells.size();
@@ -906,12 +906,12 @@ PoolVector<uint8_t> Voxelizer::get_giprobe_octree_cells() const {
return data;
}
-PoolVector<uint8_t> Voxelizer::get_giprobe_data_cells() const {
- PoolVector<uint8_t> data;
+Vector<uint8_t> Voxelizer::get_giprobe_data_cells() const {
+ Vector<uint8_t> data;
data.resize((4 * 4) * bake_cells.size()); //8 uint32t values
{
- PoolVector<uint8_t>::Write w = data.write();
- uint32_t *dataptr = (uint32_t *)w.ptr();
+ uint8_t *w = data.ptrw();
+ uint32_t *dataptr = (uint32_t *)w;
const Cell *cells = bake_cells.ptr();
uint32_t cell_count = bake_cells.size();
@@ -962,13 +962,13 @@ PoolVector<uint8_t> Voxelizer::get_giprobe_data_cells() const {
return data;
}
-PoolVector<int> Voxelizer::get_giprobe_level_cell_count() const {
+Vector<int> Voxelizer::get_giprobe_level_cell_count() const {
uint32_t cell_count = bake_cells.size();
const Cell *cells = bake_cells.ptr();
- PoolVector<int> level_count;
+ Vector<int> level_count;
level_count.resize(cell_subdiv + 1); //remember, always x+1 levels for x subdivisions
{
- PoolVector<int>::Write w = level_count.write();
+ int *w = level_count.ptrw();
for (int i = 0; i < cell_subdiv + 1; i++) {
w[i] = 0;
}
@@ -1025,7 +1025,7 @@ static void edt(float *f, int stride, int n) {
#undef square
-PoolVector<uint8_t> Voxelizer::get_sdf_3d_image() const {
+Vector<uint8_t> Voxelizer::get_sdf_3d_image() const {
Vector3i octree_size = get_giprobe_octree_size();
@@ -1078,10 +1078,10 @@ PoolVector<uint8_t> Voxelizer::get_sdf_3d_image() const {
}
}
- PoolVector<uint8_t> image3d;
+ Vector<uint8_t> image3d;
image3d.resize(float_count);
{
- PoolVector<uint8_t>::Write w = image3d.write();
+ uint8_t *w = image3d.ptrw();
for (uint32_t i = 0; i < float_count; i++) {
uint32_t d = uint32_t(Math::sqrt(work_memory[i]));
if (d == 0) {
@@ -1154,8 +1154,8 @@ Ref<MultiMesh> Voxelizer::create_debug_multimesh() {
Array arr;
arr.resize(Mesh::ARRAY_MAX);
- PoolVector<Vector3> vertices;
- PoolVector<Color> colors;
+ Vector<Vector3> vertices;
+ Vector<Color> colors;
#define ADD_VTX(m_idx) \
vertices.push_back(face_points[m_idx]); \
colors.push_back(Color(1, 1, 1, 1));
diff --git a/scene/3d/voxelizer.h b/scene/3d/voxelizer.h
index 5016ff029f..0ea613e2fd 100644
--- a/scene/3d/voxelizer.h
+++ b/scene/3d/voxelizer.h
@@ -132,10 +132,10 @@ public:
int get_gi_probe_octree_depth() const;
Vector3i get_giprobe_octree_size() const;
int get_giprobe_cell_count() const;
- PoolVector<uint8_t> get_giprobe_octree_cells() const;
- PoolVector<uint8_t> get_giprobe_data_cells() const;
- PoolVector<int> get_giprobe_level_cell_count() const;
- PoolVector<uint8_t> get_sdf_3d_image() const;
+ Vector<uint8_t> get_giprobe_octree_cells() const;
+ Vector<uint8_t> get_giprobe_data_cells() const;
+ Vector<int> get_giprobe_level_cell_count() const;
+ Vector<uint8_t> get_sdf_3d_image() const;
Ref<MultiMesh> create_debug_multimesh();