Fixed bad shading on Handgun, subdivided the hand geometry, fixed shell casing ejection angle and orientation

remotes/1705725415861086127/tmp_refs/heads/main
unfa 2021-09-17 21:22:37 +02:00
parent c3f523e302
commit 614d6a3b80
5 changed files with 220 additions and 253 deletions

Binary file not shown.

View File

@ -23,11 +23,12 @@ contact_monitor = true
script = ExtResource( "1_kwgjj" )
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0, 0, 0)
transform = Transform3D(1.91069e-15, 4.37114e-08, 1, 1, -4.37114e-08, 0, 4.37114e-08, 1, -4.37114e-08, 0, 0, 0)
shape = SubResource( "2" )
script = null
[node name="Casing" parent="." instance=ExtResource( "1" )]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
[node name="Timer" type="Timer" parent="."]
wait_time = 5.0

File diff suppressed because one or more lines are too long

View File

@ -90,12 +90,7 @@ var impact_player = preload("res://Assets/Effects/ImpactBlood.tscn")
get_tree().root.add_child(casing_instance)
casing_instance.global_transform = ejector.global_transform.translated(player.linear_velocity / 30) #approximating delta
#casing_instance.rotate_object_local(Vector3.FORWARD, deg2rad(90))
#casing_instance.angular_velocity = - ejector.global_transform.basis[2] * randf_range(13, 17)
# TODO correct the ejection angle - right now it shoots straight up relative to the gun
casing_instance.linear_velocity = ejector.global_transform.basis[0] * randf_range(6.2, 8.5)# - ejector.global_transform.basis[2] * randf_range(-1.2, -1.7) + player.linear_velocity
casing_instance.linear_velocity = ejector.global_transform.basis[1] * randf_range(6.2, 8.5)# - ejector.global_transform.basis[2] * randf_range(-1.2, -1.7) + player.linear_velocity
# Called when the node enters the scene tree for the first time.
func _ready():

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://bemrov0tiy08n"]
[ext_resource type="PackedScene" uid="uid://cajs6ugsr1efo" path="res://Assets/Weapons/Handgun/Handgun.gltf" id="1"]
[ext_resource type="PackedScene" uid="uid://bci2qnohg76xa" path="res://Assets/Weapons/Handgun/Handgun.gltf" id="1"]
[ext_resource type="Script" path="res://Assets/Weapons/Weapon.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://c5cwnfuw4go1b" path="res://Assets/Audio/SoundPlayer.tscn" id="3_q0xp7"]