Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Fixing worldscale for controllers #105

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

BastiaanOlij
Copy link
Member

Changing scale of controllers based on worldscale and removing the double applying of worldscale to the tracking.

Haven't looked at hand tracking yet and still downloading SDK so I can test (had to reinstall my PC few weeks back, bah)

fixes #103

@BastiaanOlij BastiaanOlij requested a review from NeoSpark314 May 19, 2020 10:11
@BastiaanOlij BastiaanOlij force-pushed the fix_worldscale_controllers branch from d5bca2f to 39a3c01 Compare May 19, 2020 10:38
@NeoSpark314
Copy link
Collaborator

Just tried it. Position fix seems to work as intended. But the controller scale is probably Inverse. A world scale of 4.0 makes the player 4.0 larger...:

image

@NeoSpark314
Copy link
Collaborator

ups; posted in the wrong issue before; with the inverse scale size is correct; but it breaks the current setup of getting the right controller mesh by having a negative scale for the right controller:

image

func _check_worldscale():
if was_world_scale != world_scale:
was_world_scale = world_scale
var inv_world_scale = 1.0 / was_world_scale
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as posted in the comment section earlier; this does not need to be inverse as the "world scale" seems to make the player larger.

var inv_world_scale = 1.0 / was_world_scale
var controller_scale = Vector3(inv_world_scale, inv_world_scale, inv_world_scale)
$"LeftTouchController/left-controller".scale = controller_scale
$"RightTouchController/right-controller".scale = controller_scale
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe here we would need a -controller_scale as the right controller is just a mirrored mesh of the left controller in the demo setup

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, my gut feeling says that minusing the scale isn't a very nice solution, then again this is a script very specific to this setup so I'll make that change.

@m4gr3d
Copy link
Collaborator

m4gr3d commented Jun 23, 2020

@BastiaanOlij Any updates on this PR?
We'll release version 2.0 of the plugin to match Godot v3.2.2 release, so it'd be nice to have this fix included as part of the release.

@BastiaanOlij BastiaanOlij force-pushed the fix_worldscale_controllers branch from 39a3c01 to 98ff9dd Compare June 27, 2020 04:03
@m4gr3d m4gr3d merged commit 31666f0 into GodotVR:master Jun 29, 2020
@m4gr3d m4gr3d added this to the 2.0.0 milestone Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The controller positions do not handle world_scale correctly
3 participants