Component:MeshUVRaycastPortal

From Resonite Wiki
Revision as of 07:28, 16 March 2024 by 989onan (talk | contribs) (fix formatting)
Component image 
Mesh UVRaycast Portal component as seen in the Scene Inspector

Mesh uv raycast portal is a component that allows for the user to interact with objects through a camera.

Usage

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
Offset Float how far back from the camera's actual view direction to project from.
RayExit IUVToRayConverter Usually a camera.
UVOffset Float2 the added offset to the uv point you hit on the mesh before it's projected out. best to keep this (0,0) unless needed
UVScale Float2 the multiplied offset to the uv point you hit on the mesh before it's projected out. best to keep this (1,1) unless needed
RepeatUV Bool whether to repeat between the 0-1 range when the laser on the source hits a uv beyond 0-1
OverrideHitTriggers Nullable`1<Bool> whether to hit colliders, requires Filter to have a sync delegate, but doesn't need to be enabled for this component to work.
Filter Func`3<ICollider, Int, Bool> This is a field usually used by the dash manager in local space. Very hard to use, and is not required at all.
FilterMode FilterCombineMode This article or section is a Stub. You can help the Resonite Wiki by expanding it.

Behavior

- The camera needs to be in orthographic mode for best results. it still works in perspective but because of perspective warping it only works well in the center. This component is used for the dash, but can be utilized in real world space, allowing for some interesting effects.

- this component only works with mesh colliders. the type of mesh does not matter, since it uses the uvs the mesh triangles have to determine what point on the camera output to project the raycast out of.

- the mesh collider can only be a front sided collider for this component to work.

- only user interaction lasers are allowed to pass through, and only press button interactions

Examples

To set up this component, you will need a camera. One can easily be made by creating a new camera through the development tip create new menu. The camera component on the newly created object can be put on a new slot and set to the side. then replace the box collider with a mesh collider. The mesh collider will automatically use the quad mesh on the camera. now you are able to press buttons through the camera. works way more consistently in orthographic.

See Also