Class DistanceRelation
Inheritance
Inherited Members
Namespace: Unity.MARS.Conditions
Assembly: Unity.MARS.dll
Syntax
[MonoBehaviourComponentMenu(typeof(DistanceRelation), "Relation/Distance")]
[CreateFromDataOptions(2, false)]
[MovedFrom("Unity.MARS")]
public class DistanceRelation : BoundedFloatRelation<Pose>, ISimulatable, IRelation<Pose>, IRelation, IRelationBase, IConditionBase, IRequiresTraits<Pose>, IRequiresTraits, ICreateFromDataPair, IConfigurableMatchRating, IRangeBoundingOptions<float>, IRangeBoundingOptions, ISpatialCondition, IUsesCameraOffset, IFunctionalitySubscriber<IProvidesCameraOffset>, IFunctionalitySubscriber, IAdjustableComponent
Properties
Adjusting
Set to true when interactively adjusting this condition
Declaration
public bool Adjusting { get; set; }
Property Value
Type | Description |
---|---|
bool |
AxisMask
Defines which axes to use for the distance constraint
Declaration
public DistanceRelation.Axis AxisMask { get; set; }
Property Value
Type | Description |
---|---|
DistanceRelation.Axis |
provider
The functionality provider
Declaration
public IProvidesCameraOffset provider { get; set; }
Property Value
Type | Description |
---|---|
IProvidesCameraOffset |
Methods
FormatDataString(TraitDataSnapshot, TraitDataSnapshot)
Formats data into a string that is human-readable and appropriate for the relation
Declaration
public override string FormatDataString(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | child1Data | The data for child 1 |
TraitDataSnapshot | child2Data | The data for child 2 |
Returns
Type | Description |
---|---|
string | The formatted string |
Overrides
GetRequiredTraits()
Get the TraitRequirements that are required by this object
Declaration
public override TraitRequirement[] GetRequiredTraits()
Returns
Type | Description |
---|---|
TraitRequirement[] | The required traits |
Overrides
OnEnable()
Declaration
public void OnEnable()
OnRatingConfigChange()
Callback that runs after the rating configuration is set by code (not in the inspector)
Declaration
public override void OnRatingConfigChange()
Overrides
OnValidate()
Declaration
public override void OnValidate()
Overrides
OptimizeForData(TraitDataSnapshot, TraitDataSnapshot)
Modifies the properties so that the data is the optimal data for this relation
Declaration
public override void OptimizeForData(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | child1Data | The data that should be optimal for child 1 after this method is called |
TraitDataSnapshot | child2Data | The data that should be optimal for child 2 after this method is called |
Overrides
RateDataMatch(ref Pose, ref Pose)
Compares the given trait data to the filter function
Declaration
public override float RateDataMatch(ref Pose child1Data, ref Pose child2Data)
Parameters
Type | Name | Description |
---|---|---|
Pose | child1Data | The data being filtered against for the first child |
Pose | child2Data | The data being filtered against for the second child |
Returns
Type | Description |
---|---|
float | A number from 0 to 1 indicating how well a set of data matches |
Overrides
Reset()
Declaration
public override void Reset()
Overrides
Events
AdjustingChanged
Invoked when the adjusting state changes. Passes the new adjusting state.
Declaration
public event Action<bool> AdjustingChanged
Event Type
Type | Description |
---|---|
Action<bool> |