本文整理汇总了C#中Material.ToLocalMaterial方法的典型用法代码示例。如果您正苦于以下问题:C# Material.ToLocalMaterial方法的具体用法?C# Material.ToLocalMaterial怎么用?C# Material.ToLocalMaterial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Material
的用法示例。
在下文中一共展示了Material.ToLocalMaterial方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(PhysxScene scene)
{
if (_target.Disposed) return;
if (_material is Material)
{
//this is already our native material
_target.SetMaterialSync((Material)_material, _applyToObject);
}
else
{
IMaterial currMat = _target.PrimMaterial;
//we need to build our native material
Material material = new Material
{
Density = ((_changes & MaterialChanges.Density) != 0) ? Utils.Clamp(_material.Density, 1.0f, 22587.0f) : currMat.Density,
StaticFriction = ((_changes & MaterialChanges.Friction) != 0) ? Utils.Clamp(_material.StaticFriction, 0.0f, 255.0f) : currMat.StaticFriction,
DynamicFriction = ((_changes & MaterialChanges.Friction) != 0) ? Utils.Clamp(_material.DynamicFriction, 0.0f, 255.0f) : currMat.DynamicFriction,
Restitution = ((_changes & MaterialChanges.Restitution) != 0) ? Utils.Clamp(_material.Restitution, 0.0f, 1.0f) : currMat.Restitution,
GravityMultiplier = ((_changes & MaterialChanges.GravityMultiplier) != 0) ? Utils.Clamp(_material.GravityMultiplier, -1.0f, 28.0f) : currMat.GravityMultiplier,
MaterialPreset = _material.MaterialPreset
};
_target.SetMaterialSync(material.ToLocalMaterial(scene.SceneImpl.Physics), _applyToObject);
}
}