Skip to content

Commit

Permalink
update text related snapshot (font update)
Browse files Browse the repository at this point in the history
fix avatar attach and collider attaching to player/camera
  • Loading branch information
leanmendoza committed Sep 26, 2024
1 parent cf123c1 commit dffaa33
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 23 deletions.
19 changes: 8 additions & 11 deletions godot/src/decentraland_components/avatar/avatar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ func _ready():
label_3d_name.billboard = billboard_mode

emote_controller = AvatarEmoteController.new(self, animation_player, animation_tree)
# TODO: uncomment this line before finishing bump to 4.3, FIX
# body_shape_skeleton_3d.bone_pose_changed.connect(self._attach_point_bone_pose_changed)
body_shape_skeleton_3d.skeleton_updated.connect(self._attach_point_skeleton_updated)

avatar_modifier_area_detector.set_avatar_modifier_area.connect(
self._on_set_avatar_modifier_area
Expand Down Expand Up @@ -528,15 +527,13 @@ func _add_attach_points():
left_hand_idx = body_shape_skeleton_3d.find_bone("Avatar_LeftHand")


func _attach_point_bone_pose_changed(bone_idx: int):
match bone_idx:
left_hand_idx:
left_hand_position = body_shape_skeleton_3d.get_bone_global_pose(bone_idx)
left_hand_position.basis = left_hand_position.basis.scaled(100.0 * Vector3.ONE)

right_hand_idx:
right_hand_position = body_shape_skeleton_3d.get_bone_global_pose(bone_idx)
right_hand_position.basis = right_hand_position.basis.scaled(100.0 * Vector3.ONE)
func _attach_point_skeleton_updated():
if left_hand_idx != -1:
left_hand_position = body_shape_skeleton_3d.get_bone_global_pose(left_hand_idx)
left_hand_position.basis = left_hand_position.basis.scaled(100.0 * Vector3.ONE)
if right_hand_idx != -1:
right_hand_position = body_shape_skeleton_3d.get_bone_global_pose(right_hand_idx)
right_hand_position.basis = right_hand_position.basis.scaled(100.0 * Vector3.ONE)


func _on_timer_hide_mic_timeout():
Expand Down
6 changes: 6 additions & 0 deletions godot/src/decentraland_components/player_collider_filter.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://b4tld1cqcvql5"]

[ext_resource type="Script" path="res://src/decentraland_components/player_collider_filter.gd" id="1_pn4dy"]

[node name="PlayerColliderFilter" type="Node"]
script = ExtResource("1_pn4dy")
2 changes: 1 addition & 1 deletion lib/src/avatars/avatar_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl AvatarScene {
}

#[func]
pub fn on_scene_spawned(&mut self) {
pub fn on_scene_spawned(&mut self, _scene_id: i32, _entity_id: GString) {
for (_, avatar) in self.avatar_godot_scene.iter_mut() {
avatar.bind_mut().on_parcel_scenes_changed();
}
Expand Down
22 changes: 11 additions & 11 deletions lib/src/scene_runner/godot_dcl_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,20 @@ impl GodotDclScene {

let godot_entity_node = self.entities.get_mut(entity).unwrap();
if godot_entity_node.base_3d.is_none() {
let new_node_3d = DclNodeEntity3d::new_alloc(*entity);
let mut new_node_3d = DclNodeEntity3d::new_alloc(*entity);
self.root_node_3d.add_child(new_node_3d.clone().upcast());

if entity == &SceneEntityId::PLAYER || entity == &SceneEntityId::CAMERA {
// TODO FIXME loading script and instantiate to cast to Node

// let mut player_collider_filter = godot::engine::load::<Script>(
// "res://src/decentraland_components/player_collider_filter.gd",
// )
// .cast::<Node>();
// player_collider_filter.set_name("PlayerColliderFilter".into());

// new_node_3d.add_child(player_collider_filter.clone());
// player_collider_filter.call("init_player_collider_filter".into(), &[]);
let mut player_collider_filter = godot::engine::load::<PackedScene>(
"res://src/decentraland_components/player_collider_filter.tscn",
)
.instantiate()
.expect("player_collider_filter scene is valid")
.cast::<Node>();
player_collider_filter.set_name("PlayerColliderFilter".into());

new_node_3d.add_child(player_collider_filter.clone());
player_collider_filter.call("init_player_collider_filter".into(), &[]);
}
godot_entity_node.base_3d = Some(new_node_3d.upcast());
}
Expand Down
Binary file modified tests/snapshots/screenshot_godot_snapshot_text_shape_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/screenshot_godot_snapshot_text_shape_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/screenshot_godot_snapshot_text_shape_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/screenshot_godot_snapshot_text_shape_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/screenshot_godot_snapshot_text_shape_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/screenshot_godot_snapshot_ui_text_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/screenshot_godot_snapshot_ui_text_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dffaa33

Please sign in to comment.