khanat-client/scenes/player/player.gd

48 lines
2.2 KiB
GDScript

extends "res://ressources/scripts/entity.gd"
func _ready():
$model/ra/spring_arm/camera.make_current()
func load_creature( filename ):
self.creature = Creatures.Ra.new()
self.creature.from_file( filename )
# # version statique.
# $model/ra/model/body.set( "blend_shapes/Boobs", self.creature.female_boobs )
# $model/ra/model/body.set( "blend_shapes/Female_hip", self.creature.female_hip )
# $model/ra/model/body.set( "blend_shapes/Male_Pack", self.creature.male_pack )
# $model/ra/model/body.set( "blend_shapes/Male_Throat", self.creature.male_throat )
# $model/ra/model/body.set( "blend_shapes/Pregnant", self.creature.female_pregnant )
# $model/ra/model/body.set( "blend_shapes/Pregnant", self.creature.female_pregnant )
# $model/ra/model/body.get_surface_material( 0 ).set_shader_param( "albedo", self.creature.color )
#
# Version animée.
$model/ra/model/metarig/Skeleton/body.set( "blend_shapes/Boobs", self.creature.female_boobs )
$model/ra/model/metarig/Skeleton/body.set( "blend_shapes/Female_hip", self.creature.female_hip )
$model/ra/model/metarig/Skeleton/body.set( "blend_shapes/Male_Pack", self.creature.male_pack )
$model/ra/model/metarig/Skeleton/body.set( "blend_shapes/Male_Throat", self.creature.male_throat )
$model/ra/model/metarig/Skeleton/body.set( "blend_shapes/Pregnant", self.creature.female_pregnant )
$model/ra/model/metarig/Skeleton/body.set( "blend_shapes/Pregnant", self.creature.female_pregnant )
$model/ra/model/metarig/Skeleton/body.get_surface_material( 0 ).set_shader_param( "albedo", self.creature.color )
func rotate_camera_arm( p_axis, p_angle_degree ):
$model/ra/spring_arm.rotate( p_axis, p_angle_degree )
func rotate_camera( p_axis, p_angle_degree ):
$model/ra/spring_arm/camera.rotate( p_axis, p_angle_degree )
func move_camera( p_translation ):
$model/ra/spring_arm/camera.translate( p_translation )
func reset_camera():
$model/ra/spring_arm.translation = Vector3( 0, 1.731, -1.74 )
$model/ra/spring_arm.rotation_degrees = Vector3( 0.0, 0.0, 0.0 )
$model/ra/spring_arm/camera.translation = Vector3( 0.0, 0.0, 0.0 )
$model/ra/spring_arm/camera.rotation_degrees = Vector3( -14, -178.1, 0.328 )