当前位置: 首页>>代码示例>>C#>>正文


C# SoftBody.SetTotalMass方法代码示例

本文整理汇总了C#中BulletSharp.SoftBody.SoftBody.SetTotalMass方法的典型用法代码示例。如果您正苦于以下问题:C# SoftBody.SetTotalMass方法的具体用法?C# SoftBody.SetTotalMass怎么用?C# SoftBody.SetTotalMass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BulletSharp.SoftBody.SoftBody的用法示例。


在下文中一共展示了SoftBody.SetTotalMass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetConfig

        protected void SetConfig(SoftBody sb)
        {
            sb.Cfg.AeroModel = this.AeroModel;
            sb.Cfg.DF = this.DynamicFrictionCoefficient;
            sb.Cfg.DP = this.DampingCoefficient;
            sb.Cfg.PR = this.PressureCoefficient;
            sb.Cfg.LF = this.LiftCoefficient;
            sb.Cfg.VC = this.VolumeConservation;
            sb.Cfg.Collisions |= FCollisions.VFSS;

            sb.Cfg.Chr = this.RigidContactHardness;
            sb.Cfg.Shr = this.SoftContactHardness;

            sb.Cfg.DG = this.DragCoefficient;
            sb.Cfg.Ahr = this.AnchorHardness;
            if (this.IsVolumeMass)
            {
                sb.SetVolumeMass(this.Mass);
            }
            else
            {
                sb.SetTotalMass(this.Mass, false);
            }

            if (this.GenerateBendingConstraints)
            {
                sb.GenerateBendingConstraints(this.BendingDistance);
            }
        }
开发者ID:sunep,项目名称:dx11-vvvv,代码行数:29,代码来源:AbstractSoftShapeDefinition.cs

示例2: ConfigureSoftBody

        /// <summary>
        /// Apply these SoftBody settings to this SoftBody
        /// </summary>
        /// <param name="softBody"></param>
        public void ConfigureSoftBody(SoftBody softBody)
        {
            softBody.Scale(scale.ToBullet());

            BulletSharp.SoftBody.Material pm = softBody.Materials[0];

            sBMaterial.SetSBMaterial(pm);

            config.SetConfig(softBody.Cfg);

            if (allNodeBendingConstraints)
            {
                for (int i = 0; i < softBody.Nodes.Count - 1; ++i)
                {
                    softBody.GenerateBendingConstraints(1 + i);
                }
            }
            else
            {
                softBody.GenerateBendingConstraints(bendingConstraintDistance, pm);
            }

            if (randomizeConstraints)
                softBody.RandomizeConstraints();

            if (generateClusters)
                softBody.GenerateClusters(0);

            softBody.SetTotalMass(totalMass, fromFaces);

            softBody.SetPose(bvolume, bframe);
        }
开发者ID:RatherGood1,项目名称:BulletSharpUnity3d,代码行数:36,代码来源:SBSettings.cs


注:本文中的BulletSharp.SoftBody.SoftBody.SetTotalMass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。