|
|
|
|
|
|
[Serializable] |
|
|
|
public class InfluenceVolume |
|
|
|
{ |
|
|
|
HDProbe probe; |
|
|
|
HDProbe m_Probe; |
|
|
|
|
|
|
|
[SerializeField, FormerlySerializedAs("m_ShapeType")] |
|
|
|
InfluenceShape m_Shape = InfluenceShape.Box; |
|
|
|
|
|
|
[SerializeField, FormerlySerializedAs("m_SphereInfluenceNormalFade")] |
|
|
|
float m_SphereBlendNormalDistance; |
|
|
|
|
|
|
|
internal void CopyTo(InfluenceVolume data) |
|
|
|
{ |
|
|
|
//keep the m_Probe as it is used to reset the probe
|
|
|
|
|
|
|
|
data.m_Shape = m_Shape; |
|
|
|
data.m_Offset = m_Offset; |
|
|
|
data.m_BoxSize = m_BoxSize; |
|
|
|
data.m_BoxBlendDistancePositive = m_BoxBlendDistancePositive; |
|
|
|
data.m_BoxBlendDistanceNegative = m_BoxBlendDistanceNegative; |
|
|
|
data.m_BoxBlendNormalDistancePositive = m_BoxBlendNormalDistancePositive; |
|
|
|
data.m_BoxBlendNormalDistanceNegative = m_BoxBlendNormalDistanceNegative; |
|
|
|
data.m_BoxSideFadePositive = m_BoxSideFadePositive; |
|
|
|
data.m_BoxSideFadeNegative = m_BoxSideFadeNegative; |
|
|
|
data.m_SphereRadius = m_SphereRadius; |
|
|
|
data.m_SphereBlendDistance = m_SphereBlendDistance; |
|
|
|
data.m_SphereBlendNormalDistance = m_SphereBlendNormalDistance; |
|
|
|
|
|
|
|
data.m_EditorAdvancedModeBlendDistancePositive = m_EditorAdvancedModeBlendDistancePositive; |
|
|
|
data.m_EditorAdvancedModeBlendDistanceNegative = m_EditorAdvancedModeBlendDistanceNegative; |
|
|
|
data.m_EditorSimplifiedModeBlendDistance = m_EditorSimplifiedModeBlendDistance; |
|
|
|
data.m_EditorAdvancedModeBlendNormalDistancePositive = m_EditorAdvancedModeBlendNormalDistancePositive; |
|
|
|
data.m_EditorAdvancedModeBlendNormalDistanceNegative = m_EditorAdvancedModeBlendNormalDistanceNegative; |
|
|
|
data.m_EditorSimplifiedModeBlendNormalDistance = m_EditorSimplifiedModeBlendNormalDistance; |
|
|
|
data.m_EditorAdvancedModeEnabled = m_EditorAdvancedModeEnabled; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>Shape of this InfluenceVolume.</summary>
|
|
|
|
public InfluenceShape shape |
|
|
|
{ |
|
|
|
|
|
|
switch (m_Shape) |
|
|
|
{ |
|
|
|
case InfluenceShape.Box: |
|
|
|
probe.UpdatedInfluenceVolumeShape(m_BoxSize, offset); |
|
|
|
m_Probe.UpdatedInfluenceVolumeShape(m_BoxSize, offset); |
|
|
|
probe.UpdatedInfluenceVolumeShape(Vector3.one * (2 * m_SphereRadius), offset); |
|
|
|
m_Probe.UpdatedInfluenceVolumeShape(Vector3.one * (2 * m_SphereRadius), offset); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
set |
|
|
|
{ |
|
|
|
m_BoxSize = value; |
|
|
|
probe.UpdatedInfluenceVolumeShape(m_BoxSize, offset); |
|
|
|
m_Probe.UpdatedInfluenceVolumeShape(m_BoxSize, offset); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
set |
|
|
|
{ |
|
|
|
m_SphereRadius = value; |
|
|
|
probe.UpdatedInfluenceVolumeShape(Vector3.one * (2 * m_SphereRadius), offset); |
|
|
|
m_Probe.UpdatedInfluenceVolumeShape(Vector3.one * (2 * m_SphereRadius), offset); |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
|
|
|
/// Value between 0 (on InfluenceVolume hull) and sphereRadius (fade sub volume reduced to a point).
|
|
|
|
/// </summary>
|
|
|
|
public float sphereBlendNormalDistance { get { return m_SphereBlendNormalDistance; } set { m_SphereBlendNormalDistance = value; } } |
|
|
|
|
|
|
|
|
|
|
|
this.probe = probe; |
|
|
|
this.m_Probe = probe; |
|
|
|
} |
|
|
|
|
|
|
|
internal BoundingSphere GetBoundingSphereAt(Transform probeTransform) |
|
|
|