update move

This commit is contained in:
AleaJactaEst 2021-09-04 17:49:11 +02:00
parent 520ac8f36c
commit a412daf632
24 changed files with 27833 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://assets/creatures/raference/raference_animated.gltf" type="PackedScene" id=1]
[node name="raference" instance=ExtResource( 1 )]
[node name="AnimationPlayer" parent="." index="2"]
autoplay = "_bip01_ca_female_idle"

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,49 @@
{
"format": {
"version": "1.0"
},
"shaders": {
"Main shader": {
"parameters": {
"Common Parameters": {
"ao_intensity": 0.75,
"emissive_intensity": 1,
"horizonFade": 1.2999999523162842,
"nbSamples": 16
},
"Parallax Occlusion Mapping": {
"maxPOMSamples": 16,
"minPOMSamples": 4,
"pomStrength": 1,
"usePOM": false
},
"Subsurface Scattering Parameters": {
"sssColor": [
0.7009999752044678,
0.3009999990463257,
0.3050000071525574
],
"sssEnabled": true,
"sssScale": 0.5,
"sssType": 1
}
},
"shader": "pbr-metal-rough",
"shaderInstance": "Main shader"
}
},
"texturesets": {
"ra_ferens_boots": {
"shader": "Main shader"
},
"ra_ferens_head_arms": {
"shader": "Main shader"
},
"ra_ferens_legs": {
"shader": "Main shader"
},
"ra_ferens_torso": {
"shader": "Main shader"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

View file

@ -6,6 +6,8 @@ var orientation = 0.0
var direction = Vector3.ZERO var direction = Vector3.ZERO
var velocity: = Vector3.ZERO var velocity: = Vector3.ZERO
var rotatex = 0.0 var rotatex = 0.0
var move_run: bool = false
var move_toggle_run: bool = false
export var gravity = -9.0 export var gravity = -9.0
enum ACTION { enum ACTION {
@ -116,11 +118,22 @@ func _process( delta ):
$creature.rotate_y( self.rotation_speed_factor * self.orientation ) $creature.rotate_y( self.rotation_speed_factor * self.orientation )
var input_direction: = self.get_input_direction() var input_direction: = self.get_input_direction()
var forwards: Vector3 = $creature/camera_tps.global_transform.basis.z * input_direction.z var forwards: Vector3 = $creature/camera_tps.global_transform.basis.z * input_direction.z
var right: Vector3 = $creature/camera_tps.global_transform.basis.x * input_direction.x var right: Vector3 = $creature/camera_tps.global_transform.basis.x * input_direction.x
var move_direction: = forwards + right var move_direction: = forwards + right
if move_direction.length() > 1.0: if move_direction.length() > 1.0:
move_direction = move_direction.normalized() move_direction = move_direction.normalized()
var step_move
if (self.move_toggle_run or Input.get_action_strength("move_run")) and input_direction.z < 0.0:
self.move_run = true
step_move = $creature.run_speed
else:
self.move_run = false
step_move = $creature.move_speed
move_direction = step_move * move_direction
move_direction.y = 0 move_direction.y = 0
# Movement # Movement
@ -129,16 +142,16 @@ func _process( delta ):
# Config.msg_info("velocity X:" + str(velocity.x) + " Y:" + str(velocity.y) + " Z:" + str(velocity.z)) # Config.msg_info("velocity X:" + str(velocity.x) + " Y:" + str(velocity.y) + " Z:" + str(velocity.z))
velocity = $creature.move_and_slide(velocity, Vector3.UP, true) velocity = $creature.move_and_slide(velocity, Vector3.UP, true)
var pos : Vector3 = $creature.get_global_transform().origin var pos : Vector3 = $creature.get_global_transform().origin
Config.msg_info("pos X:" + str(pos.x) + " Y:" + str(pos.y) + " Z:" + str(pos.z)) Config.msg_info("pos X:" + str(pos.x) + " Y:" + str(pos.y) + " Z:" + str(pos.z) + " run:" + str(Input.get_action_strength("move_run")) + str(Input.get_action_strength("move_toggle_run")) )
if input_direction: if input_direction:
if not input_direction.z == 0.0: if not input_direction.z == 0.0:
#if self.is_sprinting(): if input_direction.z < 0.0:
# $model/ra/model/AnimationPlayer.play( "run" ) if self.move_run:
#else: update_animation( ACTION.run, $creature.animation_run )
# $model/ra/model/AnimationPlayer.play( "walk" ) else:
update_animation( ACTION.walk, $creature.animation_walk ) update_animation( ACTION.walk, $creature.animation_walk )
pass else:
update_animation( ACTION.idle, $creature.get_animation_idle() )
elif input_direction.x > 0.0: elif input_direction.x > 0.0:
# $model/ra/model/AnimationPlayer.play( "strafe_right" ) # $model/ra/model/AnimationPlayer.play( "strafe_right" )
update_animation( ACTION.idle, $creature.get_animation_idle() ) update_animation( ACTION.idle, $creature.get_animation_idle() )
@ -185,6 +198,8 @@ func _input( event ):
var sum = event.relative.y *0.01 var sum = event.relative.y *0.01
rotatex += sum rotatex += sum
$creature/camera_fps.rotate_x( sum ) $creature/camera_fps.rotate_x( sum )
elif event.is_action_pressed("move_toggle_run"):
self.move_toggle_run = ! self.move_toggle_run
elif event.is_action_pressed( "camera_switch" ): elif event.is_action_pressed( "camera_switch" ):
if $creature/camera_tps.current: if $creature/camera_tps.current:
# Reset angle X for camera # Reset angle X for camera