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

local properties = PhysicalProperties.new()
properties.Density = 2.5

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

local properties = PhysicalProperties.new()
properties.Friction = 0.8

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

local properties = PhysicalProperties.new()
properties.Elasticity = 0.5

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

local properties = PhysicalProperties.new()
properties.FrictionWeight = 1.0

ElasticityWeight

number

This determines the weight or importance of the Elasticity value in simulations. It is used to fine-tune elasticity calculations.

Code Samples

local properties = PhysicalProperties.new()
properties.ElasticityWeight = 0.9

Constructors

new

Creates a new PhysicalProperties object using predefined materials. The properties are automatically populated based on the material selected.

Parameters

Parameter
Description

Material InMaterial

The material to initialize the object.

Return

Return Type
Description

PhysicalProperties

The new object created.

Code Samples

//Not Work

new

Creates a new PhysicalProperties object with custom values for density, friction, elasticity, friction weight, and elasticity weight.

Parameters

Parameter
Description

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

Return Type
Description

PhysicalProperties

The new object created.

Code Samples

//Not Work

Methods

Last updated