View Issue Details

IDProjectCategoryView StatusLast Update
0004651The Dark ModPhysicspublic05.11.2017 16:25
Reporterstgatilov Assigned Tostgatilov  
PriorityurgentSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0004651: Mantling does not trigger (in New Job)
DescriptionSometimes mantling does not trigger, because collision is not found. As the result, player slides inside obstacle.
Steps To Reproduce1. Start "New Job" mission.
2. Go to "the awning beside the electrical tower, which allows you to get up on the roof."
3. Jump onto the awning while running.
Additional Informationhttp://forums.thedarkmod.com/topic/19143-mantle-problem-is-back/#entry413580
TagsNo tags attached.

Relationships

related to 0000652 closedSpringheel Mantle results in noclip through wall corner. 
related to 0004435 closedduzenko Investigate fp-precision related issues 

Activities

stgatilov

stgatilov

05.11.2017 04:10

administrator   ~0009549

Note that if you do not run when jumping, then mantling triggers properly. Perhaps some collision request fails when player model is touching the awning (just a guess).
stgatilov

stgatilov

05.11.2017 10:24

administrator   ~0009551

Last edited: 05.11.2017 10:29

View 2 revisions

In order to start mantling, a trace of very thin vertical cylinder against world is performed (see idPhysics_Player::MantleTargetTrace). Unfortunately, it fails in the current case (no collision is returned), hence mantling is not initiated, hence player flies into the awning.

In the considered case this trace must return edge-edge collision: vertical edge of the player's trm cylinder collides into the horizontal edge of the awning. Note that no other type of collision is present here: only edge-edge collision can be found.

The reason why the collision is not found is: the edges of the awning are considered "internal" by collision model manager.
The edge of collision model is considered internal when it is a reflex angle between two faces (or the two faces are coplanar and the edge goes inside the face). The internal edges are ignored in edge-edge collision detection as an optimization, because if it generates a collision, there must be some other (more relevant) collision present too.

There are two ways to prove that erroneous internal edges cause the issue:
1. Set "g_drawCollisionModels 1" and "cm_drawInternal 1". Now edges of collision models are drawn: internal ones are green, others are red. Notice that the awning consists of green edges (see attached screenshot NewJob_AwningMantle_InternalEdges).
2. Comment line 2930 in CollisionModel_load.cpp (FindInternalEdges call in idCollisionModelManagerLocal::FinishModel). Then the issue disappears.

stgatilov

stgatilov

05.11.2017 10:29

administrator  

stgatilov

stgatilov

05.11.2017 10:36

administrator   ~0009552

As far as I understand, this model is:
  atdm:ext_timber01_window01_awning
And its def points to:
  "models/darkmod/architecture/modules/exteriors/ext_timber01/ext_timber01_window01_awning.lwo"
However, I don't know where collision model comes from...
stgatilov

stgatilov

05.11.2017 14:40

administrator   ~0009553

Ok, the problem is caused by double geometry: the problematic part of collision model contains two equal boxes. So this is double geometry, which causes problems in current collision models manager, according to comment in idCollisionModelManagerLocal::FindInternalEdgesOnPolygon:
    // FIXME: doubled geometry causes problems
Springheel

Springheel

05.11.2017 16:23

administrator   ~0009555

Last edited: 05.11.2017 16:23

View 2 revisions

Should be fixed now, at least for that specific model.

stgatilov

stgatilov

05.11.2017 16:25

administrator   ~0009557

The model was changed in rev 15062.
This issue can be closed.

Issue History

Date Modified Username Field Change
05.11.2017 04:09 stgatilov New Issue
05.11.2017 04:10 stgatilov Note Added: 0009549
05.11.2017 04:34 stgatilov Relationship added related to 0000652
05.11.2017 04:34 stgatilov Relationship added related to 0004435
05.11.2017 10:24 stgatilov Note Added: 0009551
05.11.2017 10:25 stgatilov Assigned To => stgatilov
05.11.2017 10:25 stgatilov Status new => assigned
05.11.2017 10:29 stgatilov File Added: NewJob_AwningMantle_InternalEdges.jpg
05.11.2017 10:29 stgatilov Note Edited: 0009551 View Revisions
05.11.2017 10:36 stgatilov Note Added: 0009552
05.11.2017 14:40 stgatilov Note Added: 0009553
05.11.2017 16:23 Springheel Status assigned => feedback
05.11.2017 16:23 Springheel Note Added: 0009555
05.11.2017 16:23 Springheel Note Edited: 0009555 View Revisions
05.11.2017 16:25 stgatilov Note Added: 0009557
05.11.2017 16:25 stgatilov Status feedback => assigned
05.11.2017 16:25 stgatilov Status assigned => resolved
05.11.2017 16:25 stgatilov Fixed in Version => TDM 2.06
05.11.2017 16:25 stgatilov Resolution open => fixed