public void Bake_VertexWeights(apOptTransform rootTransform, apOptTransform targetTransform,
                                       apOptMesh targetMesh, List <apModifiedVertexWeight> modVertWeights)
        {
            _rootTransform   = rootTransform;
            _targetTransform = targetTransform;
            _targetMesh      = targetMesh;

            if (_targetMesh == null)
            {
                Debug.LogError("Vert Rig인데 Target Mesh가 Null");
                Debug.LogError("Target Transform [" + _targetTransform.transform.name + "]");
            }

            _nVertWeights = modVertWeights.Count;
            _vertWeights  = new apOptModifiedVertexWeight[_nVertWeights];
            for (int i = 0; i < _nVertWeights; i++)
            {
                apOptModifiedVertexWeight optModVertWeight = new apOptModifiedVertexWeight();
                apModifiedVertexWeight    srcModVertWeight = modVertWeights[i];
                optModVertWeight.Bake(srcModVertWeight);

                _vertWeights[i] = optModVertWeight;
            }

            _meshColor = Color.gray;
            _isVisible = true;
        }
Beispiel #2
0
            public OptLinkedVertex(apPhysicsVertParam.LinkedVertex srcLinkedVertex)
            {
                //_vertex = vertex;
                _vertex       = null;
                _vertUniqueID = srcLinkedVertex._vertUniqueID;
                _vertIndex    = srcLinkedVertex._vertex._index;

                _modVertWeight = null;

                _deltaPosLocal = srcLinkedVertex._deltaPosLocalLinkToTarget;
                _distLocal     = srcLinkedVertex._distLocal;
                _distWeight    = srcLinkedVertex._distWeight;

                _level = srcLinkedVertex._level;
            }
Beispiel #3
0
        /// <summary>
        /// Linked Vertex의 객체를 Link한다.
        /// </summary>
        /// <param name="parentModMesh"></param>
        public void Link(apOptModifiedMesh parentModMesh, apOptModifiedVertexWeight parentModVertWeight)
        {
            _parentModMesh = parentModMesh;
            //_parentModVertWeight = parentModVertWeight;

            if (_linkedVertices == null)
            {
                _linkedVertices = new List <OptLinkedVertex>();
            }


            apOptMesh mesh = parentModMesh._targetMesh;

            //이미 Bake 되었으므로 바로 Link하면 된다.
            for (int i = 0; i < _linkedVertices.Count; i++)
            {
                OptLinkedVertex           linkedVert     = _linkedVertices[i];
                apOptRenderVertex         renderVert     = mesh.RenderVertices[linkedVert._vertIndex];
                apOptModifiedVertexWeight linkVertWeight = _parentModMesh._vertWeights[linkedVert._vertIndex];
                linkedVert.Link(renderVert, linkVertWeight);
            }
        }
Beispiel #4
0
 public void Link(apOptRenderVertex linkedVertex, apOptModifiedVertexWeight linkedModVertWeight)
 {
     _vertex        = linkedVertex;
     _modVertWeight = linkedModVertWeight;
 }