// Given a material type, return a structure of attributes. public static MaterialAttributes GetAttributes(MaterialAttributes.Material type, bool isPhysical) { int ind = (int)type; if (isPhysical) { ind += (int)MaterialAttributes.Material.NumberOfTypes; } return(Attributes[ind]); }
public void SetMaterial(int material) { Material = (MaterialAttributes.Material)material; // Setting the material sets the material attributes also. MaterialAttributes matAttrib = BSMaterials.GetAttributes(Material, false); Friction = matAttrib.friction; Restitution = matAttrib.restitution; Density = matAttrib.density / BSParam.DensityScaleFactor; }
public void SetMaterial(int material) { Material = (MaterialAttributes.Material)material; // Setting the material sets the material attributes also. MaterialAttributes matAttrib = BSMaterials.GetAttributes(Material, false); Friction = matAttrib.friction; Restitution = matAttrib.restitution; Density = matAttrib.density / BSParam.DensityScaleFactor; // DetailLog("{0},{1}.SetMaterial,Mat={2},frict={3},rest={4},den={5}", LocalID, TypeName, Material, Friction, Restitution, Density); }
public override void SetMaterial(int material) { Material = (MaterialAttributes.Material)material; // Setting the material sets the material attributes also. // TODO: decide if this is necessary -- the simulator does this. MaterialAttributes matAttrib = BSMaterials.GetAttributes(Material, false); Friction = matAttrib.friction; Restitution = matAttrib.restitution; Density = matAttrib.density; // DetailLog("{0},{1}.SetMaterial,Mat={2},frict={3},rest={4},den={5}", LocalID, TypeName, Material, Friction, Restitution, Density); }
public override void SetMaterial(int material) { Material = (MaterialAttributes.Material)material; }
public override void SetMaterial(int material) { Material = (MaterialAttributes.Material)material; // Setting the material sets the material attributes also. MaterialAttributes matAttrib = BSMaterials.GetAttributes(Material, false); Friction = matAttrib.friction; Restitution = matAttrib.restitution; Density = matAttrib.density / BSParam.DensityScaleFactor; DetailLog("{0},{1}.SetMaterial,Mat={2},frict={3},rest={4},den={5}", LocalID, TypeName, Material, Friction, Restitution, Density); }