// Init //-------------------------------------------- public apOptCalculatedResultParam(apCalculatedResultParam.CALCULATED_VALUE_TYPE calculatedValueType, apCalculatedResultParam.CALCULATED_SPACE calculatedSpace, apOptModifierUnitBase linkedModifier, apOptTransform targetOptTranform, apOptMesh targetOptMesh, apOptBone targetBone, //<<추가 apOptParamSetGroupVertWeight weightedVertData) { _calculatedValueType = calculatedValueType; _calculatedSpace = calculatedSpace; //TODO 여기서부터 작업하자 _linkedModifier = linkedModifier; _targetOptTransform = targetOptTranform; _targetOptMesh = targetOptMesh; _targetBone = targetBone; //<<추가 _weightedVertexData = weightedVertData; //Vertex 데이터가 들어간 경우 Vert 리스트를 만들어주자 if ((int)(_calculatedValueType & apCalculatedResultParam.CALCULATED_VALUE_TYPE.VertexPos) != 0) { int nPos = 0; if (_targetOptMesh.LocalVertPositions != null) { nPos = _targetOptMesh.LocalVertPositions.Length; } _result_Positions = new List <Vector2>(); _tmp_Positions = new List <Vector2>(); for (int i = 0; i < nPos; i++) { _result_Positions.Add(Vector2.zero); _tmp_Positions.Add(Vector2.zero); } } }
// Init //-------------------------------------------- public apOptCalculatedResultParam(apCalculatedResultParam.CALCULATED_VALUE_TYPE calculatedValueType, apCalculatedResultParam.CALCULATED_SPACE calculatedSpace, apOptModifierUnitBase linkedModifier, apOptTransform targetOptTranform, apOptTransform ownerOptTranform, apOptMesh targetOptMesh, apOptBone targetBone, //<<추가 apOptParamSetGroupVertWeight weightedVertData) { _calculatedValueType = calculatedValueType; _calculatedSpace = calculatedSpace; //TODO 여기서부터 작업하자 _linkedModifier = linkedModifier; _targetOptTransform = targetOptTranform; _ownerOptTransform = ownerOptTranform; _targetOptMesh = targetOptMesh; _targetBone = targetBone; //<<추가 _paramKeyValues.Clear(); _subParamKeyValueList.Clear(); _weightedVertexData = weightedVertData; _isVertexLocalMorph = false; _isVertexRigging = false; //Vertex 데이터가 들어간 경우 Vert 리스트를 만들어주자 if ((int)(_calculatedValueType & apCalculatedResultParam.CALCULATED_VALUE_TYPE.VertexPos) != 0) { int nPos = 0; if (_targetOptMesh.LocalVertPositions != null) { nPos = _targetOptMesh.LocalVertPositions.Length; } _result_Positions = new Vector2[nPos]; _tmp_Positions = new Vector2[nPos]; for (int i = 0; i < nPos; i++) { _result_Positions[i] = Vector2.zero; _tmp_Positions[i] = Vector2.zero; } if (_linkedModifier._modifierType == apModifierBase.MODIFIER_TYPE.Rigging) { _result_VertMatrices = new apMatrix3x3[nPos]; _tmp_VertMatrices = new apMatrix3x3[nPos]; for (int i = 0; i < nPos; i++) { _result_VertMatrices[i].SetIdentity(); _tmp_VertMatrices[i].SetIdentity(); } } //if(_linkedModifier._modifierType == apModifierBase.MODIFIER_TYPE.Morph || // _linkedModifier._modifierType == apModifierBase.MODIFIER_TYPE.AnimatedMorph) //{ // //최적화를 위한 VertLocalPair를 만든다. 개수는 ParamSetGroup 만큼 // _result_VertLocalPairs = new apOptVertexRequest[_linkedModifier._paramSetGroupList.Count]; // for (int iVLP = 0; iVLP < _result_VertLocalPairs.Length; iVLP++) // { // apOptVertexRequest newRequest = new apOptVertexRequest(); // newRequest.InitVertLocalPair(_linkedModifier._paramSetGroupList[iVLP]); // _result_VertLocalPairs[iVLP] = newRequest; // } //} if (_linkedModifier._modifierType == apModifierBase.MODIFIER_TYPE.AnimatedMorph || _linkedModifier._modifierType == apModifierBase.MODIFIER_TYPE.Morph) { _isVertexLocalMorph = true; } else if (_linkedModifier._modifierType == apModifierBase.MODIFIER_TYPE.Rigging) { _isVertexRigging = true; } } }