View Issue Details

IDProjectCategoryView StatusLast Update
0002283The Dark ModDesign/Codingpublic27.10.2011 05:17
Reportergrayman Assigned Tograyman  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWin32OSWindowsOS VersionXP
Product VersionTDM 1.02 
Target VersionTDM 1.05Fixed in VersionTDM 1.05 
Summary0002283: Playing cards have invalid mass
DescriptionIf a card game is being played, TDM complains that a new card has an invalid mass.
Steps To ReproduceDrop the card-playing prefab in an otherwise empty room.

Build the map and run it.

Look at the console messages.
Additional InformationThough this is invisible to the player, it's eating up cycles to print these warnings, and--more importantly--they get in the way of any debugging messages coming out of our scripts.
TagsNo tags attached.

Activities

grayman

grayman

07.03.2011 01:06

viewer   ~0003708

The playing card’s volume is calculated from its polygons. Since it only has two, and has no depth, the volume became a very small number, which led to an invalid mass. By treating a very small number as zero, the mass defaults to 1, which is valid.

rev. 4659:

tracemodel.cpp
clip.cpp (added comment only)
anim_blend.cpp (commented console msgs because they were intrusive)
tels

tels

07.03.2011 07:53

reporter   ~0003714

But shouldn't a set mass (via spawnargs) on the entity override the computation of the mass from the volume?
grayman

grayman

07.03.2011 15:43

viewer   ~0003715

I thought it should also, but there are numerous places in the code where mass is determined from the volume of the trace model, as well as numerous places where the spawnarg is used. I wasn't about to override the trace model version with the spawnarg value because as far as I can tell, physics is working the way it's supposed to. I decided that any mass-related problems could be handled as they're reported.

The single card is one such instance, because it's a 2-dimensional object, which the trace model volume-calculating algorithm doesn't appear to handle correctly, resulting in a very very small number. Volumes calculated as zero result in an assigned mass of 1, so all I'm doing is checking for near-zero results and treating them like zero if found.
tels

tels

07.03.2011 16:25

reporter   ~0003716

Hm, yeah, still good find!

Some day we need to either add a real physics engine, or rip out that mess of half-finished code and replace it with something working.

(For instance, the volume of a trace model can differ considerable from the visual model (due to the "only use at max 32 faces for a CM" crap), the engine cannot handle non-uniform density (think "light candle attached to a heavy metal holder") and and and ... The "mass is invalid" has plagued us for some time already, esp with masses under "1" unit (which is in TDM 1 kg, but was some fantasy unit in D3.)

Issue History

Date Modified Username Field Change
25.06.2010 16:52 grayman New Issue
04.08.2010 06:01 tels Status new => assigned
04.08.2010 06:01 tels Assigned To => tels
04.03.2011 17:10 tels Assigned To tels => grayman
07.03.2011 01:06 grayman Note Added: 0003708
07.03.2011 01:06 grayman Status assigned => resolved
07.03.2011 01:06 grayman Resolution open => fixed
07.03.2011 01:06 grayman Fixed in Version => TDM 1.05
07.03.2011 01:06 grayman Target Version => TDM 1.05
07.03.2011 07:53 tels Note Added: 0003714
07.03.2011 15:43 grayman Note Added: 0003715
07.03.2011 16:25 tels Note Added: 0003716
27.10.2011 05:17 greebo Status resolved => closed