public void Update(rthsMeshData md, SkinnedMeshRenderer smr, bool useShadowSettings, bool useDeformData)
            {
                rthsInstanceFlag flags = ToFlags(smr.receiveShadows, smr.shadowCastingMode, useShadowSettings);

                if (useDeformData)
                {
                    var bones = smr.bones;
                    if (bones.Length > 0)
                    {
                        // skinned
                        var rootBone   = smr.rootBone;
                        var rootMatrix = rootBone != null ? rootBone.localToWorldMatrix : Matrix4x4.identity;
                        Update(md, flags, rootMatrix, smr.gameObject);
                        instData.SetBones(bones);
                    }
                    else
                    {
                        // non-skinned
                        Update(md, flags, smr.localToWorldMatrix, smr.gameObject);
                    }
                    instData.SetBlendshapeWeights(smr);
                }
                else
                {
                    Update(md, flags, smr.localToWorldMatrix, smr.gameObject);
                }
            }
Пример #2
0
            public void Update(rthsMeshData md, SkinnedMeshRenderer smr)
            {
                var bones = smr.bones;

                if (bones.Length > 0)
                {
                    // skinned
                    var rootBone   = smr.rootBone;
                    var rootMatrix = rootBone != null ? rootBone.localToWorldMatrix : Matrix4x4.identity;
                    Update(md, rootMatrix);
                    instData.SetBones(bones);
                }
                else
                {
                    // non-skinned
                    Update(md, smr.localToWorldMatrix);
                }
                instData.SetBlendshapeWeights(smr);
            }