summaryrefslogtreecommitdiff
path: root/Runtime/mecanim/generic/typetraits.h
blob: 1f9aa2508f2419f88ce241ce63617e83e05ae3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once

#include "Runtime/mecanim/types.h"
#include "Runtime/Math/Simd/float4.h"
#include "Runtime/Math/Simd/xform.h"
#include "Runtime/Math/Simd/bool4.h"

namespace mecanim
{
	enum ValueType
	{
		kFloatType = 1,
		kInt32Type = 3,
		kBoolType = 4,
		kPositionType = 6,
		kQuaternionType = 7,
		kScaleType = 8,
		kTriggerType = 9,
		kLastType	
	};

	template<typename TYPE> struct traits;

	template<> struct traits<int32_t>
	{
		typedef int32_t value_type;

		static value_type zero() { return 0; }
		static ValueType type() { return kInt32Type; }
	};

	template<> struct traits<float>
	{
		typedef float value_type;

		static value_type zero() { return 0.f; }
		static ValueType type() { return kFloatType; }
	};

	template<> struct traits<bool>
	{
		typedef bool value_type;

		static value_type zero() { return false; }
		static ValueType type() { return kBoolType; }
	};
}