08c5032ca8
I've setup a system for supporting multiple implementations for Roblox's file format. This will allow me to cover the binary format and xml format under the same general-purpose object. Haven't done much with the XML format yet, but I've been making some adjustments to the binary format implementation so that its more evenly branched out and doesn't retain more information than it needs to. I've also fixed some issues with the data-types, and documented the Instance object.
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using Roblox.Enums;
|
|
using Roblox.DataTypes.Utility;
|
|
|
|
namespace Roblox.DataTypes
|
|
{
|
|
public struct PhysicalProperties
|
|
{
|
|
public readonly float Density;
|
|
public readonly float Friction;
|
|
public readonly float Elasticity;
|
|
|
|
public readonly float FrictionWeight;
|
|
public readonly float ElasticityWeight;
|
|
|
|
public PhysicalProperties(Material 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)
|
|
{
|
|
Density = density;
|
|
Friction = friction;
|
|
Elasticity = elasticity;
|
|
|
|
FrictionWeight = frictionWeight;
|
|
ElasticityWeight = elasticityWeight;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Join(", ", Density, Friction, Elasticity, FrictionWeight, ElasticityWeight);
|
|
}
|
|
}
|
|
}
|