diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-02 19:12:25 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-02 19:12:25 -0300 |
commit | ce26eb74bca48f16e9a34b4eb1c34e50dfc5daae (patch) | |
tree | 5f9c387037d0142d40f7275575436483dc0a7237 /scene/3d/skeleton.cpp | |
parent | ab4126f51061277e87b41c48b40e7b54942d4eca (diff) | |
parent | 45c5c89de961357a7042d9e1f063e288d7a510cf (diff) |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'scene/3d/skeleton.cpp')
-rw-r--r-- | scene/3d/skeleton.cpp | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index c996a8123c..dfc58dc4c3 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -163,7 +163,7 @@ void Skeleton::_notification(int p_what) { Bone *bonesptr=&bones[0]; int len=bones.size(); - vs->skeleton_resize( skeleton, len ); // if same size, nothin really happens + vs->skeleton_allocate( skeleton, len ); // if same size, nothin really happens // pose changed, rebuild cache of inverses if (rest_global_inverse_dirty) { @@ -513,51 +513,6 @@ void Skeleton::_make_dirty() { } -RES Skeleton::_get_gizmo_geometry() const { - - if (!GLOBAL_DEF("debug/draw_skeleton", true)) - return RES(); - - if (bones.size()==0) - return RES(); - - Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - - Ref<FixedMaterial> mat( memnew( FixedMaterial )); - - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.6,1.0,0.3,0.1) ); - mat->set_line_width(4); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_flag(Material::FLAG_UNSHADED,true); - mat->set_flag(Material::FLAG_ONTOP,true); -// mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - - surface_tool->begin(Mesh::PRIMITIVE_LINES); - surface_tool->set_material(mat); - - - const Bone *bonesptr=&bones[0]; - int len=bones.size(); - - for (int i=0;i<len;i++) { - - const Bone &b=bonesptr[i]; - - Transform t; - if (b.parent<0) - continue; - - Vector3 v1=(bonesptr[b.parent].pose_global * bonesptr[b.parent].rest_global_inverse).xform(bonesptr[b.parent].rest_global_inverse.affine_inverse().origin); - Vector3 v2=(b.pose_global * b.rest_global_inverse).xform(b.rest_global_inverse.affine_inverse().origin); - - surface_tool->add_vertex(v1); - surface_tool->add_vertex(v2); - - } - - return surface_tool->commit(); - -} void Skeleton::localize_rests() { |