Browse Source

Merge pull request #487 from aaronfranke/ik-again

Many style fixes and other tweaks for the IK demo
Aaron Franke 5 years ago
parent
commit
dc6efcd429

+ 33 - 33
3d/ik/addons/sade/ik_fabrik.gd

@@ -48,41 +48,41 @@ var debug_messages = false
 
 func _ready():
 	if target == null:
-		# NOTE: you HAVE to have a node called target as a child of this node!
-		# so we create one if one doesn't already exist
-		if has_node("target") == false:
+		# NOTE: You MUST have a node called Target as a child of this node!
+		# So we create one if one doesn't already exist.
+		if not has_node("Target"):
 			target = Spatial.new()
 			add_child(target)
 			
-			if Engine.editor_hint == true:
+			if Engine.editor_hint:
 				if get_tree() != null:
 					if get_tree().edited_scene_root != null:
 						target.set_owner(get_tree().edited_scene_root)
 			
-			target.name = "target"
+			target.name = "Target"
 		else:
-			target = get_node("target")
+			target = $Target
 		
 		# If we are in the editor, we want to make a sphere at this node
-		if Engine.editor_hint == true:
-			_make_editor_sphere_at_node(target, Color(1, 0, 1, 1))
+		if Engine.editor_hint:
+			_make_editor_sphere_at_node(target, Color.magenta)
 	
 	if middle_joint_target == null:
-		if has_node("middle_joint_target") == false:
+		if not has_node("MiddleJoint"):
 			middle_joint_target = Spatial.new()
 			add_child(middle_joint_target)
 			
-			if Engine.editor_hint == true:
+			if Engine.editor_hint:
 				if get_tree() != null:
 					if get_tree().edited_scene_root != null:
 						middle_joint_target.set_owner(get_tree().edited_scene_root)
 			
-			middle_joint_target.name = "middle_joint_target"
+			middle_joint_target.name = "MiddleJoint"
 		else:
-			middle_joint_target = get_node("middle_joint_target")
+			middle_joint_target = get_node("MiddleJoint")
 	
 		# If we are in the editor, we want to make a sphere at this node
-		if Engine.editor_hint == true:
+		if Engine.editor_hint:
 			_make_editor_sphere_at_node(middle_joint_target, Color(1, 0.24, 1, 1))
 	
 	# Make all of the bone nodes for each bone in the IK chain
@@ -94,20 +94,20 @@ func _ready():
 
 # Various upate methods
 func _process(_delta):
-	if reset_iterations_on_update == true:
+	if reset_iterations_on_update:
 		chain_iterations = 0
 	update_skeleton()
 
 
 func _physics_process(_delta):
-	if reset_iterations_on_update == true:
+	if reset_iterations_on_update:
 		chain_iterations = 0
 	update_skeleton()
 
 
 func _notification(what):
 	if what == NOTIFICATION_TRANSFORM_CHANGED:
-		if reset_iterations_on_update == true:
+		if reset_iterations_on_update:
 			chain_iterations = 0
 		update_skeleton()
 
@@ -116,7 +116,7 @@ func _notification(what):
 
 func update_skeleton():
 	#### ERROR CHECKING conditions
-	if first_call == true:
+	if first_call:
 		_set_skeleton_path(skeleton_path)
 		first_call = false
 		
@@ -126,16 +126,16 @@ func update_skeleton():
 		return
 	
 	if bones_in_chain == null:
-		if debug_messages == true:
+		if debug_messages:
 			printerr(name, " - IK_FABRIK: No Bones in IK chain defined!")
 		return
 	if bones_in_chain_lengths == null:
-		if debug_messages == true:
+		if debug_messages:
 			printerr(name, " - IK_FABRIK: No Bone lengths in IK chain defined!")
 		return
 	
 	if bones_in_chain.size() != bones_in_chain_lengths.size():
-		if debug_messages == true:
+		if debug_messages:
 			printerr(name, " - IK_FABRIK: bones_in_chain and bones_in_chain_lengths!")
 		return
 	
@@ -168,7 +168,7 @@ func update_skeleton():
 func solve_chain():
 	# If we have reached our max chain iteration, and we are limiting ourselves, then return.
 	# Otherwise set chain_iterations to zero (so we constantly update)
-	if chain_iterations >= CHAIN_MAX_ITER and limit_chain_iterations == true:
+	if chain_iterations >= CHAIN_MAX_ITER and limit_chain_iterations:
 		return
 	else:
 		chain_iterations = 0
@@ -188,7 +188,7 @@ func solve_chain():
 	var target_pos = target.global_transform.origin + (dir * bones_in_chain_lengths[bone_nodes.size()-1])
 	
 	# If we are using middle joint target (and have more than 2 bones), move our middle joint towards it!
-	if use_middle_joint_target == true:
+	if use_middle_joint_target:
 		if bone_nodes.size() > 2:
 			var middle_point_pos = middle_joint_target.global_transform.origin
 			var middle_point_pos_diff = (middle_point_pos - bone_nodes[bone_nodes.size()/2].global_transform.origin)
@@ -336,7 +336,7 @@ func get_bone_transform(bone, convert_to_world_space = true):
 	
 	# If we need to convert the bone position from bone/skeleton space to world space, we
 	# use the Xform of the skeleton (because bone/skeleton space is relative to the position of the skeleton node).
-	if convert_to_world_space == true:
+	if convert_to_world_space:
 		ret.origin = skeleton.global_transform.xform(ret.origin)
 	
 	return ret
@@ -390,43 +390,43 @@ func _set_update_mode(new_value):
 	elif update_mode == 2:
 		set_notify_transform(true)
 	else:
-		if debug_messages == true:
+		if debug_messages:
 			printerr(name, " - IK_FABRIK: Unknown update mode. NOT updating skeleton")
 		return
 
 
 func _set_skeleton_path(new_value):
 	# Because get_node doesn't work in the first call, we just want to assign instead
-	if first_call == true:
+	if first_call:
 		skeleton_path = new_value
 		return
 	
 	skeleton_path = new_value
 	
 	if skeleton_path == null:
-		if debug_messages == true:
+		if debug_messages:
 			printerr(name, " - IK_FABRIK: No Nodepath selected for skeleton_path!")
 		return
 	
 	var temp = get_node(skeleton_path)
 	if temp != null:
 		# If it has the method "get_bone_global_pose" it is likely a Skeleton
-		if temp.has_method("get_bone_global_pose") == true:
+		if temp.has_method("get_bone_global_pose"):
 			skeleton = temp
 			bone_IDs = {}
 			
 			# (Delete all of the old bone nodes and) Make all of the bone nodes for each bone in the IK chain
 			_make_bone_nodes()
 			
-			if debug_messages == true:
+			if debug_messages:
 				printerr(name, " - IK_FABRIK: Attached to a new skeleton")
 		# If not, then it's (likely) not a Skeleton node
 		else:
 			skeleton = null
-			if debug_messages == true:
+			if debug_messages:
 				printerr(name, " - IK_FABRIK: skeleton_path does not point to a skeleton!")
 	else:
-		if debug_messages == true:
+		if debug_messages:
 			printerr(name, " - IK_FABRIK: No Nodepath selected for skeleton_path!")
 
 
@@ -439,12 +439,12 @@ func _make_bone_nodes():
 	for bone in range(0, bones_in_chain.size()):
 		
 		var bone_name = bones_in_chain[bone]
-		if has_node(bone_name) == false:
+		if not has_node(bone_name):
 			var new_node = Spatial.new()
 			bone_nodes[bone] = new_node
 			add_child(bone_nodes[bone])
 			
-			if Engine.editor_hint == true:
+			if Engine.editor_hint:
 				if get_tree() != null:
 					if get_tree().edited_scene_root != null:
 						bone_nodes[bone].set_owner(get_tree().edited_scene_root)
@@ -455,7 +455,7 @@ func _make_bone_nodes():
 			bone_nodes[bone] = get_node(bone_name)
 		
 		# If we are in the editor, we want to make a sphere at this node
-		if Engine.editor_hint == true:
+		if Engine.editor_hint:
 			_make_editor_sphere_at_node(bone_nodes[bone], Color(0.65, 0, 1, 1))
 
 

+ 30 - 30
3d/ik/addons/sade/ik_look_at.gd

@@ -32,10 +32,10 @@ func _ready():
 	elif update_mode == 2:
 		set_notify_transform(true)
 	else:
-		if debug_messages == true:
-			print (name, " - IK_LookAt: Unknown update mode. NOT updating skeleton")
+		if debug_messages:
+			print(name, " - IK_LookAt: Unknown update mode. NOT updating skeleton")
 	
-	if Engine.editor_hint == true:
+	if Engine.editor_hint:
 		_setup_for_editor()
 
 
@@ -55,7 +55,7 @@ func _notification(what):
 func update_skeleton():
 	# NOTE: Because get_node doesn't work in _ready, we need to skip
 	# a call before doing anything.
-	if first_call == true:
+	if first_call:
 		first_call = false
 		if skeleton_to_use == null:
 			_set_skeleton_path(skeleton_path)
@@ -70,10 +70,10 @@ func update_skeleton():
 	# Get the bone index.
 	var bone: int = skeleton_to_use.find_bone(bone_name)
 	
-	# If no bone is found (-1), then return and optionally print an error.
+	# If no bone is found (-1), then return and optionally printan error.
 	if bone == -1:
-		if debug_messages == true:
-			print (name, " - IK_LookAt: No bone in skeleton found with name [", bone_name, "]!")
+		if debug_messages:
+			print(name, " - IK_LookAt: No bone in skeleton found with name [", bone_name, "]!")
 		return
 	
 	# get the bone's global transform pose.
@@ -91,23 +91,23 @@ func update_skeleton():
 		rest = rest.looking_at(target_pos, Vector3.FORWARD)
 	else:
 		rest = rest.looking_at(target_pos, Vector3.UP)
-		if debug_messages == true:
-			print (name, " - IK_LookAt: Unknown look_at_axis value!")
+		if debug_messages:
+			print(name, " - IK_LookAt: Unknown look_at_axis value!")
 	
 	# Get the rotation euler of the bone and of this node.
 	var rest_euler = rest.basis.get_euler()
 	var self_euler = global_transform.basis.orthonormalized().get_euler()
 	
 	# Flip the rotation euler if using negative rotation.
-	if use_negative_our_rot == true:
+	if use_negative_our_rot:
 		self_euler = -self_euler
 	
 	# Apply this node's rotation euler on each axis, if wanted/required.
-	if use_our_rotation_x == true:
+	if use_our_rotation_x:
 		rest_euler.x = self_euler.x
-	if use_our_rotation_y == true:
+	if use_our_rotation_y:
 		rest_euler.y = self_euler.y
-	if use_our_rotation_z == true:
+	if use_our_rotation_z:
 		rest_euler.z = self_euler.z
 	
 	# Make a new basis with the, potentially, changed euler angles.
@@ -167,25 +167,25 @@ func _set_update(new_value):
 	# Based on the value of passed to update, enable the correct process.
 	if update_mode == 0:
 		set_process(true)
-		if debug_messages == true:
-			print (name, " - IK_LookAt: updating skeleton using _process...")
+		if debug_messages:
+			print(name, " - IK_LookAt: updating skeleton using _process...")
 	elif update_mode == 1:
 		set_physics_process(true)
-		if debug_messages == true:
-			print (name, " - IK_LookAt: updating skeleton using _physics_process...")
+		if debug_messages:
+			print(name, " - IK_LookAt: updating skeleton using _physics_process...")
 	elif update_mode == 2:
 		set_notify_transform(true)
-		if debug_messages == true:
-			print (name, " - IK_LookAt: updating skeleton using _notification...")
+		if debug_messages:
+			print(name, " - IK_LookAt: updating skeleton using _notification...")
 	else:
-		if debug_messages == true:
-			print (name, " - IK_LookAt: NOT updating skeleton due to unknown update method...")
+		if debug_messages:
+			print(name, " - IK_LookAt: NOT updating skeleton due to unknown update method...")
 
 
 func _set_skeleton_path(new_value):
 	# Because get_node doesn't work in the first call, we just want to assign instead.
 	# This is to get around a issue with NodePaths exposed to the editor.
-	if first_call == true:
+	if first_call:
 		skeleton_path = new_value
 		return
 	
@@ -193,8 +193,8 @@ func _set_skeleton_path(new_value):
 	skeleton_path = new_value
 	
 	if skeleton_path == null:
-		if debug_messages == true:
-			print (name, " - IK_LookAt: No Nodepath selected for skeleton_path!")
+		if debug_messages:
+			print(name, " - IK_LookAt: No Nodepath selected for skeleton_path!")
 		return
 	
 	# Get the node at that location, if there is one.
@@ -202,12 +202,12 @@ func _set_skeleton_path(new_value):
 	if temp != null:
 		if temp is Skeleton:
 			skeleton_to_use = temp
-			if debug_messages == true:
-				print (name, " - IK_LookAt: attached to (new) skeleton")
+			if debug_messages:
+				print(name, " - IK_LookAt: attached to (new) skeleton")
 		else:
 			skeleton_to_use = null
-			if debug_messages == true:
-				print (name, " - IK_LookAt: skeleton_path does not point to a skeleton!")
+			if debug_messages:
+				print(name, " - IK_LookAt: skeleton_path does not point to a skeleton!")
 	else:
-		if debug_messages == true:
-			print (name, " - IK_LookAt: No Nodepath selected for skeleton_path!")
+		if debug_messages:
+			print(name, " - IK_LookAt: No Nodepath selected for skeleton_path!")

+ 0 - 6
3d/ik/addons/sade/plugin_main.gd

@@ -3,17 +3,11 @@ extends EditorPlugin
 
 func _enter_tree():
 	# Plugin Initialization here!
-	
-	# ------ IK STUFF ------
 	add_custom_type("IK_LookAt", "Spatial", preload("ik_look_at.gd"), preload("ik_look_at.png"))
 	add_custom_type("IK_FABRIK", "Spatial", preload("ik_fabrik.gd"), preload("ik_fabrik.png"))
-	# ------ ---------- ------
 
 
 func _exit_tree():
 	# Plugin Clean-up here!
-	
-	# ------ IK STUFF ------
 	remove_custom_type("IK_LookAt")
 	remove_custom_type("IK_FABRIK")
-	# ------ ---------- ------

+ 8 - 0
3d/ik/default_env.tres

@@ -5,3 +5,11 @@
 [resource]
 background_mode = 2
 background_sky = SubResource( 1 )
+ambient_light_color = Color( 1, 1, 1, 1 )
+ambient_light_sky_contribution = 0.8
+glow_enabled = true
+glow_levels/1 = true
+glow_levels/2 = true
+glow_levels/5 = false
+glow_intensity = 0.2
+glow_blend_mode = 0

+ 41 - 96
3d/ik/fabrik_ik.tscn

@@ -1,9 +1,9 @@
-[gd_scene load_steps=17 format=2]
+[gd_scene load_steps=15 format=2]
 
 [ext_resource path="res://addons/sade/editor_gizmo_texture.png" type="Texture" id=1]
-[ext_resource path="res://godot_battle_bot.dae" type="PackedScene" id=2]
-[ext_resource path="res://battle_bot_color.tres" type="Material" id=3]
-[ext_resource path="res://battle_bot_emission.tres" type="Material" id=4]
+[ext_resource path="res://model/godot_battle_bot.dae" type="PackedScene" id=2]
+[ext_resource path="res://model/battle_bot_color.tres" type="Material" id=3]
+[ext_resource path="res://model/battle_bot_emission.tres" type="Material" id=4]
 [ext_resource path="res://target_from_mousepos.gd" type="Script" id=5]
 [ext_resource path="res://addons/sade/ik_look_at.gd" type="Script" id=6]
 [ext_resource path="res://addons/sade/ik_look_at.png" type="Texture" id=7]
@@ -20,51 +20,25 @@ roughness = 0.2
 uv1_scale = Vector3( 0.25, 0.25, 0.25 )
 uv1_triplanar = true
 
-[sub_resource type="ProceduralSky" id=3]
-sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
-sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
-sky_curve = 0.25
-ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
-ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
-ground_curve = 0.01
-
-[sub_resource type="Environment" id=4]
-background_mode = 2
-background_sky = SubResource( 3 )
-ambient_light_color = Color( 1, 0.909804, 0.784314, 1 )
-ambient_light_energy = 1.4
-ambient_light_sky_contribution = 0.72
-tonemap_mode = 3
-glow_enabled = true
-glow_levels/1 = true
-glow_levels/2 = true
-glow_levels/5 = false
-glow_intensity = 0.2
-glow_bloom = 0.03
-glow_blend_mode = 0
-
-[sub_resource type="CubeMesh" id=5]
+[sub_resource type="CubeMesh" id=3]
 size = Vector3( 1, 1, 1 )
 
-[sub_resource type="SpatialMaterial" id=6]
+[sub_resource type="SpatialMaterial" id=4]
 albedo_color = Color( 0, 0.191406, 0.765625, 1 )
 roughness = 0.0
 
 [node name="FABRIK_IK" type="Spatial"]
 
-[node name="Floor_plane" type="MeshInstance" parent="."]
+[node name="Floor" type="MeshInstance" parent="."]
 mesh = SubResource( 1 )
 material/0 = SubResource( 2 )
 
 [node name="DirectionalLight" type="DirectionalLight" parent="."]
 transform = Transform( 0.56827, 0.673454, -0.472789, 0, 0.574581, 0.818448, 0.822842, -0.465099, 0.326517, -9.77531, 11.5204, 11.766 )
 
-[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
-environment = SubResource( 4 )
+[node name="GodotBattleBot" parent="." instance=ExtResource( 2 )]
 
-[node name="BattleBot" parent="." instance=ExtResource( 2 )]
-
-[node name="godot_battle_bot" parent="BattleBot/Armature/Skeleton" index="0"]
+[node name="godot_battle_bot" parent="GodotBattleBot/Armature/Skeleton" index="0"]
 material/0 = ExtResource( 3 )
 material/1 = ExtResource( 4 )
 
@@ -75,126 +49,94 @@ script = ExtResource( 5 )
 MOVEMENT_SPEED = -8.0
 flip_axis = true
 
-[node name="targets" type="Spatial" parent="Camera"]
+[node name="Targets" type="Spatial" parent="Camera"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -8 )
 
-[node name="IK_LookAt_Head" type="Spatial" parent="Camera/targets"]
+[node name="IK_LookAt_Head" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Head"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( 90, 0, 0 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="IK_FABRIK_Left_Arm" type="Spatial" parent="Camera/targets"]
+[node name="IK_FABRIK_Left_Arm" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 8 )
 __meta__ = {
 "_editor_icon": ExtResource( 9 )
 }
-skeleton_path = NodePath("../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bones_in_chain = PoolStringArray( "Left_UpperArm", "Left_LowerArm" )
 bones_in_chain_lengths = PoolRealArray( 1.97, 3 )
-update_mode = 0
 chain_iterations = 10
 limit_chain_iterations = false
-reset_iterations_on_update = false
 use_middle_joint_target = true
 
-[node name="target" type="Spatial" parent="Camera/targets/IK_FABRIK_Left_Arm"]
+[node name="Target" type="Spatial" parent="Camera/Targets/IK_FABRIK_Left_Arm"]
 transform = Transform( 0.518503, 0, -0.855076, 0, 1, 0, 0.855076, 0, 0.518503, 1.13159, 0, -0.155596 )
 
-[node name="IK_LookAt_LH" type="Spatial" parent="Camera/targets/IK_FABRIK_Left_Arm/target"]
+[node name="IK_LookAt_LH" type="Spatial" parent="Camera/Targets/IK_FABRIK_Left_Arm/Target"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.343393, -0.133381, 0.836605 )
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Left_Hand"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( 0, 0, 90 )
 position_using_additional_bone = true
 additional_bone_name = "Left_LowerArm"
 additional_bone_length = 3.0
-debug_messages = false
 
-[node name="middle_joint_target" type="Spatial" parent="Camera/targets/IK_FABRIK_Left_Arm"]
+[node name="MiddleJoint" type="Spatial" parent="Camera/Targets/IK_FABRIK_Left_Arm"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 7.16849, 0, -5.31922 )
 
-[node name="Left_UpperArm" type="Spatial" parent="Camera/targets/IK_FABRIK_Left_Arm"]
+[node name="Left_UpperArm" type="Spatial" parent="Camera/Targets/IK_FABRIK_Left_Arm"]
 transform = Transform( -0.66477, 0.0771345, -0.743055, -2.23517e-08, 0.994655, 0.103252, 0.747048, 0.0686391, -0.661217, 1.53444, 0.300478, -3.63533 )
 
-[node name="Left_LowerArm" type="Spatial" parent="Camera/targets/IK_FABRIK_Left_Arm"]
+[node name="Left_LowerArm" type="Spatial" parent="Camera/Targets/IK_FABRIK_Left_Arm"]
 transform = Transform( -0.773624, -0.0228999, 0.633231, 2.98023e-08, 0.999347, 0.03614, -0.633645, 0.0279588, -0.773119, 2.94998, 0.10378, -2.37569 )
 
-[node name="IK_FABRIK_Right_Arm" type="Spatial" parent="Camera/targets"]
+[node name="IK_FABRIK_Right_Arm" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 8 )
 __meta__ = {
 "_editor_icon": ExtResource( 9 )
 }
-skeleton_path = NodePath("../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bones_in_chain = PoolStringArray( "Right_UpperArm", "Right_LowerArm", "Right_Hand" )
 bones_in_chain_lengths = PoolRealArray( 1.97, 3, 1.2 )
-update_mode = 0
-chain_iterations = 0
 limit_chain_iterations = false
-reset_iterations_on_update = false
 use_middle_joint_target = true
 
-[node name="target" type="Spatial" parent="Camera/targets/IK_FABRIK_Right_Arm"]
+[node name="Target" type="Spatial" parent="Camera/Targets/IK_FABRIK_Right_Arm"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.229958, 0, 0.929313 )
 
-[node name="IK_LookAt_RH" type="Spatial" parent="Camera/targets/IK_FABRIK_Right_Arm/target"]
+[node name="IK_LookAt_RH" type="Spatial" parent="Camera/Targets/IK_FABRIK_Right_Arm/Target"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0544824, -0.133381, 0.332403 )
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Right_Hand"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( 0, 0, 90 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="middle_joint_target" type="Spatial" parent="Camera/targets/IK_FABRIK_Right_Arm"]
+[node name="MiddleJoint" type="Spatial" parent="Camera/Targets/IK_FABRIK_Right_Arm"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.34515, 0, -3.7843 )
 
-[node name="Right_UpperArm" type="Spatial" parent="Camera/targets/IK_FABRIK_Right_Arm"]
+[node name="Right_UpperArm" type="Spatial" parent="Camera/Targets/IK_FABRIK_Right_Arm"]
 transform = Transform( -0.694982, -0.0753926, 0.715064, -7.45058e-09, 0.994488, 0.104854, -0.719028, 0.0728714, -0.691151, -1.53339, 0.300478, -3.63533 )
 
-[node name="Right_LowerArm" type="Spatial" parent="Camera/targets/IK_FABRIK_Right_Arm"]
+[node name="Right_LowerArm" type="Spatial" parent="Camera/Targets/IK_FABRIK_Right_Arm"]
 transform = Transform( -0.792023, 0.0165711, -0.610266, -1.49012e-08, 0.999631, 0.0271438, 0.610491, 0.0214986, -0.791732, -2.89561, 0.100755, -2.31866 )
 
-[node name="Right_Hand" type="Spatial" parent="Camera/targets/IK_FABRIK_Right_Arm"]
+[node name="Right_Hand" type="Spatial" parent="Camera/Targets/IK_FABRIK_Right_Arm"]
 transform = Transform( -0.678336, 0.00698721, -0.734719, -2.32831e-09, 0.999955, 0.00950961, 0.734752, 0.00645071, -0.678305, -1.07914, 0.020072, 0.03791 )
 
-[node name="MeshInstance" type="MeshInstance" parent="Camera/targets"]
-mesh = SubResource( 5 )
-material/0 = SubResource( 6 )
+[node name="1MeterCube" type="MeshInstance" parent="Camera/Targets"]
+mesh = SubResource( 3 )
+material/0 = SubResource( 4 )
 
 [node name="Control" type="Control" parent="."]
 anchor_right = 1.0
@@ -225,7 +167,7 @@ Move mouse to move IK targets
 align = 1
 valign = 1
 
-[node name="Label_extra" type="Label" parent="Control/Panel"]
+[node name="LabelExtra" type="Label" parent="Control/Panel"]
 anchor_right = 1.0
 anchor_bottom = 1.0
 margin_left = 12.0
@@ -241,7 +183,7 @@ __meta__ = {
 "_edit_use_anchors_": false
 }
 
-[node name="Label_left" type="Label" parent="Control/Panel"]
+[node name="LabelLeft" type="Label" parent="Control/Panel"]
 anchor_left = 1.0
 anchor_right = 1.0
 margin_left = -248.0
@@ -251,7 +193,7 @@ margin_bottom = 18.0
 text = "Left Hand"
 align = 1
 
-[node name="Label_right" type="Label" parent="Control/Panel"]
+[node name="LabelRight" type="Label" parent="Control/Panel"]
 margin_left = 136.0
 margin_top = 5.0
 margin_right = 249.0
@@ -259,7 +201,7 @@ margin_bottom = 19.0
 text = "Right Hand"
 align = 1
 
-[node name="Button_Next" type="Button" parent="Control"]
+[node name="ButtonNext" type="Button" parent="Control"]
 anchor_left = 1.0
 anchor_top = 1.0
 anchor_right = 1.0
@@ -272,7 +214,7 @@ text = "Next scene"
 script = ExtResource( 10 )
 scene_to_change_to = "res://skeleton_ik.tscn"
 
-[node name="Button_Prev" type="Button" parent="Control"]
+[node name="ButtonPrev" type="Button" parent="Control"]
 anchor_top = 1.0
 anchor_bottom = 1.0
 margin_left = 10.0
@@ -281,6 +223,9 @@ margin_right = 129.0
 margin_bottom = -10.0
 text = "Previous scene"
 script = ExtResource( 10 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
 scene_to_change_to = "res://look_at_ik.tscn"
 
-[editable path="BattleBot"]
+[editable path="GodotBattleBot"]

+ 15 - 21
3d/ik/fps/example_player.gd

@@ -22,10 +22,6 @@ var dir = Vector3()
 var is_sprinting = false
 
 
-# We need the camera for getting directional vectors. We rotate ourselves on the Y-axis using
-# the camera_holder to avoid rotating on more than one axis at a time.
-var camera
-var camera_holder
 # You may need to adjust depending on the sensitivity of your mouse
 var MOUSE_SENSITIVITY = 0.08
 
@@ -34,37 +30,35 @@ var jump_button_down = false
 
 # The current lean value (our position on the lean track) and the path follow node
 var lean_value = 0.5
-var path_follow_node = null
 
 # A variable for tracking if the right mouse button is down.
 var right_mouse_down = false
 # A variable for tracking if we can fire using the left mouse button
 var left_mouse_timer = 0
 
-# The animation player for aiming down the sights
-var anim_player = null
 # A boolean for tracking whether we can change animations or not
 var anim_done = true
 # The current animation name
 var current_anim = "Starter"
 
-# The end of the pistol
-var pistol_end = null
 # The simple bullet rigidbody
 var simple_bullet = preload("res://fps/simple_bullet.tscn")
 
 
+# We need the camera for getting directional vectors. We rotate ourselves on the Y-axis using
+# the camera_holder to avoid rotating on more than one axis at a time.
+onready var camera_holder = $CameraHolder
+onready var camera = $CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/Camera
+onready var path_follow_node = $CameraHolder/LeanPath/PathFollow
+# The animation player for aiming down the sights.
+onready var anim_player = $CameraHolder/AnimationPlayer
+# The end of the pistol.
+onready var pistol_end = $CameraHolder/Weapon/Pistol/PistolEnd
+
+
 func _ready():
-	
-	camera = get_node("CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Camera")
-	camera_holder = get_node("CameraHolder")
-	path_follow_node = get_node("CameraHolder/Lean_Path/PathFollow")
-	
-	anim_player = get_node("CameraHolder/AnimationPlayer")
 	anim_player.connect("animation_finished", self, "animation_finished")
 	
-	pistol_end = get_node("CameraHolder/Weapon/Pistol/Pistol_end")
-	
 	set_physics_process(true)
 	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
 	set_process_input(true)
@@ -100,10 +94,10 @@ func process_input(delta):
 			Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
 	
 	if Input.is_mouse_button_pressed(2):
-		if right_mouse_down == false:
+		if not right_mouse_down:
 			right_mouse_down = true
 			
-			if anim_done == true:
+			if anim_done:
 				if current_anim != "Aiming":
 					anim_player.play("Aiming")
 					current_anim = "Aiming"
@@ -140,7 +134,7 @@ func process_input(delta):
 	# ----------------------------------
 	# Jumping
 	if Input.is_key_pressed(KEY_SPACE):
-		if jump_button_down == false:
+		if not jump_button_down:
 			jump_button_down = true
 			if is_on_floor():
 				vel.y = JUMP_SPEED
@@ -197,7 +191,7 @@ func process_movement(delta):
 	
 	var accel
 	if dir.dot(hvel) > 0:
-		if is_sprinting == false:
+		if not is_sprinting:
 			accel = ACCEL
 		else:
 			accel = SPRINT_ACCEL

+ 63 - 130
3d/ik/fps/fps_example.tscn

@@ -1,4 +1,4 @@
-[gd_scene load_steps=28 format=2]
+[gd_scene load_steps=26 format=2]
 
 [ext_resource path="res://addons/sade/editor_gizmo_texture.png" type="Texture" id=1]
 [ext_resource path="res://button_change_scene.gd" type="Script" id=2]
@@ -10,9 +10,9 @@
 [ext_resource path="res://fps/weapon_pistol.dae" type="PackedScene" id=8]
 [ext_resource path="res://fps/gun_color.tres" type="Material" id=9]
 [ext_resource path="res://fps/gun_emission.tres" type="Material" id=10]
-[ext_resource path="res://godot_battle_bot.dae" type="PackedScene" id=11]
-[ext_resource path="res://battle_bot_color.tres" type="Material" id=12]
-[ext_resource path="res://battle_bot_emission.tres" type="Material" id=13]
+[ext_resource path="res://model/godot_battle_bot.dae" type="PackedScene" id=11]
+[ext_resource path="res://model/battle_bot_color.tres" type="Material" id=12]
+[ext_resource path="res://model/battle_bot_emission.tres" type="Material" id=13]
 
 [sub_resource type="PlaneMesh" id=1]
 size = Vector2( 40, 40 )
@@ -42,42 +42,19 @@ albedo_color = Color( 0, 0.882813, 1, 1 )
 albedo_texture = ExtResource( 1 )
 uv1_triplanar = true
 
-[sub_resource type="ProceduralSky" id=8]
-sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
-sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
-sky_curve = 0.25
-ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
-ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
-ground_curve = 0.01
-
-[sub_resource type="Environment" id=9]
-background_mode = 2
-background_sky = SubResource( 8 )
-ambient_light_color = Color( 1, 0.909804, 0.784314, 1 )
-ambient_light_energy = 1.4
-ambient_light_sky_contribution = 0.72
-tonemap_mode = 3
-glow_enabled = true
-glow_levels/1 = true
-glow_levels/2 = true
-glow_levels/5 = false
-glow_intensity = 0.2
-glow_bloom = 0.03
-glow_blend_mode = 0
-
-[sub_resource type="CapsuleShape" id=10]
+[sub_resource type="CapsuleShape" id=8]
 radius = 4.0
 height = 6.0
 
-[sub_resource type="Curve3D" id=11]
+[sub_resource type="Curve3D" id=9]
 _data = {
 "points": PoolVector3Array( 0, 0, 0, 0, 0, 0, -2.43129, -0.955339, 0, 0, 0, 0, 0, 0, 0, -0.670561, 0.183959, 0, 0, 0, 0, 0, 0, 0, 0.64629, 0.228347, 0, 0, 0, 0, 0, 0, 0, 2.31825, -0.925747, 0 ),
 "tilts": PoolRealArray( 0, 0, 0, 0 )
 }
 
-[sub_resource type="Animation" id=12]
+[sub_resource type="Animation" id=10]
 tracks/0/type = "value"
-tracks/0/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos:translation")
+tracks/0/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/AimPos:translation")
 tracks/0/interp = 1
 tracks/0/loop_wrap = true
 tracks/0/imported = false
@@ -89,7 +66,7 @@ tracks/0/keys = {
 "values": [ Vector3( 0.570504, -2.2654, 2.93826 ), Vector3( 0, -1.36445, 3.78817 ) ]
 }
 tracks/1/type = "value"
-tracks/1/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos:rotation_degrees")
+tracks/1/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/AimPos:rotation_degrees")
 tracks/1/interp = 1
 tracks/1/loop_wrap = true
 tracks/1/imported = false
@@ -101,7 +78,7 @@ tracks/1/keys = {
 "values": [ Vector3( 0, -2, 0 ), Vector3( 0, 0, 0 ) ]
 }
 tracks/2/type = "value"
-tracks/2/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Camera:fov")
+tracks/2/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/Camera:fov")
 tracks/2/interp = 1
 tracks/2/loop_wrap = true
 tracks/2/imported = false
@@ -113,9 +90,9 @@ tracks/2/keys = {
 "values": [ 80.0, 60.0 ]
 }
 
-[sub_resource type="Animation" id=13]
+[sub_resource type="Animation" id=11]
 tracks/0/type = "value"
-tracks/0/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Camera:fov")
+tracks/0/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/Camera:fov")
 tracks/0/interp = 1
 tracks/0/loop_wrap = true
 tracks/0/imported = false
@@ -127,7 +104,7 @@ tracks/0/keys = {
 "values": [ 60.0, 80.0 ]
 }
 tracks/1/type = "value"
-tracks/1/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos:translation")
+tracks/1/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/AimPos:translation")
 tracks/1/interp = 1
 tracks/1/loop_wrap = true
 tracks/1/imported = false
@@ -139,7 +116,7 @@ tracks/1/keys = {
 "values": [ Vector3( 0, -1.36445, 3.78817 ), Vector3( 0.570504, -2.2654, 2.93826 ) ]
 }
 tracks/2/type = "value"
-tracks/2/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos:rotation_degrees")
+tracks/2/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/AimPos:rotation_degrees")
 tracks/2/interp = 1
 tracks/2/loop_wrap = true
 tracks/2/imported = false
@@ -151,9 +128,9 @@ tracks/2/keys = {
 "values": [ Vector3( 0, 0, 0 ), Vector3( 0, -2, 0 ) ]
 }
 
-[sub_resource type="Animation" id=14]
+[sub_resource type="Animation" id=12]
 tracks/0/type = "value"
-tracks/0/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos:translation")
+tracks/0/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/AimPos:translation")
 tracks/0/interp = 1
 tracks/0/loop_wrap = true
 tracks/0/imported = false
@@ -165,7 +142,7 @@ tracks/0/keys = {
 "values": [ Vector3( 0.570504, -2.2654, 2.93826 ) ]
 }
 tracks/1/type = "value"
-tracks/1/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos:rotation_degrees")
+tracks/1/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/AimPos:rotation_degrees")
 tracks/1/interp = 1
 tracks/1/loop_wrap = true
 tracks/1/imported = false
@@ -177,7 +154,7 @@ tracks/1/keys = {
 "values": [ Vector3( 0, -2, 0 ) ]
 }
 tracks/2/type = "value"
-tracks/2/path = NodePath("Lean_Path/PathFollow/IK_LookAt_Chest/Camera:fov")
+tracks/2/path = NodePath("LeanPath/PathFollow/IK_LookAt_Chest/Camera:fov")
 tracks/2/interp = 1
 tracks/2/loop_wrap = true
 tracks/2/imported = false
@@ -189,18 +166,18 @@ tracks/2/keys = {
 "values": [ 80.0 ]
 }
 
-[node name="LookAt_IK" type="Spatial"]
+[node name="FPSExample" type="Spatial"]
 
 [node name="Level" type="Spatial" parent="."]
 
-[node name="Floor_plane" type="MeshInstance" parent="Level"]
+[node name="Floor" type="MeshInstance" parent="Level"]
 transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 )
 mesh = SubResource( 1 )
 material/0 = SubResource( 2 )
 
-[node name="StaticBody" type="StaticBody" parent="Level/Floor_plane"]
+[node name="StaticBody" type="StaticBody" parent="Level/Floor"]
 
-[node name="CollisionShape" type="CollisionShape" parent="Level/Floor_plane/StaticBody"]
+[node name="CollisionShape" type="CollisionShape" parent="Level/Floor/StaticBody"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.956119, 0 )
 shape = SubResource( 3 )
 
@@ -401,9 +378,6 @@ transform = Transform( 0.388878, -0.754027, 0.529355, 0, 0.574581, 0.818448, -0.
 light_color = Color( 1, 0.925598, 0.820313, 1 )
 shadow_enabled = true
 
-[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
-environment = SubResource( 9 )
-
 [node name="Control" type="Control" parent="."]
 anchor_right = 1.0
 anchor_bottom = 1.0
@@ -430,7 +404,7 @@ Escape to free/lock mouse cursor"
 align = 1
 valign = 1
 
-[node name="Button_Prev" type="Button" parent="Control"]
+[node name="ButtonPrev" type="Button" parent="Control"]
 anchor_top = 1.0
 anchor_bottom = 1.0
 margin_left = 10.0
@@ -439,7 +413,10 @@ margin_right = 129.0
 margin_bottom = -10.0
 text = "Previous scene"
 script = ExtResource( 2 )
-scene_to_change_to = "res://fabrik_ik.tscn"
+__meta__ = {
+"_edit_use_anchors_": false
+}
+scene_to_change_to = "res://skeleton_ik.tscn"
 
 [node name="Crosshair" type="Control" parent="Control"]
 modulate = Color( 1, 1, 1, 0.784314 )
@@ -475,173 +452,129 @@ script = ExtResource( 3 )
 
 [node name="CollisionShape" type="CollisionShape" parent="KinematicBody"]
 transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 7, 0 )
-shape = SubResource( 10 )
+shape = SubResource( 8 )
 
 [node name="CameraHolder" type="Spatial" parent="KinematicBody"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13, 0 )
 
-[node name="Lean_Path" type="Path" parent="KinematicBody/CameraHolder"]
-curve = SubResource( 11 )
+[node name="LeanPath" type="Path" parent="KinematicBody/CameraHolder"]
+curve = SubResource( 9 )
 
-[node name="PathFollow" type="PathFollow" parent="KinematicBody/CameraHolder/Lean_Path"]
+[node name="PathFollow" type="PathFollow" parent="KinematicBody/CameraHolder/LeanPath"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0412404, 0.205172, 0 )
 offset = 2.71865
 rotation_mode = 0
 loop = false
 
-[node name="IK_LookAt_Chest" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow"]
+[node name="IK_LookAt_Chest" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.451559, 0 )
 script = ExtResource( 4 )
 __meta__ = {
 "_editor_icon": ExtResource( 5 )
 }
-skeleton_path = NodePath("../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Chest"
-update_mode = 0
 look_at_axis = 2
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( -10, 0, 0 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="Camera" type="Camera" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest"]
+[node name="Camera" type="Camera" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest"]
 transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0 )
 fov = 74.0
 
-[node name="Aim_pos" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest"]
+[node name="AimPos" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest"]
 transform = Transform( 0.999391, 0, -0.0348995, 0, 1, 0, 0.0348995, 0, 0.999391, 0.570504, -2.2654, 2.93826 )
 
-[node name="IK_FABRIK" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos"]
+[node name="IK_FABRIK" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos"]
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../../../GodotBattleBot/Armature/Skeleton")
 bones_in_chain = PoolStringArray( "Left_UpperArm", "Left_LowerArm", "Left_Hand" )
 bones_in_chain_lengths = PoolRealArray( 1.97, 3, 0.1 )
-update_mode = 0
-chain_iterations = 0
 limit_chain_iterations = false
-reset_iterations_on_update = false
 use_middle_joint_target = true
 
-[node name="target" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK"]
+[node name="Target" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.54883, -0.0335302, -0.934144 )
 
-[node name="IK_LookAt" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK/target"]
+[node name="IK_LookAt" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK/Target"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.300601, 0, 0.714191 )
 script = ExtResource( 4 )
 __meta__ = {
 "_editor_icon": ExtResource( 5 )
 }
-skeleton_path = NodePath("../../../../../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../../../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Left_Hand"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
 use_negative_our_rot = true
 additional_rotation = Vector3( 0, 0, 90 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="middle_joint_target" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK"]
+[node name="MiddleJoint" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.85263, -2.91316, -2.77555 )
 
-[node name="Left_UpperArm" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK"]
+[node name="Left_UpperArm" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK"]
 transform = Transform( -0.985848, -0.0154234, 0.16693, -0.0140715, 0.999858, 0.00927825, -0.167049, 0.00679813, -0.985925, 1.5529, -1.84646, -6.07288 )
 
-[node name="Left_LowerArm" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK"]
+[node name="Left_LowerArm" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK"]
 transform = Transform( -0.980952, 0.0992109, 0.167001, 0.116307, 0.988573, 0.0958931, -0.155579, 0.11349, -0.981282, 1.2349, -1.86413, -4.19466 )
 
-[node name="Left_Hand" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK"]
+[node name="Left_Hand" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK"]
 transform = Transform( -0.962426, 0.0909643, 0.255854, 0.128209, 0.982809, 0.132853, -0.23937, 0.160664, -0.957543, 0.737802, -2.14957, -1.27378 )
 
-[node name="IK_FABRIK_RightArm" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos"]
+[node name="IK_FABRIK_RightArm" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos"]
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../../../GodotBattleBot/Armature/Skeleton")
 bones_in_chain = PoolStringArray( "Right_UpperArm", "Right_LowerArm", "Right_Hand" )
 bones_in_chain_lengths = PoolRealArray( 1.97, 3, 0.1 )
-update_mode = 0
-chain_iterations = 0
 limit_chain_iterations = false
-reset_iterations_on_update = false
 use_middle_joint_target = true
 
-[node name="target" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK_RightArm"]
+[node name="Target" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK_RightArm"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.285662, -0.0335302, -1.05271 )
 
-[node name="IK_LookAt" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK_RightArm/target"]
+[node name="IK_LookAt" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK_RightArm/Target"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00396007, 0, 0.834561 )
 script = ExtResource( 4 )
 __meta__ = {
 "_editor_icon": ExtResource( 5 )
 }
-skeleton_path = NodePath("../../../../../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../../../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Right_Hand"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
 use_negative_our_rot = true
 additional_rotation = Vector3( 0, 0, 90 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="middle_joint_target" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK_RightArm"]
+[node name="MiddleJoint" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK_RightArm"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.73318, -2.91316, -2.77555 )
 
-[node name="Right_UpperArm" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK_RightArm"]
+[node name="Right_UpperArm" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK_RightArm"]
 
-[node name="Right_LowerArm" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK_RightArm"]
+[node name="Right_LowerArm" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK_RightArm"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.85263, -2.91316, -2.77555 )
 
-[node name="Right_Hand" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos/IK_FABRIK_RightArm"]
+[node name="Right_Hand" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos/IK_FABRIK_RightArm"]
 
-[node name="RemoteTransform" type="RemoteTransform" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow/IK_LookAt_Chest/Aim_pos"]
+[node name="RemoteTransform" type="RemoteTransform" parent="KinematicBody/CameraHolder/LeanPath/PathFollow/IK_LookAt_Chest/AimPos"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.505047, 0.268441 )
 remote_path = NodePath("../../../../../Weapon/Pistol")
 
-[node name="IK_LookAt_Head" type="Spatial" parent="KinematicBody/CameraHolder/Lean_Path/PathFollow"]
+[node name="IK_LookAt_Head" type="Spatial" parent="KinematicBody/CameraHolder/LeanPath/PathFollow"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.14041, -2.57003 )
 script = ExtResource( 4 )
 __meta__ = {
 "_editor_icon": ExtResource( 5 )
 }
-skeleton_path = NodePath("../../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Head"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
-additional_rotation = Vector3( 0, 0, 0 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
 [node name="AnimationPlayer" type="AnimationPlayer" parent="KinematicBody/CameraHolder"]
 autoplay = "Start"
 playback_speed = 4.0
-anims/Aiming = SubResource( 12 )
-anims/Idle = SubResource( 13 )
-anims/Start = SubResource( 14 )
+anims/Aiming = SubResource( 10 )
+anims/Idle = SubResource( 11 )
+anims/Start = SubResource( 12 )
 
 [node name="Weapon" type="Spatial" parent="KinematicBody/CameraHolder"]
 
@@ -653,15 +586,15 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
 material/0 = ExtResource( 9 )
 material/1 = ExtResource( 10 )
 
-[node name="Pistol_end" type="Spatial" parent="KinematicBody/CameraHolder/Weapon/Pistol"]
+[node name="PistolEnd" type="Spatial" parent="KinematicBody/CameraHolder/Weapon/Pistol"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0161836, 0.315914, 1.41329 )
 
-[node name="BattleBot" parent="KinematicBody" instance=ExtResource( 11 )]
+[node name="GodotBattleBot" parent="KinematicBody" instance=ExtResource( 11 )]
 
-[node name="godot_battle_bot" parent="KinematicBody/BattleBot/Armature/Skeleton" index="0"]
+[node name="godot_battle_bot" parent="KinematicBody/GodotBattleBot/Armature/Skeleton" index="0"]
 material/0 = ExtResource( 12 )
 material/1 = ExtResource( 13 )
 
 [editable path="KinematicBody/CameraHolder/Weapon/Pistol"]
 
-[editable path="KinematicBody/BattleBot"]
+[editable path="KinematicBody/GodotBattleBot"]

BIN
3d/ik/fps/gun_textures.png


+ 2 - 2
3d/ik/fps/gun_textures.png.import

@@ -22,8 +22,8 @@ compress/hdr_mode=0
 compress/bptc_ldr=0
 compress/normal_map=0
 flags/repeat=true
-flags/filter=true
-flags/mipmaps=true
+flags/filter=false
+flags/mipmaps=false
 flags/anisotropic=false
 flags/srgb=1
 process/fix_alpha_border=true

+ 1 - 1
3d/ik/fps/simple_bullet.gd

@@ -13,4 +13,4 @@ func _physics_process(delta):
 	timer += delta
 	if timer > DESPAWN_TIME:
 		queue_free()
-		timer = 0 # Make sure we are destroyed before we call this again!
+		timer = 0

+ 1 - 1
3d/ik/fps/weapon_pistol.dae.import

@@ -12,7 +12,7 @@ dest_files=[ "res://.import/weapon_pistol.dae-ed8a2a8a1d486f24880330c98eecbf74.s
 [params]
 
 nodes/root_type="Spatial"
-nodes/root_name="Scene Root"
+nodes/root_name="WeaponPistol"
 nodes/root_scale=1.0
 nodes/custom_script=""
 nodes/storage=0

BIN
3d/ik/godot_battle_bot_colors.png


+ 0 - 36
3d/ik/godot_battle_bot_colors.png.import

@@ -1,36 +0,0 @@
-[remap]
-
-importer="texture"
-type="StreamTexture"
-path.s3tc="res://.import/godot_battle_bot_colors.png-e31963bb1727b598c8ab928a0383fa54.s3tc.stex"
-path.etc2="res://.import/godot_battle_bot_colors.png-e31963bb1727b598c8ab928a0383fa54.etc2.stex"
-metadata={
-"imported_formats": [ "s3tc", "etc2" ],
-"vram_texture": true
-}
-
-[deps]
-
-source_file="res://godot_battle_bot_colors.png"
-dest_files=[ "res://.import/godot_battle_bot_colors.png-e31963bb1727b598c8ab928a0383fa54.s3tc.stex", "res://.import/godot_battle_bot_colors.png-e31963bb1727b598c8ab928a0383fa54.etc2.stex" ]
-
-[params]
-
-compress/mode=2
-compress/lossy_quality=0.7
-compress/hdr_mode=0
-compress/bptc_ldr=0
-compress/normal_map=0
-flags/repeat=true
-flags/filter=true
-flags/mipmaps=true
-flags/anisotropic=false
-flags/srgb=1
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/HDR_as_SRGB=false
-process/invert_color=false
-stream=false
-size_limit=0
-detect_3d=false
-svg/scale=1.0

BIN
3d/ik/godot_battle_bot_emission.png


+ 0 - 36
3d/ik/godot_battle_bot_emission.png.import

@@ -1,36 +0,0 @@
-[remap]
-
-importer="texture"
-type="StreamTexture"
-path.s3tc="res://.import/godot_battle_bot_emission.png-c363ccbe8ada8fe822cd5528b54fc924.s3tc.stex"
-path.etc2="res://.import/godot_battle_bot_emission.png-c363ccbe8ada8fe822cd5528b54fc924.etc2.stex"
-metadata={
-"imported_formats": [ "s3tc", "etc2" ],
-"vram_texture": true
-}
-
-[deps]
-
-source_file="res://godot_battle_bot_emission.png"
-dest_files=[ "res://.import/godot_battle_bot_emission.png-c363ccbe8ada8fe822cd5528b54fc924.s3tc.stex", "res://.import/godot_battle_bot_emission.png-c363ccbe8ada8fe822cd5528b54fc924.etc2.stex" ]
-
-[params]
-
-compress/mode=2
-compress/lossy_quality=0.7
-compress/hdr_mode=0
-compress/bptc_ldr=0
-compress/normal_map=0
-flags/repeat=true
-flags/filter=true
-flags/mipmaps=true
-flags/anisotropic=false
-flags/srgb=1
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/HDR_as_SRGB=false
-process/invert_color=false
-stream=false
-size_limit=0
-detect_3d=false
-svg/scale=1.0

+ 22 - 76
3d/ik/look_at_ik.tscn

@@ -1,9 +1,9 @@
-[gd_scene load_steps=13 format=2]
+[gd_scene load_steps=11 format=2]
 
 [ext_resource path="res://addons/sade/editor_gizmo_texture.png" type="Texture" id=1]
-[ext_resource path="res://godot_battle_bot.dae" type="PackedScene" id=2]
-[ext_resource path="res://battle_bot_color.tres" type="Material" id=3]
-[ext_resource path="res://battle_bot_emission.tres" type="Material" id=4]
+[ext_resource path="res://model/godot_battle_bot.dae" type="PackedScene" id=2]
+[ext_resource path="res://model/battle_bot_color.tres" type="Material" id=3]
+[ext_resource path="res://model/battle_bot_emission.tres" type="Material" id=4]
 [ext_resource path="res://target_from_mousepos.gd" type="Script" id=5]
 [ext_resource path="res://addons/sade/ik_look_at.gd" type="Script" id=6]
 [ext_resource path="res://addons/sade/ik_look_at.png" type="Texture" id=7]
@@ -18,44 +18,18 @@ roughness = 0.2
 uv1_scale = Vector3( 0.25, 0.25, 0.25 )
 uv1_triplanar = true
 
-[sub_resource type="ProceduralSky" id=3]
-sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
-sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
-sky_curve = 0.25
-ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
-ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
-ground_curve = 0.01
-
-[sub_resource type="Environment" id=4]
-background_mode = 2
-background_sky = SubResource( 3 )
-ambient_light_color = Color( 1, 0.909804, 0.784314, 1 )
-ambient_light_energy = 1.4
-ambient_light_sky_contribution = 0.72
-tonemap_mode = 3
-glow_enabled = true
-glow_levels/1 = true
-glow_levels/2 = true
-glow_levels/5 = false
-glow_intensity = 0.2
-glow_bloom = 0.03
-glow_blend_mode = 0
-
-[node name="LookAt_IK" type="Spatial"]
-
-[node name="Floor_plane" type="MeshInstance" parent="."]
+[node name="LookAtIK" type="Spatial"]
+
+[node name="Floor" type="MeshInstance" parent="."]
 mesh = SubResource( 1 )
 material/0 = SubResource( 2 )
 
 [node name="DirectionalLight" type="DirectionalLight" parent="."]
 transform = Transform( 0.56827, 0.673454, -0.472789, 0, 0.574581, 0.818448, 0.822842, -0.465099, 0.326517, -9.77531, 11.5204, 11.766 )
 
-[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
-environment = SubResource( 4 )
-
-[node name="BattleBot" parent="." instance=ExtResource( 2 )]
+[node name="GodotBattleBot" parent="." instance=ExtResource( 2 )]
 
-[node name="godot_battle_bot" parent="BattleBot/Armature/Skeleton" index="0"]
+[node name="godot_battle_bot" parent="GodotBattleBot/Armature/Skeleton" index="0"]
 material/0 = ExtResource( 3 )
 material/1 = ExtResource( 4 )
 
@@ -66,64 +40,33 @@ script = ExtResource( 5 )
 MOVEMENT_SPEED = -3.0
 flip_axis = true
 
-[node name="targets" type="Spatial" parent="Camera"]
+[node name="Targets" type="Spatial" parent="Camera"]
 
-[node name="IK_LookAt_Head" type="Spatial" parent="Camera/targets"]
+[node name="IK_LookAt_Head" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Head"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( 90, 0, 0 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="IK_LookAt_LeftArm" type="Spatial" parent="Camera/targets"]
+[node name="IK_LookAt_LeftArm" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Left_UpperArm"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
-additional_rotation = Vector3( 0, 0, 0 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
-
-[node name="IK_LookAt_RightArm" type="Spatial" parent="Camera/targets"]
+
+[node name="IK_LookAt_RightArm" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 6 )
 __meta__ = {
 "_editor_icon": ExtResource( 7 )
 }
-skeleton_path = NodePath("../../../BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Right_UpperArm"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( 0, 0, 180 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
 [node name="Control" type="Control" parent="."]
 anchor_right = 1.0
@@ -155,8 +98,11 @@ text = "LookAt IK
 Move mouse to move IK targets"
 align = 1
 valign = 1
+__meta__ = {
+"_edit_use_anchors_": false
+}
 
-[node name="Button_Next" type="Button" parent="Control"]
+[node name="ButtonNext" type="Button" parent="Control"]
 anchor_left = 1.0
 anchor_top = 1.0
 anchor_right = 1.0
@@ -172,4 +118,4 @@ __meta__ = {
 }
 scene_to_change_to = "res://fabrik_ik.tscn"
 
-[editable path="BattleBot"]
+[editable path="GodotBattleBot"]

+ 5 - 0
3d/ik/model/README.md

@@ -0,0 +1,5 @@
+# Godot Battle Bot
+
+This folder contains the model and textures/materials for the Godot Battle Bot.
+
+Yes, the battle bot really is 14.5 meters tall. It is a powerful robot.

+ 1 - 2
3d/ik/battle_bot_color.tres → 3d/ik/model/battle_bot_color.tres

@@ -1,6 +1,6 @@
 [gd_resource type="SpatialMaterial" load_steps=2 format=2]
 
-[ext_resource path="res://godot_battle_bot_colors.png" type="Texture" id=1]
+[ext_resource path="res://model/godot_battle_bot_colors.png" type="Texture" id=1]
 
 [resource]
 
@@ -55,4 +55,3 @@ uv2_triplanar_sharpness = 1.0
 proximity_fade_enable = false
 distance_fade_enable = false
 _sections_unfolded = [ "Albedo" ]
-

+ 0 - 0
3d/ik/battle_bot_emission.tres → 3d/ik/model/battle_bot_emission.tres


+ 0 - 0
3d/ik/godot_battle_bot.dae → 3d/ik/model/godot_battle_bot.dae


+ 4 - 4
3d/ik/godot_battle_bot.dae.import → 3d/ik/model/godot_battle_bot.dae.import

@@ -2,17 +2,17 @@
 
 importer="scene"
 type="PackedScene"
-path="res://.import/godot_battle_bot.dae-eca9fb346b160636fd03ddf258af136e.scn"
+path="res://.import/godot_battle_bot.dae-b816538849caf76e74976d7a086ba5f7.scn"
 
 [deps]
 
-source_file="res://godot_battle_bot.dae"
-dest_files=[ "res://.import/godot_battle_bot.dae-eca9fb346b160636fd03ddf258af136e.scn" ]
+source_file="res://model/godot_battle_bot.dae"
+dest_files=[ "res://.import/godot_battle_bot.dae-b816538849caf76e74976d7a086ba5f7.scn" ]
 
 [params]
 
 nodes/root_type="Spatial"
-nodes/root_name="Scene Root"
+nodes/root_name="GodotBattleBot"
 nodes/root_scale=1.0
 nodes/custom_script=""
 nodes/storage=0

BIN
3d/ik/model/godot_battle_bot_colors.png


+ 36 - 0
3d/ik/model/godot_battle_bot_colors.png.import

@@ -0,0 +1,36 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path.s3tc="res://.import/godot_battle_bot_colors.png-db0edfc662d0fffff287aad7600ab21a.s3tc.stex"
+path.etc2="res://.import/godot_battle_bot_colors.png-db0edfc662d0fffff287aad7600ab21a.etc2.stex"
+metadata={
+"imported_formats": [ "s3tc", "etc2" ],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://model/godot_battle_bot_colors.png"
+dest_files=[ "res://.import/godot_battle_bot_colors.png-db0edfc662d0fffff287aad7600ab21a.s3tc.stex", "res://.import/godot_battle_bot_colors.png-db0edfc662d0fffff287aad7600ab21a.etc2.stex" ]
+
+[params]
+
+compress/mode=2
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=true
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=1
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=false
+svg/scale=1.0

BIN
3d/ik/model/godot_battle_bot_emission.png


+ 36 - 0
3d/ik/model/godot_battle_bot_emission.png.import

@@ -0,0 +1,36 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path.s3tc="res://.import/godot_battle_bot_emission.png-59fd27c1839e5b7c5584f3c2131bce33.s3tc.stex"
+path.etc2="res://.import/godot_battle_bot_emission.png-59fd27c1839e5b7c5584f3c2131bce33.etc2.stex"
+metadata={
+"imported_formats": [ "s3tc", "etc2" ],
+"vram_texture": true
+}
+
+[deps]
+
+source_file="res://model/godot_battle_bot_emission.png"
+dest_files=[ "res://.import/godot_battle_bot_emission.png-59fd27c1839e5b7c5584f3c2131bce33.s3tc.stex", "res://.import/godot_battle_bot_emission.png-59fd27c1839e5b7c5584f3c2131bce33.etc2.stex" ]
+
+[params]
+
+compress/mode=2
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=true
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=1
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=false
+svg/scale=1.0

+ 31 - 61
3d/ik/skeleton_ik.tscn

@@ -1,12 +1,12 @@
-[gd_scene load_steps=16 format=2]
+[gd_scene load_steps=14 format=2]
 
 [ext_resource path="res://skeleton_ik_runner.gd" type="Script" id=1]
 [ext_resource path="res://addons/sade/ik_look_at.png" type="Texture" id=2]
 [ext_resource path="res://addons/sade/editor_gizmo_texture.png" type="Texture" id=3]
-[ext_resource path="res://godot_battle_bot.dae" type="PackedScene" id=4]
+[ext_resource path="res://model/godot_battle_bot.dae" type="PackedScene" id=4]
 [ext_resource path="res://target_from_mousepos.gd" type="Script" id=5]
-[ext_resource path="res://battle_bot_color.tres" type="Material" id=6]
-[ext_resource path="res://battle_bot_emission.tres" type="Material" id=7]
+[ext_resource path="res://model/battle_bot_color.tres" type="Material" id=6]
+[ext_resource path="res://model/battle_bot_emission.tres" type="Material" id=7]
 [ext_resource path="res://button_change_scene.gd" type="Script" id=8]
 [ext_resource path="res://addons/sade/ik_look_at.gd" type="Script" id=9]
 
@@ -19,70 +19,44 @@ roughness = 0.2
 uv1_scale = Vector3( 0.25, 0.25, 0.25 )
 uv1_triplanar = true
 
-[sub_resource type="ProceduralSky" id=3]
-sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
-sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
-sky_curve = 0.25
-ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
-ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
-ground_curve = 0.01
-
-[sub_resource type="Environment" id=4]
-background_mode = 2
-background_sky = SubResource( 3 )
-ambient_light_color = Color( 1, 0.909804, 0.784314, 1 )
-ambient_light_energy = 1.4
-ambient_light_sky_contribution = 0.72
-tonemap_mode = 3
-glow_enabled = true
-glow_levels/1 = true
-glow_levels/2 = true
-glow_levels/5 = false
-glow_intensity = 0.2
-glow_bloom = 0.03
-glow_blend_mode = 0
-
-[sub_resource type="CubeMesh" id=5]
+[sub_resource type="CubeMesh" id=3]
 size = Vector3( 1, 1, 1 )
 
-[sub_resource type="SpatialMaterial" id=6]
+[sub_resource type="SpatialMaterial" id=4]
 albedo_color = Color( 0, 0.191406, 0.765625, 1 )
 roughness = 0.0
 
-[node name="Skeleton_IK" type="Spatial"]
+[node name="SkeletonIK" type="Spatial"]
 
-[node name="Floor_plane" type="MeshInstance" parent="."]
+[node name="Floor" type="MeshInstance" parent="."]
 mesh = SubResource( 1 )
 material/0 = SubResource( 2 )
 
 [node name="DirectionalLight" type="DirectionalLight" parent="."]
 transform = Transform( 0.56827, 0.673454, -0.472789, 0, 0.574581, 0.818448, 0.822842, -0.465099, 0.326517, -9.77531, 11.5204, 11.766 )
 
-[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
-environment = SubResource( 4 )
+[node name="GodotBattleBot" parent="." instance=ExtResource( 4 )]
 
-[node name="BattleBot" parent="." instance=ExtResource( 4 )]
-
-[node name="godot_battle_bot" parent="BattleBot/Armature/Skeleton" index="0"]
+[node name="godot_battle_bot" parent="GodotBattleBot/Armature/Skeleton" index="0"]
 material/0 = ExtResource( 6 )
 material/1 = ExtResource( 7 )
 
-[node name="SkeletonIK_Left" type="SkeletonIK" parent="BattleBot/Armature/Skeleton" index="1"]
+[node name="SkeletonIK_Left" type="SkeletonIK" parent="GodotBattleBot/Armature/Skeleton" index="1"]
 process_priority = 1
 root_bone = "Left_UpperArm"
 tip_bone = "Left_Hand"
 use_magnet = true
 magnet = Vector3( 8, 6, 0 )
-target_node = NodePath("../../../../Camera/targets/Target_Left")
+target_node = NodePath("../../../../Camera/Targets/TargetLeft")
 script = ExtResource( 1 )
 
-[node name="SkeletonIK_Right" type="SkeletonIK" parent="BattleBot/Armature/Skeleton" index="2"]
+[node name="SkeletonIK_Right" type="SkeletonIK" parent="GodotBattleBot/Armature/Skeleton" index="2"]
 process_priority = 1
 root_bone = "Right_UpperArm"
 tip_bone = "Right_Hand"
 use_magnet = true
 magnet = Vector3( -8, 6, 0 )
-target_node = NodePath("../../../../Camera/targets/Target_Right")
+target_node = NodePath("../../../../Camera/Targets/TargetRight")
 script = ExtResource( 1 )
 
 [node name="Camera" type="Camera" parent="."]
@@ -92,36 +66,26 @@ script = ExtResource( 5 )
 MOVEMENT_SPEED = -8.0
 flip_axis = true
 
-[node name="targets" type="Spatial" parent="Camera"]
+[node name="Targets" type="Spatial" parent="Camera"]
 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -8 )
 
-[node name="IK_LookAt_Head" type="Spatial" parent="Camera/targets"]
+[node name="IK_LookAt_Head" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 9 )
 __meta__ = {
 "_editor_icon": ExtResource( 2 )
 }
-skeleton_path = NodePath("../../../../Skeleton_IK/BattleBot/Armature/Skeleton")
+skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Head"
-update_mode = 0
-look_at_axis = 1
-use_our_rotation_x = false
-use_our_rotation_y = false
-use_our_rotation_z = false
-use_negative_our_rot = false
 additional_rotation = Vector3( 90, 0, 0 )
-position_using_additional_bone = false
-additional_bone_name = ""
-additional_bone_length = 1.0
-debug_messages = false
 
-[node name="MeshInstance" type="MeshInstance" parent="Camera/targets"]
-mesh = SubResource( 5 )
-material/0 = SubResource( 6 )
+[node name="1MeterCube" type="MeshInstance" parent="Camera/Targets"]
+mesh = SubResource( 3 )
+material/0 = SubResource( 4 )
 
-[node name="Target_Left" type="Position3D" parent="Camera/targets"]
+[node name="TargetLeft" type="Position3D" parent="Camera/Targets"]
 transform = Transform( -0.179447, 0.98366, -0.0145678, 0.981822, 0.178142, -0.0654973, -0.0618319, -0.0260563, -0.997746, 0.653517, -0.112305, -0.760886 )
 
-[node name="Target_Right" type="Position3D" parent="Camera/targets"]
+[node name="TargetRight" type="Position3D" parent="Camera/Targets"]
 transform = Transform( -0.0217688, 0.998559, -0.0490576, 0.992503, 0.0274873, 0.119085, 0.120262, -0.0460975, -0.991671, -0.683053, 0.0251284, -0.811513 )
 
 [node name="Control" type="Control" parent="."]
@@ -158,7 +122,7 @@ __meta__ = {
 "_edit_use_anchors_": false
 }
 
-[node name="Button_Next" type="Button" parent="Control"]
+[node name="ButtonNext" type="Button" parent="Control"]
 anchor_left = 1.0
 anchor_top = 1.0
 anchor_right = 1.0
@@ -169,9 +133,12 @@ margin_right = -5.0
 margin_bottom = -10.0
 text = "Next scene"
 script = ExtResource( 8 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
 scene_to_change_to = "res://fps/fps_example.tscn"
 
-[node name="Button_Prev" type="Button" parent="Control"]
+[node name="ButtonPrev" type="Button" parent="Control"]
 anchor_top = 1.0
 anchor_bottom = 1.0
 margin_left = 10.0
@@ -180,6 +147,9 @@ margin_right = 129.0
 margin_bottom = -10.0
 text = "Previous scene"
 script = ExtResource( 8 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
 scene_to_change_to = "res://fabrik_ik.tscn"
 
-[editable path="BattleBot"]
+[editable path="GodotBattleBot"]

+ 4 - 8
3d/ik/target_from_mousepos.gd

@@ -3,19 +3,15 @@ extends Camera
 export(float) var MOVEMENT_SPEED = 12
 export(bool) var flip_axis = false
 
-var targets = null
-
-
-func _ready():
-	targets = get_node("targets")
+onready var targets = $Targets
 
 
 func _process(_delta):
 	var mouse_to_world = project_local_ray_normal(get_viewport().get_mouse_position()) * MOVEMENT_SPEED
 	
-	if flip_axis == false:
-		mouse_to_world.z *= -1
-	else:
+	if flip_axis:
 		mouse_to_world = -mouse_to_world
+	else:
+		mouse_to_world.z *= -1
 	
 	targets.transform.origin = mouse_to_world