summaryrefslogtreecommitdiff
path: root/Runtime/Animation/BoundCurveDeprecated.h
blob: 0edc24e2d1b8bf11596108b5c58cb83aa8940c44 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once


struct BoundCurveDeprecated
{
	int     targetInstanceID;
	
	// The ptr to the data we are writing into
	void*   targetPtr; 
	
	// type of the data we will write into kBindFloatValue, kBindQuaternion etc.
	// - Materials:  4 bits targetType, 24 bits shader property name, 4 bits sub property index (x, y, z, w)
	// - SkinnedMeshRenderer: 4 bits targetType, the rest BlendShape weight index
	UInt32  targetType;
	
	// Which states affect the bound curve?
	UInt32  affectedStateMask; 
	
	Object* targetObject;
	
	BoundCurveDeprecated () { targetObject = NULL; targetType = 0; targetInstanceID = 0; targetPtr = 0; affectedStateMask = 0; }
	
	enum
	{
		kBindTypeBitCount = 4,
		kBindMaterialShaderPropertyNameBitCount = 24,

		kBindTypeMask = (1 << kBindTypeBitCount) - 1,
		kBindMaterialShaderPropertyNameMask = ((1 << kBindMaterialShaderPropertyNameBitCount) - 1) << kBindTypeBitCount,
		kBindMaterialShaderSubpropertyMask = ~(kBindTypeMask | kBindMaterialShaderPropertyNameMask),
	};
};

enum
{
	kUnbound = 0,
	kBindTransformPosition = 1, // This enum may not be changed. It is used in GenericClipBinding.
	kBindTransformRotation = 2, // This enum may not be changed.  It is used in GenericClipBinding.
	kBindTransformScale = 3,    //  It is used in GenericClipBinding.
	kMinGenericBinding = 4,

	kBindFloat,
	kBindFloatToBool,
	kBindFloatToBlendShapeWeight,
	kBindFloatToGameObjectActivate,
	
	kMinIntCurveBinding,
	kBindMaterialPPtrToRenderer = kMinIntCurveBinding,
#if ENABLE_SPRITES
	kBindSpritePPtrToSpriteRenderer,
#endif
	kMaxIntCurveBinding,

	// These must always come last since materials do special bit masking magic.
	kBindFloatToMaterial = kMaxIntCurveBinding,
	kBindFloatToColorMaterial,
	kBindFloatToMaterialScaleAndOffset,
	
	kBindTypeCount
};