feat(client): add per-posture player height offset setting (#1121)

This commit is contained in:
moi952
2026-09-29 23:21:55 +02:00
committed by GitHub
parent a083901bdc
commit 85f6cb0bd9
8 changed files with 149 additions and 9 deletions
+18
View File
@@ -50,6 +50,12 @@ enum class feature
body_tracking,
};
enum class posture
{
standing,
seated,
};
class configuration
{
public:
@@ -128,10 +134,16 @@ public:
bool check_feature(feature f) const;
void set_feature(feature f, bool state);
static constexpr float default_height_offset_standing = 0;
static constexpr float default_height_offset_seated = 0.45;
private:
mutable std::mutex mutex;
std::map<feature, bool> features;
std::optional<float> stream_scale;
float height_offset_standing = default_height_offset_standing;
float height_offset_seated = default_height_offset_seated;
posture default_posture = posture::standing;
// table of scalar settings shared by save()/load(); non-scalar settings are explicit
static const std::vector<config_field> & config_fields();
@@ -146,6 +158,12 @@ public:
float get_stream_scale() const;
float get_default_stream_scale() const;
float get_height_offset() const;
void set_height_offset(float);
posture get_posture() const;
void set_posture(posture);
uint32_t max_bitrate(bool extended) const
{
return extended ? 800'000'000u : 200'000'000u;