body & combat primitives wip
This commit is contained in:
37
engine/items/itemprops/item_physics.go
Normal file
37
engine/items/itemprops/item_physics.go
Normal file
@ -0,0 +1,37 @@
|
||||
package itemprops
|
||||
|
||||
import "github.com/shopspring/decimal"
|
||||
|
||||
type ItemPhysics struct {
|
||||
Material Material
|
||||
Rigidity DimensionItemRigidity
|
||||
Size DimensionItemSize
|
||||
Temperature DimensionItemTemperature
|
||||
}
|
||||
|
||||
//DimensionItemSize length in m (1 mm = 1/1000 of 1m)
|
||||
type DimensionItemSize struct {
|
||||
Width decimal.Decimal
|
||||
Height decimal.Decimal
|
||||
// if item is solid - depth in m (1mm = 1/1000 of m)
|
||||
Depth decimal.NullDecimal
|
||||
//Thickness if item is hollow - thickness of outer item shell, ie for armor, in m (1 mm = 1/1000 of m)
|
||||
Thickness decimal.NullDecimal
|
||||
}
|
||||
|
||||
//Area is frontal area
|
||||
func (d *DimensionItemSize) Area() decimal.Decimal {
|
||||
return d.Width.Mul(d.Height)
|
||||
}
|
||||
|
||||
//DimensionItemDensity density in kg/m3
|
||||
type DimensionItemDensity decimal.Decimal
|
||||
|
||||
//DimensionItemRigidity rigidity жёсткость, способность твёрдого тела, конструкции или её элементов сопротивляться деформации in N/m
|
||||
type DimensionItemRigidity decimal.Decimal
|
||||
|
||||
//NotchFractureToughness ударная вязкость по Шарпи, Дж (надо ли?)
|
||||
type NotchFractureToughness decimal.Decimal
|
||||
|
||||
//DimensionItemTemperature in celsius, -273 to 10000
|
||||
type DimensionItemTemperature decimal.Decimal
|
Reference in New Issue
Block a user