summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/camera.h6
-rw-r--r--scene/3d/collision_shape.cpp7
-rw-r--r--scene/3d/immediate_geometry.h4
-rw-r--r--scene/3d/navigation_mesh.cpp2
-rw-r--r--scene/3d/particles.cpp21
-rw-r--r--scene/3d/particles.h2
-rw-r--r--scene/3d/proximity_group.cpp4
-rw-r--r--scene/3d/skeleton.cpp4
-rw-r--r--scene/3d/skeleton.h6
-rw-r--r--scene/3d/spatial_velocity_tracker.h2
-rw-r--r--scene/3d/sprite_3d.h2
-rw-r--r--scene/3d/vehicle_body.cpp4
-rw-r--r--scene/3d/vehicle_body.h2
13 files changed, 32 insertions, 34 deletions
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index 43975892b4..70849791e5 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -126,9 +126,9 @@ public:
virtual Transform get_camera_transform() const;
- Vector3 project_ray_normal(const Point2 &p_point) const;
- Vector3 project_ray_origin(const Point2 &p_point) const;
- Vector3 project_local_ray_normal(const Point2 &p_point) const;
+ Vector3 project_ray_normal(const Point2 &p_pos) const;
+ Vector3 project_ray_origin(const Point2 &p_pos) const;
+ Vector3 project_local_ray_normal(const Point2 &p_pos) const;
Point2 unproject_position(const Vector3 &p_pos) const;
bool is_position_behind(const Vector3 &p_pos) const;
Vector3 project_position(const Point2 &p_point) const;
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
index 4fd215bd1a..2aa6a95718 100644
--- a/scene/3d/collision_shape.cpp
+++ b/scene/3d/collision_shape.cpp
@@ -89,13 +89,6 @@ void CollisionShape::_notification(int p_what) {
parent->shape_owner_set_transform(owner_id, get_transform());
}
} break;
- case NOTIFICATION_EXIT_TREE: {
- if (parent) {
- parent->remove_shape_owner(owner_id);
- }
- owner_id = 0;
- parent = NULL;
- } break;
case NOTIFICATION_UNPARENTED: {
if (parent) {
parent->remove_shape_owner(owner_id);
diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h
index 2eb4bf1e6b..bc8452c7e0 100644
--- a/scene/3d/immediate_geometry.h
+++ b/scene/3d/immediate_geometry.h
@@ -52,8 +52,8 @@ public:
void set_normal(const Vector3 &p_normal);
void set_tangent(const Plane &p_tangent);
void set_color(const Color &p_color);
- void set_uv(const Vector2 &tex_uv);
- void set_uv2(const Vector2 &tex_uv);
+ void set_uv(const Vector2 &p_uv);
+ void set_uv2(const Vector2 &p_uv2);
void add_vertex(const Vector3 &p_vertex);
diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp
index 4c93bcfb5e..5d4568f5d3 100644
--- a/scene/3d/navigation_mesh.cpp
+++ b/scene/3d/navigation_mesh.cpp
@@ -208,6 +208,8 @@ void NavigationMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_polygon", "idx"), &NavigationMesh::get_polygon);
ClassDB::bind_method(D_METHOD("clear_polygons"), &NavigationMesh::clear_polygons);
+ ClassDB::bind_method(D_METHOD("create_from_mesh", "mesh"), &NavigationMesh::create_from_mesh);
+
ClassDB::bind_method(D_METHOD("_set_polygons", "polygons"), &NavigationMesh::_set_polygons);
ClassDB::bind_method(D_METHOD("_get_polygons"), &NavigationMesh::_get_polygons);
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index 081caf4419..e88a52c76a 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -63,6 +63,8 @@ void Particles::set_one_shot(bool p_one_shot) {
one_shot = p_one_shot;
VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+ if (!one_shot && emitting)
+ VisualServer::get_singleton()->particles_restart(particles);
}
void Particles::set_pre_process_time(float p_time) {
@@ -406,7 +408,7 @@ void ParticlesMaterial::init_shaders() {
shader_names->anim_speed = "anim_speed";
shader_names->anim_offset = "anim_offset";
- shader_names->initial_linear_velocity = "initial_linear_velocity_random";
+ shader_names->initial_linear_velocity_random = "initial_linear_velocity_random";
shader_names->initial_angle_random = "initial_angle_random";
shader_names->angular_velocity_random = "angular_velocity_random";
shader_names->orbit_velocity_random = "orbit_velocity_random";
@@ -753,18 +755,20 @@ void ParticlesMaterial::_update_shader() {
code += " pos.z=0.0; \n";
}
code += " //apply linear acceleration\n";
- code += " force+=normalize(VELOCITY) * (linear_accel+tex_linear_accel)*mix(1.0,rand_from_seed(alt_seed),linear_accel_random);\n";
+ code += " force+= length(VELOCITY) > 0.0 ? normalize(VELOCITY) * (linear_accel+tex_linear_accel)*mix(1.0,rand_from_seed(alt_seed),linear_accel_random) : vec3(0.0);\n";
code += " //apply radial acceleration\n";
code += " vec3 org = vec3(0.0);\n";
- code += " // if (!p_system->local_coordinates)\n";
- code += " //org=p_transform.origin;\n";
- code += " force+=normalize(pos-org) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random);\n";
+ code += " // if (!p_system->local_coordinates)\n";
+ code += " //org=p_transform.origin;\n";
+ code += " vec3 diff = pos-org;\n";
+ code += " force+=length(diff) > 0.0 ? normalize(diff) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random) : vec3(0.0);\n";
code += " //apply tangential acceleration;\n";
if (flags[FLAG_DISABLE_Z]) {
- code += " force+=vec3(normalize((pos-org).yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n";
+ code += " force+=length(diff.yx) > 0.0 ? vec3(normalize(diff.yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n";
} else {
- code += " force+=normalize(cross(normalize(pos-org),normalize(gravity))) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n";
+ code += " vec3 crossDiff = cross(normalize(diff),normalize(gravity));\n";
+ code += " force+=length(crossDiff) > 0.0 ? normalize(crossDiff) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n";
}
code += " //apply attractor forces\n";
code += " VELOCITY+=force * DELTA;\n";
@@ -1264,9 +1268,8 @@ int ParticlesMaterial::get_emission_point_count() const {
void ParticlesMaterial::set_trail_divisor(int p_divisor) {
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor);
trail_divisor = p_divisor;
- _change_notify();
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor);
}
int ParticlesMaterial::get_trail_divisor() const {
diff --git a/scene/3d/particles.h b/scene/3d/particles.h
index 31ca85a59a..9c1436a47b 100644
--- a/scene/3d/particles.h
+++ b/scene/3d/particles.h
@@ -88,7 +88,7 @@ public:
void set_emitting(bool p_emitting);
void set_amount(int p_amount);
void set_lifetime(float p_lifetime);
- void set_one_shot(bool p_enabled);
+ void set_one_shot(bool p_one_shot);
void set_pre_process_time(float p_time);
void set_explosiveness_ratio(float p_ratio);
void set_randomness_ratio(float p_ratio);
diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp
index 5441904d81..d0410f2c55 100644
--- a/scene/3d/proximity_group.cpp
+++ b/scene/3d/proximity_group.cpp
@@ -116,9 +116,9 @@ void ProximityGroup::set_group_name(String p_group_name) {
group_name = p_group_name;
};
-void ProximityGroup::_notification(int what) {
+void ProximityGroup::_notification(int p_what) {
- switch (what) {
+ switch (p_what) {
case NOTIFICATION_EXIT_TREE:
++group_version;
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 0d91014314..cee97af244 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -82,9 +82,9 @@ bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
return true;
}
-bool Skeleton::_get(const StringName &p_name, Variant &r_ret) const {
+bool Skeleton::_get(const StringName &p_path, Variant &r_ret) const {
- String path = p_name;
+ String path = p_path;
if (!path.begins_with("bones/"))
return false;
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index dc0adbb337..a6546af64e 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -91,8 +91,8 @@ class Skeleton : public Spatial {
}
protected:
- bool _get(const StringName &p_name, Variant &r_ret) const;
- bool _set(const StringName &p_name, const Variant &p_value);
+ bool _get(const StringName &p_path, Variant &r_ret) const;
+ bool _set(const StringName &p_path, const Variant &p_value);
void _get_property_list(List<PropertyInfo> *p_list) const;
void _notification(int p_what);
static void _bind_methods();
@@ -113,7 +113,7 @@ public:
void set_bone_parent(int p_bone, int p_parent);
int get_bone_parent(int p_bone) const;
- void unparent_bone_and_rest(int p_idx);
+ void unparent_bone_and_rest(int p_bone);
void set_bone_disable_rest(int p_bone, bool p_disable);
bool is_bone_rest_disabled(int p_bone) const;
diff --git a/scene/3d/spatial_velocity_tracker.h b/scene/3d/spatial_velocity_tracker.h
index 65f3eaca93..b8237613a7 100644
--- a/scene/3d/spatial_velocity_tracker.h
+++ b/scene/3d/spatial_velocity_tracker.h
@@ -20,7 +20,7 @@ protected:
public:
void reset(const Vector3 &p_new_pos);
- void set_track_fixed_step(bool p_use_fixed_step);
+ void set_track_fixed_step(bool p_track_fixed_step);
bool is_tracking_fixed_step() const;
void update_position(const Vector3 &p_position);
Vector3 get_tracked_linear_velocity() const;
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index b4600c00b8..7dc4cd4ffb 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -119,7 +119,7 @@ public:
void set_pixel_size(float p_amount);
float get_pixel_size() const;
- void set_axis(Vector3::Axis p_amount);
+ void set_axis(Vector3::Axis p_axis);
Vector3::Axis get_axis() const;
void set_draw_flag(DrawFlags p_flag, bool p_enable);
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 8d927e529e..adf235c525 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -893,9 +893,9 @@ real_t VehicleBody::get_friction() const {
return friction;
}
-void VehicleBody::set_engine_force(float p_force) {
+void VehicleBody::set_engine_force(float p_engine_force) {
- engine_force = p_force;
+ engine_force = p_engine_force;
}
float VehicleBody::get_engine_force() const {
diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h
index 7ed9bce730..d778800814 100644
--- a/scene/3d/vehicle_body.h
+++ b/scene/3d/vehicle_body.h
@@ -196,7 +196,7 @@ public:
void set_engine_force(float p_engine_force);
float get_engine_force() const;
- void set_brake(float p_force);
+ void set_brake(float p_brake);
float get_brake() const;
void set_steering(float p_steering);