You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Added eye_height, changed description and fixed size of viewport issue
(cherry picked from commit e0b703e3fe)
This commit is contained in:
committed by
Rémi Verschelde
parent
95766f5a6a
commit
2020f43261
@@ -200,6 +200,9 @@ void MobileVRInterface::set_position_from_sensors() {
|
||||
};
|
||||
|
||||
void MobileVRInterface::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_eye_height", "eye_height"), &MobileVRInterface::set_eye_height);
|
||||
ClassDB::bind_method(D_METHOD("get_eye_height"), &MobileVRInterface::get_eye_height);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_iod", "iod"), &MobileVRInterface::set_iod);
|
||||
ClassDB::bind_method(D_METHOD("get_iod"), &MobileVRInterface::get_iod);
|
||||
|
||||
@@ -218,6 +221,7 @@ void MobileVRInterface::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_k2", "k"), &MobileVRInterface::set_k2);
|
||||
ClassDB::bind_method(D_METHOD("get_k2"), &MobileVRInterface::get_k2);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "eye_height", PROPERTY_HINT_RANGE, "0.0,3.0,0.1"), "set_eye_height", "get_eye_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "iod", PROPERTY_HINT_RANGE, "4.0,10.0,0.1"), "set_iod", "get_iod");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_width", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_width", "get_display_width");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "display_to_lens", PROPERTY_HINT_RANGE, "5.0,25.0,0.1"), "set_display_to_lens", "get_display_to_lens");
|
||||
@@ -226,6 +230,14 @@ void MobileVRInterface::_bind_methods() {
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "k2", PROPERTY_HINT_RANGE, "0.1,10.0,0.0001"), "set_k2", "get_k2");
|
||||
}
|
||||
|
||||
void MobileVRInterface::set_eye_height(const real_t p_eye_height) {
|
||||
eye_height = p_eye_height;
|
||||
}
|
||||
|
||||
real_t MobileVRInterface::get_eye_height() const {
|
||||
return eye_height;
|
||||
}
|
||||
|
||||
void MobileVRInterface::set_iod(const real_t p_iod) {
|
||||
intraocular_dist = p_iod;
|
||||
};
|
||||
@@ -328,6 +340,7 @@ Size2 MobileVRInterface::get_render_targetsize() {
|
||||
|
||||
// we use half our window size
|
||||
Size2 target_size = OS::get_singleton()->get_window_size();
|
||||
|
||||
target_size.x *= 0.5 * oversample;
|
||||
target_size.y *= oversample;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user