コード例 #1
0
        //개선된 버전 19.5.23
        public void Link(apOptModifiedMesh_Physics modMeshPhysics,
                         apOptModifiedMeshSet modMeshSet,
                         apOptTransform optTransform,
                         apOptRenderVertex vertex)
        {
            //>>19.5.23 : 삭제 (불필요)
            //_modifiedMesh = modifiedMesh;
            //_mesh = mesh;
            _vertex       = vertex;
            _optTransform = optTransform;

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


            apOptMesh mesh = modMeshSet._targetMesh;

            //이미 Bake 되었으므로 바로 Link하면 된다.
            for (int i = 0; i < _linkedVertices.Count; i++)
            {
                LinkedVertex               linkedVert = _linkedVertices[i];
                apOptRenderVertex          renderVert = mesh.RenderVertices[linkedVert._vertIndex];
                apOptModifiedPhysicsVertex linkVert   = modMeshSet.SubModMesh_Physics._vertWeights[linkedVert._vertIndex];
                linkedVert.Link(renderVert, linkVert);
            }

            DampPhysicVertex();
        }
コード例 #2
0
 public LinkedVertex(apPhysicsVertParam.LinkedVertex srcLinkedVertex)
 {
     _vertex        = null;
     _vertIndex     = srcLinkedVertex._vertex._index;
     _modVertWeight = null;
     _distWeight    = srcLinkedVertex._distWeight;
 }
コード例 #3
0
        // Init - Bake
        //--------------------------------------------
        public void Bake(apPhysicsMeshParam srcPhysicParam, List <apModifiedVertexWeight> modVertWeights, apPortrait portrait)
        {
            _nVertWeights = modVertWeights.Count;
            _vertWeights  = new apOptModifiedPhysicsVertex[_nVertWeights];

            _physicMeshParam = new apOptPhysicsMeshParam();
            _physicMeshParam.Bake(srcPhysicParam);
            _physicMeshParam.Link(portrait);

            for (int i = 0; i < _nVertWeights; i++)
            {
                apOptModifiedPhysicsVertex optModPhysicVert = new apOptModifiedPhysicsVertex();
                apModifiedVertexWeight     srcModVertWeight = modVertWeights[i];
                optModPhysicVert.Bake(srcModVertWeight);

                _vertWeights[i] = optModPhysicVert;
            }
        }
コード例 #4
0
 public void Link(apOptRenderVertex linkedVertex, apOptModifiedPhysicsVertex linkedModPhysicsVertex)
 {
     _vertex        = linkedVertex;
     _modVertWeight = linkedModPhysicsVertex;
 }