Beispiel #1
0
        // Link
        //---------------------------------------------------------------------------------
        public void Link(apPortrait portrait)
        {
            _portrait = portrait;

            if (IsVertex)
            {
                apOptModifiedMesh_Vertex sub_Vertex = SubModMesh_Vertex;
                if (sub_Vertex != null)
                {
                    sub_Vertex.Link(this);
                }
            }

            if (IsTransform)
            {
                apOptModifiedMesh_Transform sub_Transform = SubModMesh_Transform;
                if (sub_Transform != null)
                {
                    sub_Transform.Link(this);
                }
            }

            if (IsRigging)
            {
                apOptModifiedMesh_VertexRig sub_Rigging = SubModMesh_Rigging;
                if (sub_Rigging != null)
                {
                    sub_Rigging.Link(portrait, this);
                }
            }

            if (IsPhysics)
            {
                apOptModifiedMesh_Physics sub_Physics = SubModMesh_Physics;
                if (sub_Physics != null)
                {
                    sub_Physics.Link(portrait, this);
                }
            }

            if (IsColor)
            {
                apOptModifiedMesh_Color sub_Color = SubModMesh_Color;
                if (sub_Color != null)
                {
                    sub_Color.Link(this);
                }
            }

            if (IsExtra)
            {
                apOptModifiedMesh_Extra sub_Extra = SubModMesh_Extra;
                if (sub_Extra != null)
                {
                    sub_Extra.Link(portrait, this);
                }
            }
        }
Beispiel #2
0
        public void Bake_Transform(apMatrix transformMatrix)
        {
            _dataType |= DATA_TYPE.Transform;

            _subModMesh_Transform    = new apOptModifiedMesh_Transform[1];
            _subModMesh_Transform[0] = new apOptModifiedMesh_Transform();
            apOptModifiedMesh_Transform subMod_Transform = _subModMesh_Transform[0];

            subMod_Transform.Bake(transformMatrix);
        }
Beispiel #3
0
            /// <summary>
            /// Keyframe에 Rotation Bias 설정이 있는 경우 관련 변수를 갱신한다.
            /// </summary>
            /// <param name="rotationBias"></param>
            /// <param name="rotationCount"></param>
            public void SetAnimRotationBias(apAnimKeyframe.ROTATION_BIAS rotationBias, int rotationCount)
            {
                if (rotationBias == apAnimKeyframe.ROTATION_BIAS.CW)
                {
                    _isAnimRotationBias    = true;
                    _animRotationBiasAngle = -360 * rotationCount;
                }
                else if (rotationBias == apAnimKeyframe.ROTATION_BIAS.CCW)
                {
                    _isAnimRotationBias    = true;
                    _animRotationBiasAngle = 360 * rotationCount;
                }
                else
                {
                    _isAnimRotationBias    = false;
                    _animRotationBiasAngle = 0;
                }
                if (_animRotationBiasAngle_Prev != _animRotationBiasAngle && _isAnimRotationBias)
                {
                    if (_animRotationBiasedMatrix == null)
                    {
                        _animRotationBiasedMatrix = new apMatrix();
                    }

                    if (_modifiedMesh != null)
                    {
                        _animRotationBiasedMatrix.SetTRS(
                            _modifiedMesh._transformMatrix._pos,
                            _modifiedMesh._transformMatrix._angleDeg + _animRotationBiasAngle,
                            _modifiedMesh._transformMatrix._scale
                            );
                    }
                    else if (_modifiedMeshSet != null)
                    {
                        //추가됨 19.5.24 : ModMeshSet으로 계산하기
                        _subModMesh_Transform = _modifiedMeshSet.SubModMesh_Transform;
                        if (_subModMesh_Transform != null)
                        {
                            _animRotationBiasedMatrix.SetTRS(
                                _subModMesh_Transform._transformMatrix._pos,
                                _subModMesh_Transform._transformMatrix._angleDeg + _animRotationBiasAngle,
                                _subModMesh_Transform._transformMatrix._scale
                                );
                        }
                        else
                        {
                            Debug.LogError("TODO : 에러 : 애니메이션에 SubModMeshSet_Transform이 없다.");
                            _animRotationBiasedMatrix.SetIdentity();
                        }
                    }
                    else if (_modifiedBone != null)
                    {
                        _animRotationBiasedMatrix.SetTRS(
                            _modifiedBone._transformMatrix._pos,
                            _modifiedBone._transformMatrix._angleDeg + _animRotationBiasAngle,
                            _modifiedBone._transformMatrix._scale
                            );
                    }
                    else
                    {
                        _animRotationBiasedMatrix.SetIdentity();
                    }

                    _animRotationBiasAngle_Prev = _animRotationBiasAngle;
                }
            }