Vector Field
Axel Fougues
$4.99
(no ratings)
Date |
Price |
---|---|
日期和时间 |
价钱($) |
09/17(2024) |
4.99 |
11/27(2024) |
4.99 |
Jump AssetStore
Create vector fields visually in-editor with a super simple and modifiable setup. You can then sample the fields at any point to get direction, magnitude, and strength. No runtime visuals.Uses standard gizmos, no specific rendering pipeline is needed.Create simple fields with a single, straightforward component.An empty parent holds the component. Add children transforms as vectors and move them around to shape the field.Fields can change at runtime.Cool gizmos are provided in the scene view to help visualize your fields.This asset has two modes:Standard vector field with a direction and magnitudeSimple strength field with a single strength valueBoth can be combined and used at the same time.Instructions:To create a vector field:- Create an empty GameObject- Add the VectorField component- Add children to the object. Their transforms will be used as vectors.- Adjust the Distance multiplier and power to achieve the required result.- Use the provided gizmos to visualize your field.To sample your field://Get the angle between a Transform and the local fieldpublic float sampleAlignement(Vector3 position, Quaternion rotation);public float sampleAlignementNormalized(Vector3 position, Quaternion rotation);public float sampleAlignement(Transform transform);public float sampleAlignementNormalized(Transform transform);//Get the direction (and magnitude) of the field at a pointpublic Vector3 getDirection(Vector3 point);public Vector3 getDirection(Transform transform);public Vector3 getDirectionNormalized(Transform transform);public Vector3 getDirectionNormalized(Vector3 point);//Get the strength of a field at a pointpublic float getStrength(Vector3 point);public float getStrength(Transform transform);public float getStrengthNormalized(Transform transform);public float getStrengthNormalized(Vector3 point);