public void Link(apModifiedMesh modifiedMesh, apMesh mesh, apVertex vertex)
        {
            _modifiedMesh = modifiedMesh;
            _mesh         = mesh;
            _vertex       = vertex;
            if (_vertex != null)
            {
                _vertIndex = _vertex._index;
            }
            else
            {
                _vertIndex = -1;
            }

            _renderVertex = null;
            if (modifiedMesh._renderUnit != null && _vertex != null)
            {
                _renderVertex = modifiedMesh._renderUnit._renderVerts.Find(delegate(apRenderVertex a)
                {
                    return(a._vertex == _vertex);
                });
            }

            if (_physicParam == null)
            {
                _physicParam = new apPhysicsVertParam();
            }

            _physicParam.Link(modifiedMesh, this);

            RefreshModMeshAndWeights(_modifiedMesh);
        }
Ejemplo n.º 2
0
        public void Bake(apPhysicsVertParam srcVertParam)
        {
            _isConstraint = srcVertParam._isConstraint;
            _isMain       = srcVertParam._isMain;

            _linkedVertices.Clear();
            for (int i = 0; i < srcVertParam._linkedVertices.Count; i++)
            {
                apPhysicsVertParam.LinkedVertex srcLinkedVert = srcVertParam._linkedVertices[i];
                _linkedVertices.Add(new OptLinkedVertex(srcLinkedVert));                //<<Add + Bake
            }

            _viscosityGroupID = srcVertParam._viscosityGroupID;
        }
        public void Init(int vertUniqueID, apVertex vertex)
        {
            _vertexUniqueID = vertUniqueID;
            _vertex         = vertex;
            _vertIndex      = _vertex._index;

            _isEnabled = false;
            _weight    = 0.0f;

            _calculatedDeltaPos      = Vector2.zero;
            _calculatedDeltaPos_Prev = _calculatedDeltaPos;

            _isPhysics = false;
            _isVolume  = false;

            if (_physicParam == null)
            {
                _physicParam = new apPhysicsVertParam();
            }

            _physicParam.Clear();
        }
Ejemplo n.º 4
0
        public void Bake(apModifiedVertexWeight srcModVertWeight)
        {
            _isEnabled = srcModVertWeight._isEnabled;
            _weight    = srcModVertWeight._weight;

            _pos_World_NoMod = srcModVertWeight._pos_World_NoMod;


            //PhysicsParam도 Bake
            apPhysicsVertParam srcVertParam = srcModVertWeight._physicParam;

            _isConstraint = srcVertParam._isConstraint;
            _isMain       = srcVertParam._isMain;

            _linkedVertices.Clear();
            for (int i = 0; i < srcVertParam._linkedVertices.Count; i++)
            {
                apPhysicsVertParam.LinkedVertex srcLinkedVert = srcVertParam._linkedVertices[i];
                _linkedVertices.Add(new LinkedVertex(srcLinkedVert));                //<<Add + Bake
            }

            _viscosityGroupID = srcVertParam._viscosityGroupID;
        }