java.lang.Object
technology.sola.engine.physics.Material
Material represents a physical material for physics simulations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Material
Material with mass set to 1, restitution set to 0.01 and friction set to 0. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
UNIT_MASS_MATERIAL
Material with mass set to 1, restitution set to 0.01 and friction set to 0.
-
-
Constructor Details
-
Material
public Material(float mass) Creates a material with custom mass. Restitution is set to a low value of 0.01 and friction is set to 0.- Parameters:
mass
- the mass of the material, must be greater than or equal to 0
-
Material
public Material(float mass, float restitution) Creates a material with custom mass and restitution. Friction is set to 0.- Parameters:
mass
- the mass of the material, must be greater than or equal to 0restitution
- the restitution (bounciness) of the material, must be greater than or equal to 0
-
Material
public Material(float mass, float restitution, float friction) Creates a material with custom mass, restitution and friction.- Parameters:
mass
- the mass of the material, must be greater than or equal to 0restitution
- the restitution (bounciness) of the material, must be greater than or equal to 0friction
- the friction from this material, must be greater than or equal to 0
-
-
Method Details
-
getMass
public float getMass()Gets the mass of the material.- Returns:
- the mass of the material
-
getInverseMass
public float getInverseMass()Gets the inverse mass (1 / mass). This value is pre-calculated since it is used often.- Returns:
- the inverse mass
-
getRestitution
public float getRestitution()Gets the restitution (bounciness) of the material.- Returns:
- the restitution of the material
-
getFriction
public float getFriction()Gets the friction of the material.- Returns:
- the friction of the material
-
hashCode
public int hashCode() -
equals
-