summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/area.cpp13
-rw-r--r--scene/3d/area.h1
-rw-r--r--scene/3d/audio_stream_player_3d.cpp54
-rw-r--r--scene/3d/audio_stream_player_3d.h34
-rw-r--r--scene/3d/baked_lightmap.cpp36
-rw-r--r--scene/3d/baked_lightmap.h30
-rw-r--r--scene/3d/bone_attachment.cpp49
-rw-r--r--scene/3d/bone_attachment.h5
-rw-r--r--scene/3d/camera.cpp1
-rw-r--r--scene/3d/camera.h3
-rw-r--r--scene/3d/collision_object.cpp15
-rw-r--r--scene/3d/collision_object.h3
-rw-r--r--scene/3d/collision_polygon.cpp21
-rw-r--r--scene/3d/collision_polygon.h3
-rw-r--r--scene/3d/collision_shape.cpp18
-rw-r--r--scene/3d/collision_shape.h3
-rw-r--r--scene/3d/gi_probe.cpp3
-rw-r--r--scene/3d/gi_probe.h1
-rw-r--r--scene/3d/immediate_geometry.cpp1
-rw-r--r--scene/3d/immediate_geometry.h1
-rw-r--r--scene/3d/interpolated_camera.cpp1
-rw-r--r--scene/3d/interpolated_camera.h1
-rw-r--r--scene/3d/light.cpp1
-rw-r--r--scene/3d/light.h1
-rw-r--r--scene/3d/listener.cpp1
-rw-r--r--scene/3d/listener.h1
-rw-r--r--scene/3d/mesh_instance.cpp1
-rw-r--r--scene/3d/mesh_instance.h1
-rw-r--r--scene/3d/multimesh_instance.cpp1
-rw-r--r--scene/3d/multimesh_instance.h1
-rw-r--r--scene/3d/navigation.cpp1
-rw-r--r--scene/3d/navigation.h1
-rw-r--r--scene/3d/navigation_mesh.cpp5
-rw-r--r--scene/3d/navigation_mesh.h1
-rw-r--r--scene/3d/particles.cpp18
-rw-r--r--scene/3d/particles.h1
-rw-r--r--scene/3d/path.cpp72
-rw-r--r--scene/3d/path.h5
-rw-r--r--scene/3d/physics_body.cpp18
-rw-r--r--scene/3d/physics_body.h6
-rw-r--r--scene/3d/physics_joint.cpp4
-rw-r--r--scene/3d/physics_joint.h1
-rw-r--r--scene/3d/portal.cpp1
-rw-r--r--scene/3d/portal.h1
-rw-r--r--scene/3d/position_3d.cpp1
-rw-r--r--scene/3d/position_3d.h1
-rw-r--r--scene/3d/proximity_group.cpp38
-rw-r--r--scene/3d/proximity_group.h13
-rw-r--r--scene/3d/ray_cast.cpp3
-rw-r--r--scene/3d/ray_cast.h1
-rw-r--r--scene/3d/reflection_probe.cpp3
-rw-r--r--scene/3d/reflection_probe.h1
-rw-r--r--scene/3d/remote_transform.h1
-rw-r--r--scene/3d/room_instance.cpp1
-rw-r--r--scene/3d/room_instance.h1
-rw-r--r--scene/3d/scenario_fx.cpp1
-rw-r--r--scene/3d/scenario_fx.h1
-rw-r--r--scene/3d/skeleton.cpp7
-rw-r--r--scene/3d/skeleton.h9
-rw-r--r--scene/3d/spatial.cpp5
-rw-r--r--scene/3d/spatial.h1
-rw-r--r--scene/3d/spatial_velocity_tracker.cpp32
-rw-r--r--scene/3d/spatial_velocity_tracker.h30
-rw-r--r--scene/3d/sprite_3d.cpp1
-rw-r--r--scene/3d/sprite_3d.h1
-rw-r--r--scene/3d/vehicle_body.cpp78
-rw-r--r--scene/3d/vehicle_body.h20
-rw-r--r--scene/3d/visibility_notifier.cpp7
-rw-r--r--scene/3d/visibility_notifier.h1
-rw-r--r--scene/3d/visual_instance.cpp1
-rw-r--r--scene/3d/visual_instance.h1
-rw-r--r--scene/3d/voxel_light_baker.cpp26
-rw-r--r--scene/3d/voxel_light_baker.h4
73 files changed, 490 insertions, 240 deletions
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index ad8bf7141a..21f471039f 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "area.h"
#include "scene/scene_string_names.h"
#include "servers/audio_server.h"
@@ -168,7 +169,7 @@ void Area::_body_inout(int p_status, const RID &p_body, int p_instance, int p_bo
E->get().in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
}
@@ -195,7 +196,7 @@ void Area::_body_inout(int p_status, const RID &p_body, int p_instance, int p_bo
if (node) {
node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
if (E->get().in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
}
@@ -245,7 +246,7 @@ void Area::_clear_monitoring() {
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
}
}
@@ -275,7 +276,7 @@ void Area::_clear_monitoring() {
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree);
- node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_area_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree);
}
}
}
@@ -365,7 +366,7 @@ void Area::_area_inout(int p_status, const RID &p_area, int p_instance, int p_ar
E->get().in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree, make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
}
@@ -392,7 +393,7 @@ void Area::_area_inout(int p_status, const RID &p_area, int p_instance, int p_ar
if (node) {
node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree);
- node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_area_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree);
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
}
diff --git a/scene/3d/area.h b/scene/3d/area.h
index fa01a783f9..e49b7e493b 100644
--- a/scene/3d/area.h
+++ b/scene/3d/area.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef AREA_H
#define AREA_H
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 6c102e4027..d448ef024d 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* audio_stream_player_3d.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#include "audio_stream_player_3d.h"
#include "engine.h"
#include "scene/3d/area.h"
@@ -27,18 +57,18 @@ void AudioStreamPlayer3D::_mix_audio() {
//mix
if (output_count > 0 || out_of_range_mode == OUT_OF_RANGE_MIX) {
- float pitch_scale = 0.0;
+ float output_pitch_scale = 0.0;
if (output_count) {
//used for doppler, not realistic but good enough
for (int i = 0; i < output_count; i++) {
- pitch_scale += outputs[i].pitch_scale;
+ output_pitch_scale += outputs[i].pitch_scale;
}
- pitch_scale /= float(output_count);
+ output_pitch_scale /= float(output_count);
} else {
- pitch_scale = 1.0;
+ output_pitch_scale = 1.0;
}
- stream_playback->mix(buffer, pitch_scale, buffer_size);
+ stream_playback->mix(buffer, pitch_scale * output_pitch_scale, buffer_size);
}
//write all outputs
@@ -290,7 +320,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
total_max = MAX(total_max, cam_area_pos.length());
}
if (total_max > max_distance) {
- continue; //cant hear this sound in this camera
+ continue; //can't hear this sound in this camera
}
}
@@ -577,6 +607,13 @@ float AudioStreamPlayer3D::get_max_db() const {
return max_db;
}
+void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) {
+ pitch_scale = p_pitch_scale;
+}
+float AudioStreamPlayer3D::get_pitch_scale() const {
+ return pitch_scale;
+}
+
void AudioStreamPlayer3D::play(float p_from_pos) {
if (stream_playback.is_valid()) {
@@ -802,6 +839,9 @@ void AudioStreamPlayer3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_max_db", "max_db"), &AudioStreamPlayer3D::set_max_db);
ClassDB::bind_method(D_METHOD("get_max_db"), &AudioStreamPlayer3D::get_max_db);
+ ClassDB::bind_method(D_METHOD("set_pitch_scale", "pitch_scale"), &AudioStreamPlayer3D::set_pitch_scale);
+ ClassDB::bind_method(D_METHOD("get_pitch_scale"), &AudioStreamPlayer3D::get_pitch_scale);
+
ClassDB::bind_method(D_METHOD("play", "from_position"), &AudioStreamPlayer3D::play, DEFVAL(0.0));
ClassDB::bind_method(D_METHOD("seek", "to_position"), &AudioStreamPlayer3D::seek);
ClassDB::bind_method(D_METHOD("stop"), &AudioStreamPlayer3D::stop);
@@ -855,6 +895,7 @@ void AudioStreamPlayer3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE, "0.01,32,0.01"), "set_pitch_scale", "get_pitch_scale");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "is_playing");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_RANGE, "0,65536,1"), "set_max_distance", "get_max_distance");
@@ -891,6 +932,7 @@ AudioStreamPlayer3D::AudioStreamPlayer3D() {
unit_size = 1;
attenuation_model = ATTENUATION_INVERSE_DISTANCE;
max_db = 3;
+ pitch_scale = 1.0;
autoplay = false;
setseek = -1;
active = false;
diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h
index 5982d7a3ac..1fcb83cf21 100644
--- a/scene/3d/audio_stream_player_3d.h
+++ b/scene/3d/audio_stream_player_3d.h
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* audio_stream_player_3d.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#ifndef AUDIO_STREAM_PLAYER_3D_H
#define AUDIO_STREAM_PLAYER_3D_H
@@ -76,6 +106,7 @@ private:
float unit_db;
float unit_size;
float max_db;
+ float pitch_scale;
bool autoplay;
StringName bus;
@@ -123,6 +154,9 @@ public:
void set_max_db(float p_boost);
float get_max_db() const;
+ void set_pitch_scale(float p_pitch_scale);
+ float get_pitch_scale() const;
+
void play(float p_from_pos = 0.0);
void seek(float p_seconds);
void stop();
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index 8c282a31b8..fa4e6492a1 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* baked_lightmap.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#include "baked_lightmap.h"
#include "io/resource_saver.h"
#include "os/dir_access.h"
@@ -140,11 +170,11 @@ void BakedLightmapData::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear_users"), &BakedLightmapData::clear_users);
ADD_PROPERTY(PropertyInfo(Variant::AABB, "bounds", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_bounds", "get_bounds");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "octree", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_octree", "get_octree");
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"), "set_energy", "get_energy");
- ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "user_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_user_data", "_get_user_data");
+ ADD_PROPERTY(PropertyInfo(Variant::POOL_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");
}
BakedLightmapData::BakedLightmapData() {
@@ -754,7 +784,7 @@ void BakedLightmap::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "capture_cell_size", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_capture_cell_size", "get_capture_cell_size");
ADD_GROUP("Data", "");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "image_path", PROPERTY_HINT_DIR), "set_image_path", "get_image_path");
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "light_data", PROPERTY_HINT_RESOURCE_TYPE, "BakedIndirectLightData"), "set_light_data", "get_light_data");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "light_data", PROPERTY_HINT_RESOURCE_TYPE, "BakedLightmapData"), "set_light_data", "get_light_data");
BIND_ENUM_CONSTANT(BAKE_QUALITY_LOW);
BIND_ENUM_CONSTANT(BAKE_QUALITY_MEDIUM);
diff --git a/scene/3d/baked_lightmap.h b/scene/3d/baked_lightmap.h
index 9b53e41d73..60b62f74eb 100644
--- a/scene/3d/baked_lightmap.h
+++ b/scene/3d/baked_lightmap.h
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* baked_lightmap.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#ifndef BAKED_INDIRECT_LIGHT_H
#define BAKED_INDIRECT_LIGHT_H
diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp
index 9e3b15461b..a875b65c22 100644
--- a/scene/3d/bone_attachment.cpp
+++ b/scene/3d/bone_attachment.cpp
@@ -27,45 +27,30 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "bone_attachment.h"
-
-bool BoneAttachment::_get(const StringName &p_name, Variant &r_ret) const {
- if (String(p_name) == "bone_name") {
-
- r_ret = get_bone_name();
- return true;
- }
+#include "bone_attachment.h"
- return false;
-}
-bool BoneAttachment::_set(const StringName &p_name, const Variant &p_value) {
+void BoneAttachment::_validate_property(PropertyInfo &property) const {
- if (String(p_name) == "bone_name") {
+ if (property.name == "bone_name") {
+ Skeleton *parent = Object::cast_to<Skeleton>(get_parent());
- set_bone_name(p_value);
- return true;
- }
+ if (parent) {
- return false;
-}
-void BoneAttachment::_get_property_list(List<PropertyInfo> *p_list) const {
-
- Skeleton *parent = Object::cast_to<Skeleton>(get_parent());
+ String names;
+ for (int i = 0; i < parent->get_bone_count(); i++) {
+ if (i > 0)
+ names += ",";
+ names += parent->get_bone_name(i);
+ }
- if (parent) {
+ property.hint = PROPERTY_HINT_ENUM;
+ property.hint_string = names;
+ } else {
- String names;
- for (int i = 0; i < parent->get_bone_count(); i++) {
- if (i > 0)
- names += ",";
- names += parent->get_bone_name(i);
+ property.hint = PROPERTY_HINT_NONE;
+ property.hint_string = "";
}
-
- p_list->push_back(PropertyInfo(Variant::STRING, "bone_name", PROPERTY_HINT_ENUM, names));
- } else {
-
- p_list->push_back(PropertyInfo(Variant::STRING, "bone_name"));
}
}
@@ -137,4 +122,6 @@ BoneAttachment::BoneAttachment() {
void BoneAttachment::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_bone_name", "bone_name"), &BoneAttachment::set_bone_name);
ClassDB::bind_method(D_METHOD("get_bone_name"), &BoneAttachment::get_bone_name);
+
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "bone_name"), "set_bone_name", "get_bone_name");
}
diff --git a/scene/3d/bone_attachment.h b/scene/3d/bone_attachment.h
index 57bc71a51f..81a225015e 100644
--- a/scene/3d/bone_attachment.h
+++ b/scene/3d/bone_attachment.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef BONE_ATTACHMENT_H
#define BONE_ATTACHMENT_H
@@ -43,9 +44,7 @@ class BoneAttachment : public Spatial {
void _check_unbind();
protected:
- bool _get(const StringName &p_name, Variant &r_ret) const;
- bool _set(const StringName &p_name, const Variant &p_value);
- void _get_property_list(List<PropertyInfo> *p_list) const;
+ virtual void _validate_property(PropertyInfo &property) const;
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index 840783c399..6998b34cfd 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "camera.h"
#include "camera_matrix.h"
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index c24286ecc5..e2679870de 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef CAMERA_H
#define CAMERA_H
@@ -96,7 +97,7 @@ protected:
void _update_camera_mode();
void _notification(int p_what);
- virtual void _validate_property(PropertyInfo &property) const;
+ virtual void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index e591b17aa6..07235b3da4 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "collision_object.h"
#include "scene/scene_string_names.h"
@@ -364,6 +365,20 @@ bool CollisionObject::get_capture_input_on_drag() const {
return capture_input_on_drag;
}
+String CollisionObject::get_configuration_warning() const {
+
+ String warning = Spatial::get_configuration_warning();
+
+ if (shapes.empty()) {
+ if (warning == String()) {
+ warning += "\n";
+ }
+ warning += TTR("This node has no children shapes, so it can't interact with the space.\nConsider adding CollisionShape or CollisionPolygon children nodes to define its shape.");
+ }
+
+ return warning;
+}
+
CollisionObject::CollisionObject() {
capture_input_on_drag = false;
diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h
index c1fed559c5..f31d65e411 100644
--- a/scene/3d/collision_object.h
+++ b/scene/3d/collision_object.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef COLLISION_OBJECT_H
#define COLLISION_OBJECT_H
@@ -108,6 +109,8 @@ public:
_FORCE_INLINE_ RID get_rid() const { return rid; }
+ virtual String get_configuration_warning() const;
+
CollisionObject();
~CollisionObject();
};
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index 7d894a0544..3a77360bc2 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "collision_polygon.h"
#include "collision_object.h"
@@ -72,6 +73,14 @@ void CollisionPolygon::_build_polygon() {
}
}
+void CollisionPolygon::_update_in_shape_owner(bool p_xform_only) {
+
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ if (p_xform_only)
+ return;
+ parent->shape_owner_set_disabled(owner_id, disabled);
+}
+
void CollisionPolygon::_notification(int p_what) {
switch (p_what) {
@@ -81,14 +90,20 @@ void CollisionPolygon::_notification(int p_what) {
if (parent) {
owner_id = parent->create_shape_owner(this);
_build_polygon();
- parent->shape_owner_set_transform(owner_id, get_transform());
- parent->shape_owner_set_disabled(owner_id, disabled);
+ _update_in_shape_owner();
}
} break;
+ case NOTIFICATION_ENTER_TREE: {
+
+ if (parent) {
+ _update_in_shape_owner();
+ }
+
+ } break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
if (parent) {
- parent->shape_owner_set_transform(owner_id, get_transform());
+ _update_in_shape_owner(true);
}
} break;
diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h
index b979057da1..971c67f1ad 100644
--- a/scene/3d/collision_polygon.h
+++ b/scene/3d/collision_polygon.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef COLLISION_POLYGON_H
#define COLLISION_POLYGON_H
@@ -50,6 +51,8 @@ protected:
void _build_polygon();
+ void _update_in_shape_owner(bool p_xform_only = false);
+
protected:
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
index b5f3a09c09..943f4158f7 100644
--- a/scene/3d/collision_shape.cpp
+++ b/scene/3d/collision_shape.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "collision_shape.h"
#include "scene/resources/box_shape.h"
#include "scene/resources/capsule_shape.h"
@@ -63,6 +64,14 @@ void CollisionShape::make_convex_from_brothers() {
}
}
+void CollisionShape::_update_in_shape_owner(bool p_xform_only) {
+
+ parent->shape_owner_set_transform(owner_id, get_transform());
+ if (p_xform_only)
+ return;
+ parent->shape_owner_set_disabled(owner_id, disabled);
+}
+
void CollisionShape::_notification(int p_what) {
switch (p_what) {
@@ -74,19 +83,20 @@ void CollisionShape::_notification(int p_what) {
if (shape.is_valid()) {
parent->shape_owner_add_shape(owner_id, shape);
}
- parent->shape_owner_set_transform(owner_id, get_transform());
- parent->shape_owner_set_disabled(owner_id, disabled);
+ _update_in_shape_owner();
}
} break;
case NOTIFICATION_ENTER_TREE: {
+ if (parent) {
+ _update_in_shape_owner();
+ }
if (get_tree()->is_debugging_collisions_hint()) {
_create_debug_shape();
}
-
} break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
if (parent) {
- parent->shape_owner_set_transform(owner_id, get_transform());
+ _update_in_shape_owner(true);
}
} break;
case NOTIFICATION_UNPARENTED: {
diff --git a/scene/3d/collision_shape.h b/scene/3d/collision_shape.h
index 4728d3d5c1..c9c91a5824 100644
--- a/scene/3d/collision_shape.h
+++ b/scene/3d/collision_shape.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef COLLISION_SHAPE_H
#define COLLISION_SHAPE_H
@@ -50,6 +51,8 @@ class CollisionShape : public Spatial {
void _create_debug_shape();
+ void _update_in_shape_owner(bool p_xform_only = false);
+
protected:
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 21e8a6e17a..4ad2eb60ee 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "gi_probe.h"
#include "mesh_instance.h"
@@ -534,7 +535,7 @@ void GIProbe::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "normal_bias", PROPERTY_HINT_RANGE, "0,4,0.001"), "set_normal_bias", "get_normal_bias");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "compress"), "set_compress", "is_compressed");
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "GIProbeData"), "set_probe_data", "get_probe_data");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "GIProbeData", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE), "set_probe_data", "get_probe_data");
BIND_ENUM_CONSTANT(SUBDIV_64);
BIND_ENUM_CONSTANT(SUBDIV_128);
diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h
index af3c854f1f..af4b646590 100644
--- a/scene/3d/gi_probe.h
+++ b/scene/3d/gi_probe.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef GIPROBE_H
#define GIPROBE_H
diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp
index 8d8c1b65fc..14a0b0505d 100644
--- a/scene/3d/immediate_geometry.cpp
+++ b/scene/3d/immediate_geometry.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "immediate_geometry.h"
void ImmediateGeometry::begin(Mesh::PrimitiveType p_primitive, const Ref<Texture> &p_texture) {
diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h
index abcabf2c34..f7201b4bba 100644
--- a/scene/3d/immediate_geometry.h
+++ b/scene/3d/immediate_geometry.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef IMMEDIATE_GEOMETRY_H
#define IMMEDIATE_GEOMETRY_H
diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp
index 03f82e0e44..9865fe156a 100644
--- a/scene/3d/interpolated_camera.cpp
+++ b/scene/3d/interpolated_camera.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "interpolated_camera.h"
#include "engine.h"
diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h
index d74b13c214..b025112295 100644
--- a/scene/3d/interpolated_camera.h
+++ b/scene/3d/interpolated_camera.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef INTERPOLATED_CAMERA_H
#define INTERPOLATED_CAMERA_H
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 04c1f9e3e8..240bd631a1 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "light.h"
#include "engine.h"
diff --git a/scene/3d/light.h b/scene/3d/light.h
index 2639e47217..b35b397ced 100644
--- a/scene/3d/light.h
+++ b/scene/3d/light.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef LIGHT_H
#define LIGHT_H
diff --git a/scene/3d/listener.cpp b/scene/3d/listener.cpp
index 752a2059f5..439c1f8c45 100644
--- a/scene/3d/listener.cpp
+++ b/scene/3d/listener.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "listener.h"
#include "scene/resources/mesh.h"
diff --git a/scene/3d/listener.h b/scene/3d/listener.h
index db8dca8ce2..8047971ebd 100644
--- a/scene/3d/listener.h
+++ b/scene/3d/listener.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef LISTENER_H
#define LISTENER_H
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index cffcbd9a41..80bae911d4 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "mesh_instance.h"
#include "collision_shape.h"
diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h
index 74041a46bc..5d359cd4d5 100644
--- a/scene/3d/mesh_instance.h
+++ b/scene/3d/mesh_instance.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef MESH_INSTANCE_H
#define MESH_INSTANCE_H
diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp
index a6a8d434fa..4cbd1df64a 100644
--- a/scene/3d/multimesh_instance.cpp
+++ b/scene/3d/multimesh_instance.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "multimesh_instance.h"
void MultiMeshInstance::_bind_methods() {
diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h
index 312748b6f0..1cd077a0a5 100644
--- a/scene/3d/multimesh_instance.h
+++ b/scene/3d/multimesh_instance.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef MULTIMESH_INSTANCE_H
#define MULTIMESH_INSTANCE_H
diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp
index 5d41fe576b..e7ab6cde8a 100644
--- a/scene/3d/navigation.cpp
+++ b/scene/3d/navigation.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "navigation.h"
void Navigation::_navmesh_link(int p_id) {
diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h
index a5a4deebcd..5a501039c8 100644
--- a/scene/3d/navigation.h
+++ b/scene/3d/navigation.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef NAVIGATION_H
#define NAVIGATION_H
diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp
index 3e548b8e8f..073e56fdb4 100644
--- a/scene/3d/navigation_mesh.cpp
+++ b/scene/3d/navigation_mesh.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "navigation_mesh.h"
#include "mesh_instance.h"
#include "navigation.h"
@@ -404,8 +405,8 @@ void NavigationMesh::_bind_methods() {
BIND_CONSTANT(SAMPLE_PARTITION_MONOTONE);
BIND_CONSTANT(SAMPLE_PARTITION_LAYERS);
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "vertices", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_vertices", "get_vertices");
- ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "polygons", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_polygons", "_get_polygons");
+ ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "vertices", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_vertices", "get_vertices");
+ ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "polygons", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_polygons", "_get_polygons");
ADD_PROPERTY(PropertyInfo(Variant::INT, "sample_partition_type/sample_partition_type", PROPERTY_HINT_ENUM, "Watershed,Monotone,Layers"), "set_sample_partition_type", "get_sample_partition_type");
diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h
index 0a81e1c67b..753ad76edc 100644
--- a/scene/3d/navigation_mesh.h
+++ b/scene/3d/navigation_mesh.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef NAVIGATION_MESH_H
#define NAVIGATION_MESH_H
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index fda4647141..8617bbc2f6 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "particles.h"
#include "scene/resources/surface_tool.h"
#include "servers/visual_server.h"
@@ -1596,4 +1597,21 @@ ParticlesMaterial::ParticlesMaterial() :
}
ParticlesMaterial::~ParticlesMaterial() {
+
+ if (material_mutex)
+ material_mutex->lock();
+
+ if (shader_map.has(current_key)) {
+ shader_map[current_key].users--;
+ if (shader_map[current_key].users == 0) {
+ //deallocate shader, as it's no longer in use
+ VS::get_singleton()->free(shader_map[current_key].shader);
+ shader_map.erase(current_key);
+ }
+
+ VS::get_singleton()->material_set_shader(_get_material(), RID());
+ }
+
+ if (material_mutex)
+ material_mutex->unlock();
}
diff --git a/scene/3d/particles.h b/scene/3d/particles.h
index ebd2b6ce48..17e21c6cee 100644
--- a/scene/3d/particles.h
+++ b/scene/3d/particles.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef VISUALINSTANCEPARTICLES_H
#define VISUALINSTANCEPARTICLES_H
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index e0520fdb7c..7ac7f74bb0 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "path.h"
#include "engine.h"
@@ -189,61 +190,16 @@ bool PathFollow::get_cubic_interpolation() const {
return cubic;
}
-bool PathFollow::_set(const StringName &p_name, const Variant &p_value) {
-
- if (p_name == SceneStringNames::get_singleton()->offset) {
- set_offset(p_value);
- } else if (p_name == SceneStringNames::get_singleton()->unit_offset) {
- set_unit_offset(p_value);
- } else if (p_name == SceneStringNames::get_singleton()->rotation_mode) {
- set_rotation_mode(RotationMode(p_value.operator int()));
- } else if (p_name == SceneStringNames::get_singleton()->v_offset) {
- set_v_offset(p_value);
- } else if (p_name == SceneStringNames::get_singleton()->h_offset) {
- set_h_offset(p_value);
- } else if (String(p_name) == "cubic_interp") {
- set_cubic_interpolation(p_value);
- } else if (String(p_name) == "loop") {
- set_loop(p_value);
- } else
- return false;
-
- return true;
-}
+void PathFollow::_validate_property(PropertyInfo &property) const {
-bool PathFollow::_get(const StringName &p_name, Variant &r_ret) const {
-
- if (p_name == SceneStringNames::get_singleton()->offset) {
- r_ret = get_offset();
- } else if (p_name == SceneStringNames::get_singleton()->unit_offset) {
- r_ret = get_unit_offset();
- } else if (p_name == SceneStringNames::get_singleton()->rotation_mode) {
- r_ret = get_rotation_mode();
- } else if (p_name == SceneStringNames::get_singleton()->v_offset) {
- r_ret = get_v_offset();
- } else if (p_name == SceneStringNames::get_singleton()->h_offset) {
- r_ret = get_h_offset();
- } else if (String(p_name) == "cubic_interp") {
- r_ret = cubic;
- } else if (String(p_name) == "loop") {
- r_ret = loop;
- } else
- return false;
-
- return true;
-}
-void PathFollow::_get_property_list(List<PropertyInfo> *p_list) const {
-
- float max = 10000;
- if (path && path->get_curve().is_valid())
- max = path->get_curve()->get_baked_length();
- p_list->push_back(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0," + rtos(max) + ",0.01"));
- p_list->push_back(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::REAL, "h_offset"));
- p_list->push_back(PropertyInfo(Variant::REAL, "v_offset"));
- p_list->push_back(PropertyInfo(Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM, "None,Y,XY,XYZ"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "cubic_interp"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "loop"));
+ if (property.name == "offset") {
+
+ float max = 10000;
+ if (path && path->get_curve().is_valid())
+ max = path->get_curve()->get_baked_length();
+
+ property.hint_string = "0," + rtos(max) + ",0.01";
+ }
}
void PathFollow::_bind_methods() {
@@ -269,6 +225,14 @@ void PathFollow::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_loop", "loop"), &PathFollow::set_loop);
ClassDB::bind_method(D_METHOD("has_loop"), &PathFollow::has_loop);
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01"), "set_offset", "get_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM, "None,Y,XY,XYZ"), "set_rotation_mode", "get_rotation_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cubic_interp"), "set_cubic_interpolation", "get_cubic_interpolation");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "has_loop");
+
BIND_ENUM_CONSTANT(ROTATION_NONE);
BIND_ENUM_CONSTANT(ROTATION_Y);
BIND_ENUM_CONSTANT(ROTATION_XY);
diff --git a/scene/3d/path.h b/scene/3d/path.h
index 7c3e0f35cc..2ed686ac3c 100644
--- a/scene/3d/path.h
+++ b/scene/3d/path.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef PATH_H
#define PATH_H
@@ -78,9 +79,7 @@ private:
void _update_transform();
protected:
- bool _set(const StringName &p_name, const Variant &p_value);
- bool _get(const StringName &p_name, Variant &r_ret) const;
- void _get_property_list(List<PropertyInfo> *p_list) const;
+ virtual void _validate_property(PropertyInfo &property) const;
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index 4c4e4bf1e6..25acd6deb0 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "physics_body.h"
#include "engine.h"
@@ -257,6 +258,7 @@ void RigidBody::_body_enter_tree(ObjectID p_id) {
Node *node = Object::cast_to<Node>(obj);
ERR_FAIL_COND(!node);
+ ERR_FAIL_COND(!contact_monitor);
Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.find(p_id);
ERR_FAIL_COND(!E);
ERR_FAIL_COND(E->get().in_tree);
@@ -280,6 +282,7 @@ void RigidBody::_body_exit_tree(ObjectID p_id) {
Object *obj = ObjectDB::get_instance(p_id);
Node *node = Object::cast_to<Node>(obj);
ERR_FAIL_COND(!node);
+ ERR_FAIL_COND(!contact_monitor);
Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.find(p_id);
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->get().in_tree);
@@ -305,6 +308,7 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
Object *obj = ObjectDB::get_instance(objid);
Node *node = Object::cast_to<Node>(obj);
+ ERR_FAIL_COND(!contact_monitor);
Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.find(objid);
ERR_FAIL_COND(!body_in && !E);
@@ -317,7 +321,7 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
E->get().in_tree = node && node->is_inside_tree();
if (node) {
node->connect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid));
- node->connect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
}
@@ -344,7 +348,7 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
if (node) {
node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
if (in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
}
@@ -718,6 +722,14 @@ void RigidBody::set_contact_monitor(bool p_enabled) {
for (Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.front(); E; E = E->next()) {
//clean up mess
+ Object *obj = ObjectDB::get_instance(E->key());
+ Node *node = Object::cast_to<Node>(obj);
+
+ if (node) {
+
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ }
}
memdelete(contact_monitor);
@@ -771,7 +783,7 @@ String RigidBody::get_configuration_warning() const {
if (warning != String()) {
warning += "\n";
}
- warning += TTR("Size changes to RigidBody (in character or rigid modes) will be overriden by the physics engine when running.\nChange the size in children collision shapes instead.");
+ warning += TTR("Size changes to RigidBody (in character or rigid modes) will be overridden by the physics engine when running.\nChange the size in children collision shapes instead.");
}
return warning;
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index f64733e707..c7556c0c5f 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef PHYSICS_BODY__H
#define PHYSICS_BODY__H
@@ -114,7 +115,7 @@ public:
MODE_KINEMATIC,
};
-private:
+protected:
bool can_sleep;
PhysicsDirectBodyState *state;
Mode mode;
@@ -177,9 +178,8 @@ private:
void _body_exit_tree(ObjectID p_id);
void _body_inout(int p_status, ObjectID p_instance, int p_body_shape, int p_local_shape);
- void _direct_state_changed(Object *p_state);
+ virtual void _direct_state_changed(Object *p_state);
-protected:
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp
index c36e684477..2e9f1a241a 100644
--- a/scene/3d/physics_joint.cpp
+++ b/scene/3d/physics_joint.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "physics_joint.h"
void Joint::_update_joint(bool p_only_free) {
@@ -70,8 +71,7 @@ void Joint::_update_joint(bool p_only_free) {
ba = body_a->get_rid();
bb = body_b->get_rid();
- if (exclude_from_collision)
- PhysicsServer::get_singleton()->body_add_collision_exception(body_a->get_rid(), body_b->get_rid());
+ PhysicsServer::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
}
void Joint::set_node_a(const NodePath &p_node_a) {
diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h
index 1520c40cdd..000109ac55 100644
--- a/scene/3d/physics_joint.h
+++ b/scene/3d/physics_joint.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef PHYSICS_JOINT_H
#define PHYSICS_JOINT_H
diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp
index 35ef6fa2f1..d16d9ed7c5 100644
--- a/scene/3d/portal.cpp
+++ b/scene/3d/portal.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "portal.h"
#include "project_settings.h"
#include "scene/resources/surface_tool.h"
diff --git a/scene/3d/portal.h b/scene/3d/portal.h
index 545dd61650..cb3f208072 100644
--- a/scene/3d/portal.h
+++ b/scene/3d/portal.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef PORTAL_H
#define PORTAL_H
diff --git a/scene/3d/position_3d.cpp b/scene/3d/position_3d.cpp
index 955c54a008..3ae04f491f 100644
--- a/scene/3d/position_3d.cpp
+++ b/scene/3d/position_3d.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "position_3d.h"
#include "scene/resources/mesh.h"
diff --git a/scene/3d/position_3d.h b/scene/3d/position_3d.h
index 59512ea108..2bc69eff9b 100644
--- a/scene/3d/position_3d.h
+++ b/scene/3d/position_3d.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef POSITION_3D_H
#define POSITION_3D_H
diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp
index 7daf43aefd..101d9ed70c 100644
--- a/scene/3d/proximity_group.cpp
+++ b/scene/3d/proximity_group.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "proximity_group.h"
#include "math_funcs.h"
@@ -111,11 +112,6 @@ void ProximityGroup::_new_group(StringName p_name) {
groups[p_name] = group_version;
};
-void ProximityGroup::set_group_name(String p_group_name) {
-
- group_name = p_group_name;
-};
-
void ProximityGroup::_notification(int p_what) {
switch (p_what) {
@@ -152,9 +148,24 @@ void ProximityGroup::_proximity_group_broadcast(String p_name, Variant p_params)
};
};
-void ProximityGroup::set_dispatch_mode(int p_mode) {
+void ProximityGroup::set_group_name(const String &p_group_name) {
+
+ group_name = p_group_name;
+};
+
+String ProximityGroup::get_group_name() const {
+
+ return group_name;
+};
+
+void ProximityGroup::set_dispatch_mode(DispatchMode p_mode) {
+
+ dispatch_mode = p_mode;
+};
+
+ProximityGroup::DispatchMode ProximityGroup::get_dispatch_mode() const {
- dispatch_mode = (DispatchMode)p_mode;
+ return dispatch_mode;
};
void ProximityGroup::set_grid_radius(const Vector3 &p_radius) {
@@ -170,15 +181,22 @@ Vector3 ProximityGroup::get_grid_radius() const {
void ProximityGroup::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_group_name", "name"), &ProximityGroup::set_group_name);
- ClassDB::bind_method(D_METHOD("broadcast", "name", "parameters"), &ProximityGroup::broadcast);
+ ClassDB::bind_method(D_METHOD("get_group_name"), &ProximityGroup::get_group_name);
ClassDB::bind_method(D_METHOD("set_dispatch_mode", "mode"), &ProximityGroup::set_dispatch_mode);
- ClassDB::bind_method(D_METHOD("_proximity_group_broadcast", "name", "params"), &ProximityGroup::_proximity_group_broadcast);
+ ClassDB::bind_method(D_METHOD("get_dispatch_mode"), &ProximityGroup::get_dispatch_mode);
ClassDB::bind_method(D_METHOD("set_grid_radius", "radius"), &ProximityGroup::set_grid_radius);
ClassDB::bind_method(D_METHOD("get_grid_radius"), &ProximityGroup::get_grid_radius);
+ ClassDB::bind_method(D_METHOD("broadcast", "name", "parameters"), &ProximityGroup::broadcast);
+ ClassDB::bind_method(D_METHOD("_proximity_group_broadcast", "name", "params"), &ProximityGroup::_proximity_group_broadcast);
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "group_name"), "set_group_name", "get_group_name");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "dispatch_mode", PROPERTY_HINT_ENUM, "Proxy,Signal"), "set_dispatch_mode", "get_dispatch_mode");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "grid_radius"), "set_grid_radius", "get_grid_radius");
- ADD_SIGNAL(MethodInfo("broadcast", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::ARRAY, "parameters")));
+ ADD_SIGNAL(MethodInfo("broadcast", PropertyInfo(Variant::STRING, "group_name"), PropertyInfo(Variant::ARRAY, "parameters")));
+
+ BIND_ENUM_CONSTANT(MODE_PROXY);
+ BIND_ENUM_CONSTANT(MODE_SIGNAL);
};
ProximityGroup::ProximityGroup() {
diff --git a/scene/3d/proximity_group.h b/scene/3d/proximity_group.h
index 7c61c0f949..448f30bf80 100644
--- a/scene/3d/proximity_group.h
+++ b/scene/3d/proximity_group.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef PROXIMITY_GROUP_H
#define PROXIMITY_GROUP_H
@@ -66,15 +67,21 @@ public:
static void _bind_methods();
public:
- void set_group_name(String p_group_name);
- void broadcast(String p_name, Variant p_params);
- void set_dispatch_mode(int p_mode);
+ void set_group_name(const String &p_group_name);
+ String get_group_name() const;
+
+ void set_dispatch_mode(DispatchMode p_mode);
+ DispatchMode get_dispatch_mode() const;
void set_grid_radius(const Vector3 &p_radius);
Vector3 get_grid_radius() const;
+ void broadcast(String p_name, Variant p_params);
+
ProximityGroup();
~ProximityGroup();
};
+VARIANT_ENUM_CAST(ProximityGroup::DispatchMode);
+
#endif
diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp
index 962af4b244..dd5ae8a999 100644
--- a/scene/3d/ray_cast.cpp
+++ b/scene/3d/ray_cast.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "ray_cast.h"
#include "collision_object.h"
@@ -216,6 +217,8 @@ void RayCast::_update_raycast_state() {
against_shape = rr.shape;
} else {
collided = false;
+ against = 0;
+ against_shape = 0;
}
}
diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h
index c44fd907e5..20cea80700 100644
--- a/scene/3d/ray_cast.h
+++ b/scene/3d/ray_cast.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef RAY_CAST_H
#define RAY_CAST_H
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index b8fa50357a..2178da02b5 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "reflection_probe.h"
void ReflectionProbe::set_intensity(float p_intensity) {
@@ -194,7 +195,7 @@ void ReflectionProbe::_validate_property(PropertyInfo &property) const {
if (property.name == "interior/ambient_color" || property.name == "interior/ambient_energy" || property.name == "interior/ambient_contrib") {
if (!interior) {
- property.usage = PROPERTY_USAGE_NOEDITOR;
+ property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
}
}
}
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h
index 742e4121f7..13ae1c81f6 100644
--- a/scene/3d/reflection_probe.h
+++ b/scene/3d/reflection_probe.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef REFLECTIONPROBE_H
#define REFLECTIONPROBE_H
diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h
index 5fc9b071b0..6b788a2d75 100644
--- a/scene/3d/remote_transform.h
+++ b/scene/3d/remote_transform.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef REMOTETRANSFORM_H
#define REMOTETRANSFORM_H
diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp
index 94ad07c617..0d83a9942e 100644
--- a/scene/3d/room_instance.cpp
+++ b/scene/3d/room_instance.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "room_instance.h"
#include "servers/visual_server.h"
diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h
index dc066c73c3..ff388e606c 100644
--- a/scene/3d/room_instance.h
+++ b/scene/3d/room_instance.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef ROOM_INSTANCE_H
#define ROOM_INSTANCE_H
diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp
index cefe3e46f3..02768ac91f 100644
--- a/scene/3d/scenario_fx.cpp
+++ b/scene/3d/scenario_fx.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "scenario_fx.h"
#include "scene/main/viewport.h"
diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h
index 3a8a927f88..7a8e2b548f 100644
--- a/scene/3d/scenario_fx.h
+++ b/scene/3d/scenario_fx.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef SCENARIO_FX_H
#define SCENARIO_FX_H
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index aaa378bb68..d3a13c741e 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "skeleton.h"
#include "message_queue.h"
@@ -60,7 +61,7 @@ bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
set_bone_enabled(which, p_value);
else if (what == "pose")
set_bone_pose(which, p_value);
- else if (what == "bound_childs") {
+ else if (what == "bound_children") {
Array children = p_value;
if (is_inside_tree()) {
@@ -104,7 +105,7 @@ bool Skeleton::_get(const StringName &p_path, Variant &r_ret) const {
r_ret = is_bone_enabled(which);
else if (what == "pose")
r_ret = get_bone_pose(which);
- else if (what == "bound_childs") {
+ else if (what == "bound_children") {
Array children;
for (const List<uint32_t>::Element *E = bones[which].nodes_bound.front(); E; E = E->next()) {
@@ -133,7 +134,7 @@ void Skeleton::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::TRANSFORM, prep + "rest"));
p_list->push_back(PropertyInfo(Variant::BOOL, prep + "enabled"));
p_list->push_back(PropertyInfo(Variant::TRANSFORM, prep + "pose", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::ARRAY, prep + "bound_childs"));
+ p_list->push_back(PropertyInfo(Variant::ARRAY, prep + "bound_children"));
}
}
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index 1b999d91c3..d693670055 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef SKELETON_H
#define SKELETON_H
@@ -82,12 +83,12 @@ class Skeleton : public Spatial {
Array _get_bound_child_nodes_to_bone(int p_bone) const {
Array bound;
- List<Node *> childs;
- get_bound_child_nodes_to_bone(p_bone, &childs);
+ List<Node *> children;
+ get_bound_child_nodes_to_bone(p_bone, &children);
- for (int i = 0; i < childs.size(); i++) {
+ for (int i = 0; i < children.size(); i++) {
- bound.push_back(childs[i]);
+ bound.push_back(children[i]);
}
return bound;
}
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index a55c4a2cc5..721641e09b 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "spatial.h"
#include "engine.h"
@@ -787,7 +788,9 @@ void Spatial::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_scale", "get_scale");
ADD_GROUP("Visibility", "");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "visible"), "set_visible", "is_visible");
- //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/local"), "set_transform", "get_transform") ;
+#ifdef TOOLS_ENABLED
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "SpatialGizmo", 0), "set_gizmo", "get_gizmo");
+#endif
ADD_SIGNAL(MethodInfo("visibility_changed"));
}
diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h
index 1c2e73d5ba..518bba9a51 100644
--- a/scene/3d/spatial.h
+++ b/scene/3d/spatial.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef SPATIAL_H
#define SPATIAL_H
diff --git a/scene/3d/spatial_velocity_tracker.cpp b/scene/3d/spatial_velocity_tracker.cpp
index 1c7423e645..c547e76e30 100644
--- a/scene/3d/spatial_velocity_tracker.cpp
+++ b/scene/3d/spatial_velocity_tracker.cpp
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* spatial_velocity_tracker.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#include "spatial_velocity_tracker.h"
#include "engine.h"
@@ -95,6 +125,8 @@ void SpatialVelocityTracker::_bind_methods() {
ClassDB::bind_method(D_METHOD("update_position", "position"), &SpatialVelocityTracker::update_position);
ClassDB::bind_method(D_METHOD("get_tracked_linear_velocity"), &SpatialVelocityTracker::get_tracked_linear_velocity);
ClassDB::bind_method(D_METHOD("reset", "position"), &SpatialVelocityTracker::reset);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "track_physics_step"), "set_track_physics_step", "is_tracking_physics_step");
}
SpatialVelocityTracker::SpatialVelocityTracker() {
diff --git a/scene/3d/spatial_velocity_tracker.h b/scene/3d/spatial_velocity_tracker.h
index c4371ff1f7..a8278a4fb5 100644
--- a/scene/3d/spatial_velocity_tracker.h
+++ b/scene/3d/spatial_velocity_tracker.h
@@ -1,3 +1,33 @@
+/*************************************************************************/
+/* spatial_velocity_tracker.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
#ifndef SPATIAL_VELOCITY_TRACKER_H
#define SPATIAL_VELOCITY_TRACKER_H
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 6bd673c7a2..232855c978 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "sprite_3d.h"
#include "core_string_names.h"
#include "scene/scene_string_names.h"
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index 0ec8f4d668..23e1d96b4b 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef SPRITE_3D_H
#define SPRITE_3D_H
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index d9918c0b62..ed3bde9504 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "vehicle_body.h"
#define ROLLING_INFLUENCE_FIX
@@ -374,7 +375,7 @@ void VehicleBody::_update_wheel(int p_idx, PhysicsDirectBodyState *s) {
Basis steeringMat(up, steering);
- Basis rotatingMat(right, -wheel.m_rotation);
+ Basis rotatingMat(right, wheel.m_rotation);
/*
if (p_idx==1)
@@ -571,7 +572,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec
b2invmass);
// FIXME: rel_vel assignment here is overwritten by the following assignment.
- // What seemes to be intented in the next next assignment is: rel_vel = normal.dot(rel_vel);
+ // What seemes to be intended in the next next assignment is: rel_vel = normal.dot(rel_vel);
// Investigate why.
real_t rel_vel = jac.getRelativeVelocity(
s->get_linear_velocity(),
@@ -815,26 +816,24 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) {
void VehicleBody::_direct_state_changed(Object *p_state) {
- PhysicsDirectBodyState *s = Object::cast_to<PhysicsDirectBodyState>(p_state);
+ RigidBody::_direct_state_changed(p_state);
- set_ignore_transform_notification(true);
- set_global_transform(s->get_transform());
- set_ignore_transform_notification(false);
+ state = Object::cast_to<PhysicsDirectBodyState>(p_state);
- float step = s->get_step();
+ float step = state->get_step();
for (int i = 0; i < wheels.size(); i++) {
- _update_wheel(i, s);
+ _update_wheel(i, state);
}
for (int i = 0; i < wheels.size(); i++) {
- _ray_cast(i, s);
- wheels[i]->set_transform(s->get_transform().inverse() * wheels[i]->m_worldTransform);
+ _ray_cast(i, state);
+ wheels[i]->set_transform(state->get_transform().inverse() * wheels[i]->m_worldTransform);
}
- _update_suspension(s);
+ _update_suspension(state);
for (int i = 0; i < wheels.size(); i++) {
@@ -847,21 +846,21 @@ void VehicleBody::_direct_state_changed(Object *p_state) {
suspensionForce = wheel.m_maxSuspensionForce;
}
Vector3 impulse = wheel.m_raycastInfo.m_contactNormalWS * suspensionForce * step;
- Vector3 relpos = wheel.m_raycastInfo.m_contactPointWS - s->get_transform().origin;
+ Vector3 relpos = wheel.m_raycastInfo.m_contactPointWS - state->get_transform().origin;
- s->apply_impulse(relpos, impulse);
+ state->apply_impulse(relpos, impulse);
//getRigidBody()->applyImpulse(impulse, relpos);
}
- _update_friction(s);
+ _update_friction(state);
for (int i = 0; i < wheels.size(); i++) {
VehicleWheel &wheel = *wheels[i];
- Vector3 relpos = wheel.m_raycastInfo.m_hardPointWS - s->get_transform().origin;
- Vector3 vel = s->get_linear_velocity() + (s->get_angular_velocity()).cross(relpos); // * mPos);
+ Vector3 relpos = wheel.m_raycastInfo.m_hardPointWS - state->get_transform().origin;
+ Vector3 vel = state->get_linear_velocity() + (state->get_angular_velocity()).cross(relpos); // * mPos);
if (wheel.m_raycastInfo.m_isInContact) {
- const Transform &chassisWorldTransform = s->get_transform();
+ const Transform &chassisWorldTransform = state->get_transform();
Vector3 fwd(
chassisWorldTransform.basis[0][Vector3::AXIS_Z],
@@ -882,29 +881,8 @@ void VehicleBody::_direct_state_changed(Object *p_state) {
wheel.m_deltaRotation *= real_t(0.99); //damping of rotation when not in contact
}
- linear_velocity = s->get_linear_velocity();
-}
-
-void VehicleBody::set_mass(real_t p_mass) {
-
- mass = p_mass;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_MASS, mass);
-}
-
-real_t VehicleBody::get_mass() const {
-
- return mass;
-}
-
-void VehicleBody::set_friction(real_t p_friction) {
- friction = p_friction;
- PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, friction);
-}
-
-real_t VehicleBody::get_friction() const {
-
- return friction;
+ state = NULL;
}
void VehicleBody::set_engine_force(float p_engine_force) {
@@ -935,18 +913,8 @@ float VehicleBody::get_steering() const {
return m_steeringValue;
}
-Vector3 VehicleBody::get_linear_velocity() const {
- return linear_velocity;
-}
-
void VehicleBody::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_mass", "mass"), &VehicleBody::set_mass);
- ClassDB::bind_method(D_METHOD("get_mass"), &VehicleBody::get_mass);
-
- ClassDB::bind_method(D_METHOD("set_friction", "friction"), &VehicleBody::set_friction);
- ClassDB::bind_method(D_METHOD("get_friction"), &VehicleBody::get_friction);
-
ClassDB::bind_method(D_METHOD("set_engine_force", "engine_force"), &VehicleBody::set_engine_force);
ClassDB::bind_method(D_METHOD("get_engine_force"), &VehicleBody::get_engine_force);
@@ -956,21 +924,14 @@ void VehicleBody::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_steering", "steering"), &VehicleBody::set_steering);
ClassDB::bind_method(D_METHOD("get_steering"), &VehicleBody::get_steering);
- ClassDB::bind_method(D_METHOD("get_linear_velocity"), &VehicleBody::get_linear_velocity);
-
- ClassDB::bind_method(D_METHOD("_direct_state_changed"), &VehicleBody::_direct_state_changed);
-
ADD_GROUP("Motion", "");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "engine_force", PROPERTY_HINT_RANGE, "0.00,1024.0,0.01"), "set_engine_force", "get_engine_force");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "brake", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_brake", "get_brake");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering");
- ADD_GROUP("Mass", "");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "mass", PROPERTY_HINT_RANGE, "0.01,65536,0.01"), "set_mass", "get_mass");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "friction", PROPERTY_HINT_RANGE, "0.01,1,0.01"), "set_friction", "get_friction");
}
VehicleBody::VehicleBody() :
- PhysicsBody(PhysicsServer::BODY_MODE_RIGID) {
+ RigidBody() {
m_pitchControl = 0;
m_currentVehicleSpeedKmHour = real_t(0.);
@@ -981,10 +942,11 @@ VehicleBody::VehicleBody() :
friction = 1;
+ state = NULL;
ccd = false;
exclude.insert(get_rid());
- PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ //PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
set_mass(40);
}
diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h
index b4420e95e7..7810a42e8a 100644
--- a/scene/3d/vehicle_body.h
+++ b/scene/3d/vehicle_body.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef VEHICLE_BODY_H
#define VEHICLE_BODY_H
@@ -138,20 +139,13 @@ public:
VehicleWheel();
};
-class VehicleBody : public PhysicsBody {
-
- GDCLASS(VehicleBody, PhysicsBody);
+class VehicleBody : public RigidBody {
- real_t mass;
- real_t friction;
+ GDCLASS(VehicleBody, RigidBody);
float engine_force;
float brake;
- Vector3 linear_velocity;
- Vector3 angular_velocity;
- bool ccd;
-
real_t m_pitchControl;
real_t m_steeringValue;
real_t m_currentVehicleSpeedKmHour;
@@ -191,12 +185,6 @@ class VehicleBody : public PhysicsBody {
void _direct_state_changed(Object *p_state);
public:
- void set_mass(real_t p_mass);
- real_t get_mass() const;
-
- void set_friction(real_t p_friction);
- real_t get_friction() const;
-
void set_engine_force(float p_engine_force);
float get_engine_force() const;
@@ -206,8 +194,6 @@ public:
void set_steering(float p_steering);
float get_steering() const;
- Vector3 get_linear_velocity() const;
-
VehicleBody();
};
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp
index e6c660bad7..9d6e4941f3 100644
--- a/scene/3d/visibility_notifier.cpp
+++ b/scene/3d/visibility_notifier.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "visibility_notifier.h"
#include "engine.h"
@@ -169,7 +170,7 @@ void VisibilityEnabler::_find_nodes(Node *p_node) {
if (add) {
- p_node->connect(SceneStringNames::get_singleton()->tree_exited, this, "_node_removed", varray(p_node), CONNECT_ONESHOT);
+ p_node->connect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed", varray(p_node), CONNECT_ONESHOT);
nodes[p_node] = meta;
_change_node_state(p_node, false);
}
@@ -207,7 +208,7 @@ void VisibilityEnabler::_notification(int p_what) {
if (!visible)
_change_node_state(E->key(), true);
- E->key()->disconnect(SceneStringNames::get_singleton()->tree_exited, this, "_node_removed");
+ E->key()->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed");
}
nodes.clear();
@@ -239,7 +240,7 @@ void VisibilityEnabler::_node_removed(Node *p_node) {
if (!visible)
_change_node_state(p_node, true);
- p_node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, "_node_removed");
+ p_node->disconnect(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed");
nodes.erase(p_node);
}
diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h
index ae17939e12..b1985f4a0c 100644
--- a/scene/3d/visibility_notifier.h
+++ b/scene/3d/visibility_notifier.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef VISIBILITY_NOTIFIER_H
#define VISIBILITY_NOTIFIER_H
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 7497f35d29..00541a7d8a 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "visual_instance.h"
#include "scene/scene_string_names.h"
diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h
index 34f035c9f8..8458a343b2 100644
--- a/scene/3d/visual_instance.h
+++ b/scene/3d/visual_instance.h
@@ -27,6 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#ifndef VISUAL_INSTANCE_H
#define VISUAL_INSTANCE_H
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index e1717a56f3..d389b69ef3 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -461,16 +461,16 @@ void VoxelLightBaker::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p
}
}
- if (bake_cells[p_idx].childs[i] == CHILD_EMPTY) {
+ if (bake_cells[p_idx].children[i] == CHILD_EMPTY) {
//sub cell must be created
uint32_t child_idx = bake_cells.size();
- bake_cells[p_idx].childs[i] = child_idx;
+ bake_cells[p_idx].children[i] = child_idx;
bake_cells.resize(bake_cells.size() + 1);
bake_cells[child_idx].level = p_level + 1;
}
- _plot_face(bake_cells[p_idx].childs[i], p_level + 1, nx, ny, nz, p_vtx, p_normal, p_uv, p_material, aabb);
+ _plot_face(bake_cells[p_idx].children[i], p_level + 1, nx, ny, nz, p_vtx, p_normal, p_uv, p_material, aabb);
}
}
}
@@ -700,7 +700,7 @@ void VoxelLightBaker::_init_light_plot(int p_idx, int p_level, int p_x, int p_y,
int half = (1 << (cell_subdiv - 1)) >> (p_level + 1);
for (int i = 0; i < 8; i++) {
- uint32_t child = bake_cells[p_idx].childs[i];
+ uint32_t child = bake_cells[p_idx].children[i];
if (child == CHILD_EMPTY)
continue;
@@ -809,7 +809,7 @@ uint32_t VoxelLightBaker::_find_cell_at_pos(const Cell *cells, int x, int y, int
ofs_z += half;
}
- cell = bc->childs[child];
+ cell = bc->children[child];
if (cell == CHILD_EMPTY)
return CHILD_EMPTY;
@@ -1257,7 +1257,7 @@ void VoxelLightBaker::_fixup_plot(int p_idx, int p_level) {
for (int i = 0; i < 8; i++) {
- uint32_t child = bake_cells[p_idx].childs[i];
+ uint32_t child = bake_cells[p_idx].children[i];
if (child == CHILD_EMPTY)
continue;
@@ -1483,7 +1483,7 @@ void VoxelLightBaker::_sample_baked_octree_filtered_and_anisotropic(const Vector
ofs_z += half;
}
- cell = bc->childs[child];
+ cell = bc->children[child];
if (cell == CHILD_EMPTY)
break;
@@ -1766,7 +1766,7 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
ofs_z += half;
}
- cell = bc->childs[child];
+ cell = bc->children[child];
if (unlikely(cell == CHILD_EMPTY))
break;
@@ -1928,7 +1928,7 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if (lightmap_ptr[i * width + j].normal == Vector3())
- continue; //empty, dont write over it anyway
+ continue; //empty, don't write over it anyway
float gauss_sum = gauss_kernel[0];
Vector3 accum = lightmap_ptr[i * width + j].pos * gauss_kernel[0];
for (int k = 1; k < 4; k++) {
@@ -2191,7 +2191,7 @@ PoolVector<int> VoxelLightBaker::create_gi_probe_data() {
for (int i = 0; i < bake_cells.size(); i++) {
for (int j = 0; j < 8; j++) {
- w32[ofs++] = bake_cells[i].childs[j];
+ w32[ofs++] = bake_cells[i].children[j];
}
{ //albedo
@@ -2275,7 +2275,7 @@ void VoxelLightBaker::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Re
for (int i = 0; i < 8; i++) {
- uint32_t child = bake_cells[p_idx].childs[i];
+ uint32_t child = bake_cells[p_idx].children[i];
if (child == CHILD_EMPTY || child >= max_original_cells)
continue;
@@ -2290,7 +2290,7 @@ void VoxelLightBaker::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Re
if (i & 4)
aabb.position.z += aabb.size.z;
- _debug_mesh(bake_cells[p_idx].childs[i], p_level + 1, aabb, p_multimesh, idx, p_mode);
+ _debug_mesh(bake_cells[p_idx].children[i], p_level + 1, aabb, p_multimesh, idx, p_mode);
}
}
}
@@ -2423,7 +2423,7 @@ PoolVector<uint8_t> VoxelLightBaker::create_capture_octree(int p_subdiv) {
}
for (int j = 0; j < 8; j++) {
- uint32_t child = bake_cells[demap[i]].childs[j];
+ uint32_t child = bake_cells[demap[i]].children[j];
octree[i].children[j] = child == CHILD_EMPTY ? CHILD_EMPTY : remap[child];
}
}
diff --git a/scene/3d/voxel_light_baker.h b/scene/3d/voxel_light_baker.h
index d270a26a2a..6a1f1253a3 100644
--- a/scene/3d/voxel_light_baker.h
+++ b/scene/3d/voxel_light_baker.h
@@ -60,7 +60,7 @@ private:
struct Cell {
- uint32_t childs[8];
+ uint32_t children[8];
float albedo[3]; //albedo in RGB24
float emission[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast)
float normal[3];
@@ -70,7 +70,7 @@ private:
Cell() {
for (int i = 0; i < 8; i++) {
- childs[i] = CHILD_EMPTY;
+ children[i] = CHILD_EMPTY;
}
for (int i = 0; i < 3; i++) {