summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-07-09 14:33:30 +0200
committerGitHub <noreply@github.com>2016-07-09 14:33:30 +0200
commit3a70d4a072fa170ae927e2b416861ccd395f92d2 (patch)
tree0e5a9055880d02055dcc4e00dea1c8b5d9848ba9 /scene
parent0e119a91640acbc7643ff1dd1049bf12ca302d21 (diff)
parentf40f360a2c4ca8e6f2a651dbcca3ae82e2abe7a1 (diff)
Merge pull request #5589 from akien-mga/pr-unused-var
Removing some more unused vars and dead code
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/camera_2d.cpp1
-rw-r--r--scene/2d/navigation2d.cpp7
-rw-r--r--scene/2d/visibility_notifier_2d.cpp12
-rw-r--r--scene/3d/physics_joint.cpp6
-rw-r--r--scene/3d/vehicle_body.cpp12
-rw-r--r--scene/3d/visibility_notifier.cpp17
-rw-r--r--scene/resources/animation.cpp3
-rw-r--r--scene/resources/dynamic_font.cpp2
-rw-r--r--scene/resources/mesh.cpp4
-rw-r--r--scene/resources/packed_scene.cpp22
10 files changed, 10 insertions, 76 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 85256be940..27e07a35be 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -44,7 +44,6 @@ void Camera2D::_update_scroll() {
if (current) {
Matrix32 xform = get_camera_transform();
- RID vp = viewport->get_viewport();
if (viewport) {
viewport->set_canvas_transform( xform );
}
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index b4332cc75d..82c1327a8f 100644
--- a/scene/2d/navigation2d.cpp
+++ b/scene/2d/navigation2d.cpp
@@ -552,7 +552,6 @@ debug path
if (p_optimize) {
//string pulling
- Polygon *apex_poly=end_poly;
Vector2 apex_point=end_point;
Vector2 portal_left=apex_point;
Vector2 portal_right=apex_point;
@@ -613,12 +612,9 @@ debug path
//print_line("***ADVANCE LEFT");
} else {
- //_clip_path(path,apex_poly,portal_right,right_poly);
-
apex_point=portal_right;
p=right_poly;
left_poly=p;
- apex_poly=p;
portal_left=apex_point;
portal_right=apex_point;
if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON)
@@ -637,12 +633,9 @@ debug path
//print_line("***ADVANCE RIGHT");
} else {
- //_clip_path(path,apex_poly,portal_left,left_poly);
-
apex_point=portal_left;
p=left_poly;
right_poly=p;
- apex_poly=p;
portal_right=apex_point;
portal_left=apex_point;
if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON)
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index 12524a2192..5411950976 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -270,9 +270,6 @@ void VisibilityEnabler2D::_notification(int p_what){
return;
- Node *from = this;
- //find where current scene starts
-
for (Map<Node*,Variant>::Element *E=nodes.front();E;E=E->next()) {
if (!visible)
@@ -293,14 +290,7 @@ void VisibilityEnabler2D::_change_node_state(Node* p_node,bool p_enabled) {
RigidBody2D *rb = p_node->cast_to<RigidBody2D>();
if (rb) {
- if (p_enabled) {
- RigidBody2D::Mode mode = RigidBody2D::Mode(nodes[p_node].operator int());
- //rb->set_mode(mode);
- rb->set_sleeping(false);
- } else {
- //rb->set_mode(RigidBody2D::MODE_STATIC);
- rb->set_sleeping(true);
- }
+ rb->set_sleeping(!p_enabled);
}
}
diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp
index 3f03b2aab3..084d96975f 100644
--- a/scene/3d/physics_joint.cpp
+++ b/scene/3d/physics_joint.cpp
@@ -369,9 +369,6 @@ RID HingeJoint::_configure_joint(PhysicsBody *body_a,PhysicsBody *body_b) {
Transform gt = get_global_transform();
- Vector3 hingepos = gt.origin;
- Vector3 hingedir = gt.basis.get_axis(2);
-
Transform ainv = body_a->get_global_transform().affine_inverse();
Transform local_a = ainv * gt;
@@ -532,9 +529,6 @@ RID SliderJoint::_configure_joint(PhysicsBody *body_a,PhysicsBody *body_b) {
Transform gt = get_global_transform();
- Vector3 sliderpos = gt.origin;
- Vector3 sliderdir = gt.basis.get_axis(2);
-
Transform ainv = body_a->get_global_transform().affine_inverse();
Transform local_a = ainv * gt;
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 6ccf07db1e..7c7957640f 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -488,7 +488,6 @@ real_t VehicleBody::_ray_cast(int p_idx,PhysicsDirectBodyState *s) {
void VehicleBody::_update_suspension(PhysicsDirectBodyState *s)
{
- real_t deltaTime = s->get_step();
real_t chassisMass = mass;
for (int w_it=0; w_it<wheels.size(); w_it++)
@@ -596,21 +595,16 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec
b2invinertia,
b2invmass);
- real_t jacDiagAB = jac.getDiagonal();
- real_t jacDiagABInv = real_t(1.) / jacDiagAB;
-
real_t rel_vel = jac.getRelativeVelocity(
s->get_linear_velocity(),
s->get_transform().basis.transposed().xform(s->get_angular_velocity()),
b2lv,
b2trans.xform(b2av));
- real_t a;
- a=jacDiagABInv;
rel_vel = normal.dot(vel);
- //todo: move this into proper structure
+ //TODO: move this into proper structure
real_t contactDamping = real_t(0.4);
#define ONLY_USE_LINEAR_MASS
#ifdef ONLY_USE_LINEAR_MASS
@@ -642,16 +636,16 @@ VehicleBody::btVehicleWheelContactPoint::btVehicleWheelContactPoint(PhysicsDirec
denom0= s->get_inverse_mass() + frictionDirectionWorld.dot(vec);
}
+ /* TODO: Why is this code unused?
if (body1) {
Vector3 r0 = frictionPosWorld - body1->get_global_transform().origin;
Vector3 c0 = (r0).cross(frictionDirectionWorld);
Vector3 vec = s->get_inverse_inertia_tensor().xform_inv(c0).cross(r0);
//denom1= body1->get_inverse_mass() + frictionDirectionWorld.dot(vec);
- denom1=0;
}
-
+ */
real_t relaxation = 1.f;
m_jacDiagABInv = relaxation/(denom0+denom1);
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp
index 60097ad482..f3b5cde0eb 100644
--- a/scene/3d/visibility_notifier.cpp
+++ b/scene/3d/visibility_notifier.cpp
@@ -221,9 +221,6 @@ void VisibilityEnabler::_notification(int p_what){
return;
- Node *from = this;
- //find where current scene starts
-
for (Map<Node*,Variant>::Element *E=nodes.front();E;E=E->next()) {
if (!visible)
@@ -242,17 +239,9 @@ void VisibilityEnabler::_change_node_state(Node* p_node,bool p_enabled) {
{
RigidBody *rb = p_node->cast_to<RigidBody>();
- if (rb) {
-
- if (p_enabled) {
- RigidBody::Mode mode = RigidBody::Mode(nodes[p_node].operator int());
- //rb->set_mode(mode);
- rb->set_sleeping(false);
- } else {
- //rb->set_mode(RigidBody::MODE_STATIC);
- rb->set_sleeping(true);
- }
- }
+ if (rb)
+
+ rb->set_sleeping(!p_enabled);
}
{
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 098801bcf5..1d15b6f2bc 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1997,9 +1997,6 @@ void Animation::_transform_track_optimize(int p_idx,float p_alowed_linear_err,fl
void Animation::optimize(float p_allowed_linear_err,float p_allowed_angular_err,float p_angle_max) {
-
- int total_tt=0;
-
for(int i=0;i<tracks.size();i++) {
if (tracks[i]->type==TYPE_TRANSFORM)
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index c3b40f7add..67587a8f8b 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -434,7 +434,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
int w = slot->bitmap.width;
int h = slot->bitmap.rows;
- int p = slot->bitmap.pitch;
+ //int p = slot->bitmap.pitch;
int yofs=slot->bitmap_top;
int xofs=slot->bitmap_left;
int advance=slot->advance.x>>6;
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index a1a1f0a935..921466585d 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -30,7 +30,8 @@
#include "scene/resources/concave_polygon_shape.h"
#include "scene/resources/convex_polygon_shape.h"
#include "surface_tool.h"
-static const char*_array_name[]={
+
+static const char* _array_name[]={
"vertex_array",
"normal_array",
"tangent_array",
@@ -847,7 +848,6 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
}
{
- int tc=0;
DVector<int>::Write ir;
DVector<int> indices =arrays[ARRAY_INDEX];
bool has_indices=false;
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 4f5eed8796..c36480420b 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -471,7 +471,6 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S
}
}
#endif
- int subscene_prop_search_from=0;
// all setup, we then proceed to check all properties for the node
// and save the ones that are worth saving
@@ -479,8 +478,6 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S
List<PropertyInfo> plist;
p_node->get_property_list(&plist);
- bool saved_script=false;
-
for (List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) {
@@ -528,23 +525,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S
break;
}
}
-#if 0
-// this workaround ended up causing problems:
-https://github.com/godotengine/godot/issues/3127
- if (saved_script && exists && p_node->get_script_instance()) {
- //if this is an overriden value by another script, save it anyway
- //as the script change will erase it
- //https://github.com/godotengine/godot/issues/2958
-
- bool valid=false;
- p_node->get_script_instance()->get_property_type(name,&valid);
- if (valid) {
- exists=false;
- isdefault=false;
- }
- }
-#endif
if (exists) {
@@ -577,9 +558,6 @@ https://github.com/godotengine/godot/issues/3127
}
}
- if (name=="script/script")
- saved_script=true;
-
NodeData::Property prop;
prop.name=_nm_get_string( name,name_map);
prop.value=_vm_get_variant( value, variant_map);