template the fields so they match all other collider pages |
Add missing mass field |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
* [[Component:MeshCollider|MeshCollider]]: Is the outside of the mesh of the object. | * [[Component:MeshCollider|MeshCollider]]: Is the outside of the mesh of the object. | ||
* [[Component:SphereCollider|SphereCollider]]: Has a radius for the sphere. | * [[Component:SphereCollider|SphereCollider]]: Has a radius for the sphere. | ||
* [[Component:TriangleCollider|TriangleCollider]]: Is a physical representation of a triangle poly. | |||
<!--T:3--> | <!--T:3--> | ||
Line 21: | Line 22: | ||
|Offset|Float3| {{Template:ColliderOffsetField}} | |Offset|Float3| {{Template:ColliderOffsetField}} | ||
|Type|ColliderType| {{Template:ColliderTypeField}} | |Type|ColliderType| {{Template:ColliderTypeField}} | ||
|Mass|Float|{{Template:ColliderMassField}} | |||
|CharacterCollider|Bool| {{Template:ColliderCharacterColliderField}} | |CharacterCollider|Bool| {{Template:ColliderCharacterColliderField}} | ||
|IgnoreRaycasts|Bool| {{Template:ColliderIgnoreRaycastsField}} | |IgnoreRaycasts|Bool| {{Template:ColliderIgnoreRaycastsField}} |
Latest revision as of 04:11, 6 November 2024
A Collider is a component that controls how a Slot interacts with other colliders. Colliders have shapes that determine the boundary of interaction, and the component is always of a particular shape:
- BoxCollider: Has an x, y, and z size.
- CapsuleCollider: Has a height and a radius for the semispherical endcaps.
- ConeCollider: Has a height and a radius for the circular end of the cone.
- ConvexHullCollider: Is a convex hull (a shape closely wrapping the object, but with no indentations) over the mesh of the object.
- CylinderCollider: Has a height and a radius for the circular endcaps.
- MeshCollider: Is the outside of the mesh of the object.
- SphereCollider: Has a radius for the sphere.
- TriangleCollider: Is a physical representation of a triangle poly.
Two colliders are said to be in collision when they intersect each other. Collision events can be detected through the On Contact Start, On Contact Stay, On Contact End ProtoFlux nodes, which take a Collider component. They then check the given Collider, and output an impulse along with the other Collider that triggered the collision.
Aside from the properties determining the shape of the collider, all colliders have the following properties:
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
|
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. |
Colliders also have a type which determines whether it interacts with other colliders:
Name | Value | Description |
---|---|---|
NoCollision
|
0 | As the name implies, no interaction happens. |
Static
|
1 | Interacts with other active colliders. |
Trigger
|
2 | Interacts with other active colliders and user locomotion. Trigger colliders also prevent the avatar's laser from hitting the collider's volume, regardless of the IgnoreRaycasts setting. |
StaticTrigger
|
3 | Behaves the same as Trigger except it is more performant for non-moving objects. |
StaticTriggerAuto
|
4 | Behaves the same as StaticTrigger, but will automatically switch to Trigger if the object moves. |
Active
|
5 | Interacts with other static and trigger colliders, user body parts, user locomotion, and users in anchors. Such colliders are called "active" because they actively check every single frame for collisions with other things. |
CharacterController
|
6 | This allows a CharacterController to use the specified collider as its collision for physics based interactions (only the first of this type in a slot with a CharacterController on it will be chosen). |
HapticTrigger
|
7 | This is used to detect and trigger haptics events on the player. |
HapticStaticTrigger
|
8 | This is the same as HapticTrigger except it is more performant for non-moving objects. |
HapticStaticTriggerAuto
|
9 | This is the same as HapticStaticTrigger, but will automatically switch to HapticTrigger if the object moves. |
HapticSampler
|
10 | This is used in conjunction with the HapticPointSampler component in order to sample haptics events from a HapticVolume for debug purposes. |
Note that active colliders do not cause collision events with other active collider types (possibly due to the computational costs involved).
MeshColliders are special cases. They only cause collision events with other primitive colliders (i.e. not other MeshColliders, again, possibly due to the computational costs involved), and the collision event fires only on the other collider.
Types of Collisions Table
V 0.2 | Static | Trigger | Active | No Collision |
---|---|---|---|---|
Static | X | X | ✓ | X |
Trigger | X | X | ✓ | X |
Active | ✓ | ✓ | X | X |
User Body Part | X | X | ✓ | X |
User Locomotion | X | ✓ | ✓ | X |
Mesh | X | X | X | X |
Mesh (active) | ✓ | ✓ | X | X |
User in Anchor | X | X | ✓ | X |
Note that if a user is in No Clip locomotion mode, it means the user will not cause collision events with anything. This can be useful for "ghosting" through a world without causing interactions with anything.