コード例 #1
0
ファイル: ChannelTypeV4.cs プロジェクト: zbx91/UtinyRipper
        public static ChannelType ToChannelType(this ChannelTypeV4 _this)
        {
            switch (_this)
            {
            case ChannelTypeV4.Vertex:
                return(ChannelType.Vertex);

            case ChannelTypeV4.Normal:
                return(ChannelType.Normal);

            case ChannelTypeV4.Color:
                return(ChannelType.Color4);

            case ChannelTypeV4.UV0:
                return(ChannelType.UV0);

            case ChannelTypeV4.UV1:
                return(ChannelType.UV1);

            case ChannelTypeV4.Tangent:
                return(ChannelType.Tangent);

            default:
                throw new Exception($"Unsupported channel type {_this}");
            }
        }
コード例 #2
0
        public static byte GetStride(this ChannelTypeV4 _this)
        {
            ChannelFormat format    = _this.GetFormat();
            int           dimention = _this.GetDimention();

            return(ChannelInfo.CalculateStride(format, dimention));
        }
コード例 #3
0
        public static byte GetDimention(this ChannelTypeV4 _this)
        {
            switch (_this)
            {
            case ChannelTypeV4.Vertex:
            case ChannelTypeV4.Normal:
                return(3);

            case ChannelTypeV4.Color:
                return(4);

            case ChannelTypeV4.UV0:
            case ChannelTypeV4.UV1:
                return(2);

            case ChannelTypeV4.Tangent:
                return(4);

            default:
                throw new Exception($"Unsupported channel type {_this}");
            }
        }
コード例 #4
0
        public static ChannelFormat GetFormat(this ChannelTypeV4 _this)
        {
            switch (_this)
            {
            case ChannelTypeV4.Vertex:
            case ChannelTypeV4.Normal:
                return(ChannelFormat.Float);

            case ChannelTypeV4.Color:
                return(ChannelFormat.Color);

            case ChannelTypeV4.UV0:
            case ChannelTypeV4.UV1:
                return(ChannelFormat.Float);

            case ChannelTypeV4.Tangent:
                return(ChannelFormat.Float);

            default:
                throw new Exception($"Unsupported channel type {_this}");
            }
        }
コード例 #5
0
 public bool IsMatch(ChannelTypeV4 channel)
 {
     return((ChannelMask & (1 << (int)channel)) != 0);
 }