Component:MeshCollider: Difference between revisions

From Resonite Wiki
Automated: update SyncDelegates
add danger and sync delegate descriptions
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
|Name=Mesh Collider
|Name=Mesh Collider
}}
}}
A mesh collider allows for making a 1:1 collider of the given <code>Mesh</code>
A mesh collider allows for making a 1:1 collider of the given <code>Mesh</code>.
 
{{Note|Too many polygons colliding with a single collider at once can cause immense frame rate drops. Make sure the geometry on a given mesh collider is not concentrated in a small spot or too dense to avoid this!|danger}}


<!--T:2-->
<!--T:2-->
Line 23: Line 25:
== Sync Delegates ==
== Sync Delegates ==
{{Table ComponentTriggers
{{Table ComponentTriggers
|ConvexDecomposition[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true|
|ConvexDecomposition:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when the create convex hull decomposition button is touched.
|ReplaceWithBox[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true|
|ReplaceWithBox:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when the replace with box collider button is touched.
}}
}}


Line 36: Line 38:


<!--T:5-->
<!--T:5-->
== Related Components ==
== See Also ==
</translate>
</translate>
[[Category:Components{{#translation:}}|Mesh Collider]]
[[Category:Components{{#translation:}}|Mesh Collider]]
[[Category:Components:Physics:Colliders{{#translation:}}|Mesh Collider]]
[[Category:Components:Physics:Colliders{{#translation:}}|Mesh Collider]]

Latest revision as of 20:33, 7 April 2025

Component image 
Mesh Collider component as seen in the Scene Inspector

A mesh collider allows for making a 1:1 collider of the given Mesh.

Too many polygons colliding with a single collider at once can cause immense frame rate drops. Make sure the geometry on a given mesh collider is not concentrated in a small spot or too dense to avoid this!

Fields

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. Some components stop their functionality when this field is disabled, but some don't.
Offset Float3 The offset of the collider shape's position from the slot's position.
Type ColliderType The type of collider. See the enum page for details.
Mass Float How heavy this collider is in total. according to ProbablePrime this is in 1 KG per cubic meter.
CharacterCollider Bool Whether an avatar should be prevented from moving into the collider's volume.
IgnoreRaycasts Bool Whether an avatar's laser should be prevented from hitting the collider's volume. Also this applies to raycasting nodes or components.
Mesh Mesh The mesh to make a collision shape made of groups of polygons out of.
Sidedness MeshColliderSidedness Front or back sided collisions.
ActualSpeculativeMargin raw output of Float Essentially the room for error on the collisions for this collider.

Sync Delegates

Triggers
Method Name Method type and Arguments. Is the method hidden? Description
ConvexDecomposition:ButtonEventHandler ButtonEventHandler Called when the create convex hull decomposition button is touched.
ReplaceWithBox:ButtonEventHandler ButtonEventHandler Called when the replace with box collider button is touched.

Usage

General practice is to use mesh colliders very sparingly.

Examples

This can be used for more complex collisions like sprawling terrain or procedural meshes that have complex shapes.

See Also