Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAYSPACE bodypart for motion compensation #141

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions protocol/cpp/include/solarxr_protocol/generated/all_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,12 @@ enum class BodyPart : uint8_t {
UPPER_CHEST = 22,
LEFT_HIP = 23,
RIGHT_HIP = 24,
PLAYSPACE = 25,
MIN = NONE,
MAX = RIGHT_HIP
MAX = PLAYSPACE
};

inline const BodyPart (&EnumValuesBodyPart())[23] {
inline const BodyPart (&EnumValuesBodyPart())[24] {
static const BodyPart values[] = {
BodyPart::NONE,
BodyPart::HEAD,
Expand All @@ -605,13 +606,14 @@ inline const BodyPart (&EnumValuesBodyPart())[23] {
BodyPart::RIGHT_SHOULDER,
BodyPart::UPPER_CHEST,
BodyPart::LEFT_HIP,
BodyPart::RIGHT_HIP
BodyPart::RIGHT_HIP,
BodyPart::PLAYSPACE
};
return values;
}

inline const char * const *EnumNamesBodyPart() {
static const char * const names[26] = {
static const char * const names[27] = {
"NONE",
"HEAD",
"NECK",
Expand All @@ -637,13 +639,14 @@ inline const char * const *EnumNamesBodyPart() {
"UPPER_CHEST",
"LEFT_HIP",
"RIGHT_HIP",
"PLAYSPACE",
nullptr
};
return names;
}

inline const char *EnumNameBodyPart(BodyPart e) {
if (flatbuffers::IsOutRange(e, BodyPart::NONE, BodyPart::RIGHT_HIP)) return "";
if (flatbuffers::IsOutRange(e, BodyPart::NONE, BodyPart::PLAYSPACE)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesBodyPart()[index];
}
Expand Down
3 changes: 2 additions & 1 deletion protocol/java/src/solarxr_protocol/datatypes/BodyPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ private BodyPart() { }
public static final int UPPER_CHEST = 22;
public static final int LEFT_HIP = 23;
public static final int RIGHT_HIP = 24;
public static final int PLAYSPACE = 25;

public static final String[] names = { "NONE", "HEAD", "NECK", "CHEST", "WAIST", "HIP", "LEFT_UPPER_LEG", "RIGHT_UPPER_LEG", "LEFT_LOWER_LEG", "RIGHT_LOWER_LEG", "LEFT_FOOT", "RIGHT_FOOT", "", "", "LEFT_LOWER_ARM", "RIGHT_LOWER_ARM", "LEFT_UPPER_ARM", "RIGHT_UPPER_ARM", "LEFT_HAND", "RIGHT_HAND", "LEFT_SHOULDER", "RIGHT_SHOULDER", "UPPER_CHEST", "LEFT_HIP", "RIGHT_HIP", };
public static final String[] names = { "NONE", "HEAD", "NECK", "CHEST", "WAIST", "HIP", "LEFT_UPPER_LEG", "RIGHT_UPPER_LEG", "LEFT_LOWER_LEG", "RIGHT_LOWER_LEG", "LEFT_FOOT", "RIGHT_FOOT", "", "", "LEFT_LOWER_ARM", "RIGHT_LOWER_ARM", "LEFT_UPPER_ARM", "RIGHT_UPPER_ARM", "LEFT_HAND", "RIGHT_HAND", "LEFT_SHOULDER", "RIGHT_SHOULDER", "UPPER_CHEST", "LEFT_HIP", "RIGHT_HIP", "PLAYSPACE", };

public static String name(int e) { return names[e]; }
}
Expand Down
3 changes: 2 additions & 1 deletion protocol/kotlin/src/solarxr_protocol/datatypes/BodyPart.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class BodyPart private constructor() {
const val UPPERCHEST: UByte = 22u
const val LEFTHIP: UByte = 23u
const val RIGHTHIP: UByte = 24u
val names : Array<String> = arrayOf("NONE", "HEAD", "NECK", "CHEST", "WAIST", "HIP", "LEFT_UPPER_LEG", "RIGHT_UPPER_LEG", "LEFT_LOWER_LEG", "RIGHT_LOWER_LEG", "LEFT_FOOT", "RIGHT_FOOT", "", "", "LEFT_LOWER_ARM", "RIGHT_LOWER_ARM", "LEFT_UPPER_ARM", "RIGHT_UPPER_ARM", "LEFT_HAND", "RIGHT_HAND", "LEFT_SHOULDER", "RIGHT_SHOULDER", "UPPER_CHEST", "LEFT_HIP", "RIGHT_HIP")
const val PLAYSPACE: UByte = 25u
val names : Array<String> = arrayOf("NONE", "HEAD", "NECK", "CHEST", "WAIST", "HIP", "LEFT_UPPER_LEG", "RIGHT_UPPER_LEG", "LEFT_LOWER_LEG", "RIGHT_LOWER_LEG", "LEFT_FOOT", "RIGHT_FOOT", "", "", "LEFT_LOWER_ARM", "RIGHT_LOWER_ARM", "LEFT_UPPER_ARM", "RIGHT_UPPER_ARM", "LEFT_HAND", "RIGHT_HAND", "LEFT_SHOULDER", "RIGHT_SHOULDER", "UPPER_CHEST", "LEFT_HIP", "RIGHT_HIP", "PLAYSPACE")
@JvmStatic
fun name(e: Int) : String = names[e]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use super::*;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_BODY_PART: u8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_BODY_PART: u8 = 24;
pub const ENUM_MAX_BODY_PART: u8 = 25;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_BODY_PART: [BodyPart; 23] = [
pub const ENUM_VALUES_BODY_PART: [BodyPart; 24] = [
BodyPart::NONE,
BodyPart::HEAD,
BodyPart::NECK,
Expand All @@ -39,6 +39,7 @@ pub const ENUM_VALUES_BODY_PART: [BodyPart; 23] = [
BodyPart::UPPER_CHEST,
BodyPart::LEFT_HIP,
BodyPart::RIGHT_HIP,
BodyPart::PLAYSPACE,
];

/// Different parts of the body. Maps to each possible non-tracker bone in the skeleton.
Expand Down Expand Up @@ -71,9 +72,10 @@ impl BodyPart {
pub const UPPER_CHEST: Self = Self(22);
pub const LEFT_HIP: Self = Self(23);
pub const RIGHT_HIP: Self = Self(24);
pub const PLAYSPACE: Self = Self(25);

pub const ENUM_MIN: u8 = 0;
pub const ENUM_MAX: u8 = 24;
pub const ENUM_MAX: u8 = 25;
pub const ENUM_VALUES: &'static [Self] = &[
Self::NONE,
Self::HEAD,
Expand All @@ -98,6 +100,7 @@ impl BodyPart {
Self::UPPER_CHEST,
Self::LEFT_HIP,
Self::RIGHT_HIP,
Self::PLAYSPACE,
];
/// Returns the variant's name or "" if unknown.
pub fn variant_name(self) -> Option<&'static str> {
Expand Down Expand Up @@ -125,6 +128,7 @@ impl BodyPart {
Self::UPPER_CHEST => Some("UPPER_CHEST"),
Self::LEFT_HIP => Some("LEFT_HIP"),
Self::RIGHT_HIP => Some("RIGHT_HIP"),
Self::PLAYSPACE => Some("PLAYSPACE"),
_ => None,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export enum BodyPart {
RIGHT_SHOULDER = 21,
UPPER_CHEST = 22,
LEFT_HIP = 23,
RIGHT_HIP = 24
RIGHT_HIP = 24,
PLAYSPACE = 25
}
1 change: 1 addition & 0 deletions schema/datatypes/datatypes.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ enum BodyPart: uint8 {
UPPER_CHEST = 22,
LEFT_HIP = 23,
RIGHT_HIP = 24,
PLAYSPACE = 25,
}

enum TrackerStatus: uint8 {
Expand Down