Automated: create new component page |
Add missing field, no longer component stub |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Stub}} | |||
{{Infobox Component | {{Infobox Component | ||
|Image=MeshUVRaycastPortalComponent.png | |Image=MeshUVRaycastPortalComponent.png | ||
|Name=Mesh UVRaycast Portal | |Name=Mesh UVRaycast Portal | ||
}} | }} | ||
This component allows users to interact with objects through a [[Component:Camera|camera]]. | |||
== Usage == | == Usage == | ||
{{Table ComponentFields | {{Table ComponentFields | ||
|Offset|Float| | |Offset|Float|How far back from the camera's actual view direction to project from | ||
|RayExit|IUVToRayConverter| | |RayExit|IUVToRayConverter|Usually a [[Component:Camera|camera]] | ||
|UVOffset|Float2| | |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| | |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| | |RepeatUV|Bool|Whether to repeat between the 0-1 range when the laser on the source hits a UV beyond 0-1 | ||
|OverrideHitTriggers|'''[[Type:Nullable`1|Nullable`1]]<[[Type:Bool|Bool]]>'''|TypeAdv5=true| | |OverrideHitTriggers|'''[[Type:Nullable`1|Nullable`1]]<[[Type:Bool|Bool]]>'''|TypeAdv5=true|Whether to hit colliders, requires Filter to have a sync delegate, but doesn't need to be enabled for this component to work | ||
|Filter|{{RootFieldType|SyncDelegate`1|[[Type:Func`3|Func`3]]<[[Type:ICollider|ICollider]], [[Type:Int|Int]], [[Type:Bool|Bool]]>}}|TypeAdv6=true| | |Filter|{{RootFieldType|SyncDelegate`1|[[Type:Func`3|Func`3]]<[[Type:ICollider|ICollider]], [[Type:Int|Int]], [[Type:Bool|Bool]]>}}|TypeAdv6=true|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| | |FilterMode|FilterCombineMode| how to use the <code>Filter</code> if provided. | ||
}} | }} | ||
== Behavior == | == 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 == | == Examples == | ||
To set up this component, you will need a [[Component:Camera|camera]]. One can easily be made by creating a new camera through the [[Dev Tool]]'s "Create New" menu. The camera component on the newly created object can be put on a new slot and set to the side. The box collider needs to be replaced 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. It works way more consistently in orthographic mode. | |||
== See Also == | == See Also == | ||
Line 25: | Line 35: | ||
[[Category:Components:Physics:Extensions{{#translation:}}|Mesh UVRaycast Portal]] | [[Category:Components:Physics:Extensions{{#translation:}}|Mesh UVRaycast Portal]] | ||
[[Category:Components{{#translation:}}|Mesh UVRaycast Portal]] | [[Category:Components{{#translation:}}|Mesh UVRaycast Portal]] | ||
Latest revision as of 14:43, 18 October 2024
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
Component image
This component allows users to interact with objects through a camera.
Usage
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 | how to use the Filter if provided.
|
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 Dev Tool's "Create New" menu. The camera component on the newly created object can be put on a new slot and set to the side. The box collider needs to be replaced 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. It works way more consistently in orthographic mode.