Component:SnapSphere

From Resonite Wiki
Revision as of 18:36, 29 February 2024 by 989onan (talk | contribs) (explain snap sphere, no longer stub)


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
Snap Sphere component as seen in the Scene Inspector


A snap sphere is a component that is able to generate a point in a sphere shape along the outer shell when given a point by another component. Usually this is used in components like the Multi User Avatar Anchor Component to determine where to place the anchors upon clicking (click point is used in such case)

How the snapper determines a point is as such: 2. the snapper component will reduce the distance from the provided point to the center of the snapper to a distance of 1. 3. It then takes the number and aligns it to the closest point on the shape. since this is a sphere snapper, it doesn't need this step. 4. the snapper will then multiply the normalized point by the snapper's size in all 3 axes, and then return the result.

The functionality of this component is internal, and cannot be used by ProtoFlux to snap points using in game code.

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.
Radius Float the radius of the sphere
SnapParent Slot where the objects to be snapped should go, if they are slots.

Usage

Used as an anchor point generator in the Multi User Avatar Anchor Component and other components.

Examples

Related Components