Wednesday, August 16, 2017

Vive Teleporter in C++ : Part 3

Vive Teleporter in C++ : Part 3

I have the teleport arc working in C++

Problem is that it doesn't collide with anything on the screen, only the static nav mesh that came with the example. I left that under my world construction so I can teleport around with the old code. My goal is to get rid of it so I'm going to need to change this...

From what I understand, there are collision channels. I need to put all my non-plant meshes in a custom collision channel and use that for detection. Or... at least that is the theory.

I think I am going to have to rip this code out of unreal and customize it at some point but if I can avoid that for a while I will.

....

Tracing this arc only seems to work for static meshes predefined in the level.

The trace logic is a black box to me. It leaves me no choice but to copy all the tracing logic into a utility class I control and start figuring wtf is going on here.

Unreal has no end to the pain it puts me through.

...

I think I have this figured out. I created a utility class and moved these 2 methods into it:
Blueprint_PredictProjectilePath_ByObjectType and PredictProjectilePath

I then altered PredictProjectilePath to force a channel trace instead of ObjectType trace.

That hit every mesh on the screen.

I then added a tag to each mesh.

Next came collision. I switched ground and walls to complex collision on the mesh.

For the teleport areas, they are planes and Unreal's collision mesh didn't work. I had to add a collision mesh for the teleport planes. Once I did this, the channel trace found it and identified the teleport areas.

Now it is just a matter of clean up and moving onto adding an end point that matches Valve's VR implementation.

I am getting occasional stutter, but I think it is the log spewing out too much info.

No comments:

Post a Comment