﻿using UnityEngine;

namespace pdinklag.CPW.Common
{
    /// <summary>
    /// Component for body parts approximated by a cylinder.
    /// </summary>
    public class BodyPartCylinder : BodyPartCylindrical
    {
        public override float Volume { get { return Mathf.PI * Height * (Radius * Radius); } }

#if UNITY_EDITOR
        private void OnDrawGizmos()
        {
            var p = transform.position;
            var ext = 0.5f * Height * transform.up;
            DebugExtension.DrawCylinder(p - ext, p + ext, GizmoColor, Radius);
        }
#endif
    }
}
