本文整理汇总了C#中PhysX.CreateMaterial方法的典型用法代码示例。如果您正苦于以下问题:C# PhysX.CreateMaterial方法的具体用法?C# PhysX.CreateMaterial怎么用?C# PhysX.CreateMaterial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysX
的用法示例。
在下文中一共展示了PhysX.CreateMaterial方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Duplicate
public Material Duplicate(PhysX.Physics physics)
{
if (this.MaterialPreset != NO_PRESET)
{
return (Material)FindImpl((OpenMetaverse.Material)this.MaterialPreset);
}
else
{
PhysX.Material baseMaterial = physics.CreateMaterial(StaticFriction, DynamicFriction, Restitution);
return new Material(baseMaterial, Density, GravityMultiplier);
}
}
示例2: ToLocalMaterial
public Material ToLocalMaterial(PhysX.Physics physics)
{
if (this.MaterialPreset != NO_PRESET)
{
return (Material)FindImpl((OpenMetaverse.Material)this.MaterialPreset);
}
else
{
_baseMaterial = physics.CreateMaterial(_serializedStaticFriction, _serializedDynamicFriction, _serializedRestitution);
return this;
}
}
示例3: Material
public Material(PhysX.Physics physics, float staticFriction, float dynamicFriction, float restitution, float density, float gravityMultiplier)
{
_baseMaterial = physics.CreateMaterial(staticFriction, dynamicFriction, restitution);
Density = density;
GravityMultiplier = gravityMultiplier;
}
示例4: BuiltinMaterialInit
public static void BuiltinMaterialInit(PhysX.Physics physics)
{
// PhysX collision forces are very strong, so the ground restitution needs to be lowered significantly.
GROUND = new Material(physics.CreateMaterial(0.4f, 0.35f, 0.05f), 1200.0f);
GROUND.IsShared = true;
// For navigable roads, people need a preset that acts mostly like ground.
STONE = new Material(physics.CreateMaterial(0.5f, 0.35f, 0.05f), 2400.0f, (int)OpenMetaverse.Material.Stone);
STONE.IsShared = true;
METAL = new Material(physics.CreateMaterial(0.3f, 0.25f, 0.4f), 2700.0f, (int)OpenMetaverse.Material.Metal);
METAL.IsShared = true;
GLASS = new Material(physics.CreateMaterial(0.2f, 0.15f, 0.7f), 2500.0f, (int)OpenMetaverse.Material.Glass);
GLASS.IsShared = true;
WOOD = new Material(physics.CreateMaterial(0.6f, 0.55f, 0.5f), 1000.0f, (int)OpenMetaverse.Material.Wood);
WOOD.IsShared = true;
FLESH = new Material(physics.CreateMaterial(0.9f, 0.8f, 0.3f), 1400.0f, (int)OpenMetaverse.Material.Flesh);
FLESH.IsShared = true;
PLASTIC = new Material(physics.CreateMaterial(0.4f, 0.35f, 0.7f), 900.0f, (int)OpenMetaverse.Material.Plastic);
PLASTIC.IsShared = true;
RUBBER = new Material(physics.CreateMaterial(0.9f, 0.87f, 0.9f), 1100.0f, (int)OpenMetaverse.Material.Rubber);
RUBBER.IsShared = true;
MaterialsByOMVEnum = new Material[]
{
STONE, //0...
METAL,
GLASS,
WOOD,
FLESH,
PLASTIC,
RUBBER,
WOOD //light.. which makes no sense is remapped to wood
};
}