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

How to block axis-movement? #5

Closed
Mateo150 opened this issue Jun 27, 2023 · 2 comments
Closed

How to block axis-movement? #5

Mateo150 opened this issue Jun 27, 2023 · 2 comments

Comments

@Mateo150
Copy link

Mateo150 commented Jun 27, 2023

Hi Vanruesc,

First to all, thanks for this helpful controls.
Now, I'm trying to implement this as a first person camera controls, but when I try to "walk" forward while I'm looking the down, the camera goes down and ends up getting inside the floor.
For example, in Cannon-es, we can apply something called "factor" to the "movement" as a vector3: LinearFactor
This concept applied to spatial, settings.translation.factor.set(1,0,1) wich means the movement is blocked in Y axis... giving the effect I'm trying to reach. Is like 'Sensitivity' here but giving the option to be more especific.
Idk, this can be an improvement for Sensitivity.

Is that possible here?

vanruesc added a commit that referenced this issue Jun 30, 2023
Implement constraints and axisWeights, fix iOS and normalize translation speed. Addresses #5
@vanruesc
Copy link
Owner

Thanks for the suggestion!

I've added settings.translation.axisWeights in spatial-controls@6.1.0 which should do the trick.

@vanruesc
Copy link
Owner

Related: #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants