Convert datatypes to classes instead of structs.
This commit is contained in:
@ -1,38 +1,28 @@
|
||||
using RobloxFiles.Enums;
|
||||
using RobloxFiles.DataTypes.Utility;
|
||||
using RobloxFiles.Utility;
|
||||
|
||||
namespace RobloxFiles.DataTypes
|
||||
{
|
||||
public struct PhysicalProperties
|
||||
public class PhysicalProperties
|
||||
{
|
||||
public readonly float Density;
|
||||
public readonly float Friction;
|
||||
public readonly float Elasticity;
|
||||
public readonly float Density = 1.0f;
|
||||
public readonly float Friction = 1.0f;
|
||||
public readonly float Elasticity = 0.5f;
|
||||
|
||||
public readonly float FrictionWeight;
|
||||
public readonly float ElasticityWeight;
|
||||
public readonly float FrictionWeight = 1.0f;
|
||||
public readonly float ElasticityWeight = 1.0f;
|
||||
|
||||
public PhysicalProperties(Material material)
|
||||
{
|
||||
if (MaterialInfo.FrictionWeightMap.ContainsKey(material))
|
||||
FrictionWeight = MaterialInfo.FrictionWeightMap[material];
|
||||
|
||||
Density = MaterialInfo.DensityMap[material];
|
||||
Friction = MaterialInfo.FrictionMap[material];
|
||||
Elasticity = MaterialInfo.ElasticityMap[material];
|
||||
|
||||
FrictionWeight = 1;
|
||||
ElasticityWeight = 1;
|
||||
}
|
||||
|
||||
public PhysicalProperties(float density, float friction, float elasticity)
|
||||
{
|
||||
Density = density;
|
||||
Friction = friction;
|
||||
Elasticity = elasticity;
|
||||
|
||||
FrictionWeight = 1;
|
||||
ElasticityWeight = 1;
|
||||
}
|
||||
|
||||
public PhysicalProperties(float density, float friction, float elasticity, float frictionWeight, float elasticityWeight)
|
||||
public PhysicalProperties(float density, float friction, float elasticity, float frictionWeight = 1f, float elasticityWeight = 1f)
|
||||
{
|
||||
Density = density;
|
||||
Friction = friction;
|
||||
|
Reference in New Issue
Block a user