Page 1 of 1

Mass?

Posted: Fri Feb 26, 2021 4:03 am
by TheIdiot
Does anyone know what specific unit of measurement is used for the "float Mass =" T-Script value? I'm trying to configure my objects with realistic weights but I'm unsure as to exactly what the value represents.

I belive I heard that a Trespasser distance unit is roughly equal to 1 meter, so presumably each unit of Mass equal to a kilogram if the game is universally using Metric measurement? I have a barrel with its Mass set to 2.000000 and it seems to be very light for Anne to carry, which makes me wonder if a Trespasser kilogram is actually 0.1 Mass unit, as objects start to become heavy beyond a Mass of 5.000000 (50kg, or 110lbs).

Re: Mass?

Posted: Sat Feb 27, 2021 1:39 pm
by Draconisaurus
Hmmmm. I never quite looked into this, but back in the day, it seems RexHunter99 determined that both Mass and Density are variable in Tres depending on the object's actual scale value. I was confused about details beyond this, I believe the two values do work differently but perhaps to little consequence. But in general if you want to Mass-manage in Tres I am sure the first thing which is to be done is use a 3D app to set all applicable object's scales to zero. Only then may consistent results be had. Oh, and I imagine the source code has something.

Re: Mass?

Posted: Sat Feb 27, 2021 5:31 pm
by machf
Draconisaurus wrote:the first thing which is to be done is use a 3D app to set all applicable object's scales to zero.
I guess you mean "one" (1.0) rather than "zero" (0.0), as that would actually collapse everything into a single point...

Density is used to calculate mass from the object's volume, Mass is used to set it directly instead.

Looks like Density = Mass/Volume/1000 and Mass = Density*Volume*1000

For water, that would make Density = 1.0 if Mass is in Kg and Volume in m^3 (1 liter = 0.001 m^3 = 1 dm^3 = 1000 cm^3, 1 liter water weighs 1 Kg = 1000 g, water has a density of 1 g/cm^3 = 1 Kg/dm^3 = 1 Kg/l)

Default Density value is 0.1 (lighter than water)
Moveable objects somehow get assigned a Density of 10.0 (heavier)

Re: Mass?

Posted: Sat Feb 27, 2021 11:12 pm
by TheIdiot
machf, would I be better to just set Mass directly and leave Density out of my T-script if I want to make it so that my barrel weighs 12kg by setting Mass = 12.0? Or, if not, is there some kind of combination I could use to directly equate it so that, say, 1.0 unit of Mass equals 1 Kg across all of my Moveable objects?

Re: Mass?

Posted: Sat Feb 27, 2021 11:34 pm
by machf
Set the mass directly then.

But as Drac mentioned, I think the Scale factor may play a part in it too...

Re: Mass?

Posted: Sun Feb 28, 2021 3:18 am
by TheIdiot
machf wrote:Set the mass directly then.

But as Drac mentioned, I think the Scale factor may play a part in it too...
Understood. I'll have to take a look and play around with it in my test level first, then.

Re: Mass?

Posted: Sun Feb 28, 2021 8:07 am
by tatu
I believe I remember that the bigger the object is, the heavier it becomes with the Density script, even if it is the same mesh.

I might be wrong, but I think Mass was more commonly used in the earlier builds?

Re: Mass?

Posted: Thu Mar 04, 2021 6:49 am
by TheIdiot
tatu wrote:I believe I remember that the bigger the object is, the heavier it becomes with the Density script, even if it is the same mesh.
Hmm, does that apply to Mass, then, as well?

Re: Mass?

Posted: Thu Mar 04, 2021 3:38 pm
by machf
Don't think so. Given that Mass is calculated by multiplying volume by Density (if you use Density), of course the larger the volume, the higher the Mass will become. If you increase the scale by a factor of 2, the overall volume will be increased by a factor of 8 (height, width and length, 2*2*2=8), and therefore, so will the Mass. (Incidentally, this is why giant ants or spiders like those in crappy horror movies can't exist, at least not in our Earth with its current gravity, because though the volume and mass increase by the cube of the increase in scale, the area of the "soles" of their feet on which all that weight must rest only increases by the square of the increase in scale, so if the ant is scaled up by a factor of 2, its volume and mass are increased by 8, but the area upon which it rests only by 4, so that means each leg must now support proportionately twice as much weight as it did previously, and it may collapse as it had not been 'designed' to do that.)
If instead you just set the Mass value directly, it will stay constant, regardless of scale (at least, I hope it works that way).