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

[master] How to draw a ray for the CK controller #1277

Closed
erichfrazer opened this issue Oct 31, 2017 · 8 comments
Closed

[master] How to draw a ray for the CK controller #1277

erichfrazer opened this issue Oct 31, 2017 · 8 comments

Comments

@erichfrazer
Copy link

This is silly question, I'm a bit new to Unity...

I want to draw a ray from the CK controller out into the scene where it's pointing. I reckon I can get the ray start/stop points, but how to draw the actual ray? I'm thinking of using a mostly-transparent cylinder that tapers to a point, and using scaling to modify its length. Is there a better way to do this? Anybody working on some proto-code for a ray drawer that they can share? or, is it already in the toolkit, and I haven't seen it?

@StephenHodgson
Copy link
Contributor

If you're in the editor you can use the debug draw pointing ray on the FocusManager.
image

Otherwise you might have to implement yourself. I'm not sure we have anything in the toolkit for that yet.

@keveleigh
Copy link
Contributor

@erichfrazer
Copy link
Author

Oh, nice. I'll look there. thanks.

@erichfrazer
Copy link
Author

erichfrazer commented Oct 31, 2017 via email

@StephenHodgson
Copy link
Contributor

StephenHodgson commented Oct 31, 2017

There's been some talk of it. Also, I think the MRDL merge will include these types of things. (See Kevs comment above)

@Alexees
Copy link
Contributor

Alexees commented Nov 1, 2017

@keveleigh What's the difference between Microsoft/MixedRealityToolkit-Unity and Microsoft/MixedReality250 where your code examples come from. Cause it seems to also fix the problem with update inconsistencies between controller data and controller visual positions by removing the need for onBeforeRender, which I had trouble with implementing my own ray last week.

@keveleigh
Copy link
Contributor

It doesn't remove the need for onBeforeRender, it has an older drop of the Toolkit. The older drop does it wrong according to the guidance I've been given by our platform team, which prompted the script update. Polling in onBeforeRender is the correct way to get the controller info for rendering, while polling in Update or using the InteractionManager events is the correct way to get the controller info for game logic. I'm planning on updating the cursor and pointing ray rendering to fit these new guidelines when I get the time.

@erichfrazer
Copy link
Author

erichfrazer commented Nov 1, 2017 via email

@david-c-kline david-c-kline changed the title How to draw a ray for the CK controller [master] How to draw a ray for the CK controller Mar 22, 2018
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

5 participants