Compare commits

...

3 Commits

Author SHA1 Message Date
39b9e6039c set firstperson model invisible 2024-08-24 16:00:16 +02:00
da8232f62b fixed jump 2024-08-24 15:54:23 +02:00
ed771ad861 upload ressources and remove old player 2024-08-24 15:18:07 +02:00
15 changed files with 871 additions and 7550 deletions

1
.gitattributes vendored
View File

@@ -2,3 +2,4 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text
*.res filter=lfs diff=lfs merge=lfs -text

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -58,6 +58,8 @@ void FirstPersonPlayer::_ready() {
m_Head->add_child(m_Camera);
m_Camera->make_current();
SetModelVisible(false);
SetPosition({0, 100, 0});
SetVelocity({0, 0, 0});
}

View File

@@ -3,6 +3,8 @@
#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/input.hpp>
#include <godot_cpp/classes/input_map.hpp>
#include <godot_cpp/classes/mesh_instance3d.hpp>
#include <godot_cpp/classes/skeleton3d.hpp>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
@@ -98,7 +100,14 @@ void Player::BlendAnimation(const godot::String& a_AnimationName, float a_Goal,
a_AnimationName, UtilityFunctions::lerp(m_AnimationTree->get(a_AnimationName), a_Goal, a_Delta * AnimationBlend));
}
void Player::SetModelVisible(bool visible) {}
void Player::SetModelVisible(bool a_Visible) {
auto* skeleton = m_Mesh->get_node<Skeleton3D>("Skeleton3D");
for (int i = 0; i < skeleton->get_child_count(); i++) {
auto* bodyPart = Object::cast_to<MeshInstance3D>(skeleton->get_child(i));
bodyPart->set_cast_shadows_setting(a_Visible ? GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_ON
: GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_SHADOWS_ONLY);
}
}
Vector3 Player::GetCameraRotation() const {
return m_Player->get_rotation();