TreeEditor.TreeGroup.GetRadiusAtTime C# (CSharp) Method

GetRadiusAtTime() public method

public GetRadiusAtTime ( TreeNode node, float t, bool includeModifications ) : float
node TreeNode
t float
includeModifications bool
return float
        public virtual float GetRadiusAtTime(TreeNode node, float t, bool includeModifications)
        {
            return 0f;
        }

Usage Example

Ejemplo n.º 1
0
        //
        // Computes the surface angle deviation, from the splines orientation.. Funky stuff!
        // ! In degrees !
        public float GetSurfaceAngleAtTime(float time)
        {
            if (spline == null)
            {
                return(0.0f);
            }
            float angle = 0.0f;

            Vector3 pos0 = spline.GetPositionAtTime(time);
            float   rad0 = group.GetRadiusAtTime(this, time, false);

            if (time < 0.5f)
            {
                float difPos = (spline.GetPositionAtTime(time + 0.01f) - pos0).magnitude;
                float difRad = group.GetRadiusAtTime(this, time + 0.01f, false) - rad0;
                angle = Mathf.Atan2(difRad, difPos);
            }
            else
            {
                float disPos = (pos0 - spline.GetPositionAtTime(time - 0.01f)).magnitude;
                float difRad = rad0 - group.GetRadiusAtTime(this, time - 0.01f, false);
                angle = Mathf.Atan2(difRad, disPos);
            }

            return(angle * Mathf.Rad2Deg);
        }
All Usage Examples Of TreeEditor.TreeGroup::GetRadiusAtTime