PhysicalProperties
Overview
Description
The PhysicalProperties
class defines the physical characteristics of an object, such as its density, friction, and elasticity. These properties are often used in physics simulations and game development to model realistic object interactions.
Properties
Density
number
Represents the density of the object (mass per unit volume). A higher value of density implies the object is heavier for the same size.
Code Samples
Friction
number
Defines the coefficient of friction of the object. This determines how easily it can slide against another surface.
A lower value means less friction (slippery).
A higher value means more friction (sticky).
Code Samples
Elasticity
number
The elasticity property determines how bouncy the object is when impacted or collided with other objects.
A value of 0 means no elasticity (not bouncy).
A value of 1 means maximum elasticity (very bouncy).
Code Samples
FrictionWeight
number
This determines the weight or importance of the Friction
value in simulations. It is often used to fine-tune friction calculations.
Code Samples
ElasticityWeight
number
This determines the weight or importance of the Elasticity
value in simulations. It is used to fine-tune elasticity calculations.
Code Samples
Constructors
new
Creates a new PhysicalProperties
object using predefined materials. The properties are automatically populated based on the material selected.
Parameters
Material
InMaterial
The material to initialize the object.
Return
PhysicalProperties
The new object created.
Code Samples
new
Creates a new PhysicalProperties
object with custom values for density, friction, elasticity, friction weight, and elasticity weight.
Parameters
number
InDensity
The density of the material.
number
InFriction
The friction of the material.
number
InElasticity
The elasticity of the material.
number
InFrictionWeight
The friction weight of the material.
number
InElasticityWeight
The elasticity weight of the material.
Return
PhysicalProperties
The new object created.
Code Samples
Methods
Last updated