Jump to content
The Dark Mod Forums

Collision models


Baal

Recommended Posts

I need a bit of clarification on the subject of collision models, clip models, trace models and collision detection. I was browsing the source but that's time consuming and I am now heavily confused. :) So I'll just ask some (hopefully not to stupid) questions.

 

There are some models that need a collision model to be used as moveables. If a model contains such a collision model is this also used on static objects?

What kind of control has a mapper over this?

Do projectiles (arrows) collide with the render model or the collision model?

What about blocking of AI vision?

 

SDK related questions:

There is a so called trace model that's restricted to a few vertices. I guess this is the collision model used on non static objects for efficiency.

How are clip and trace model actually related?

Link to comment
Share on other sites

There are some models that need a collision model to be used as moveables. If a model contains such a collision model is this also used on static objects?

 

Yes. This is a bit unfortunate, as it means that you can't drop things into a static bucket, since the bucket model is also used as a movable and thus has a collision mesh which blocks the top. It also creates problems with chairs.

 

What kind of control has a mapper over this?

 

Not much.

 

Do projectiles (arrows) collide with the render model or the collision model?

 

If it has a collision model then arrows collide with that. If it doesn't, then it uses the render model.

 

What about blocking of AI vision?

 

Hmm, that's a good question. Though in most cases the collision model is about the same size as the visual model, so it shouldn't matter too much in practice.

Link to comment
Share on other sites

SDK related questions:

There is a so called trace model that's restricted to a few vertices. I guess this is the collision model used on non static objects for efficiency.

Yes, it's the tracemodel is used by the closed source CollisionModelManager to detect collisions.

 

How are clip and trace model actually related?

I'm only 99% sure so take this with some scepticism.

 

You can regard the idClipModel as some sort of "middleman" between idEntity/idPhysics and the collisionmodel manager. In fact, the idClipModel/idClip classes are using idTraceModels as helper. The tracemodels are strictly mathematical class containing only the info needed to detect collisions (edges, vertices, polies, etc.), whereas the Clipmodel class is also containing gameplay info like body index, pointers to their owning entities, bounds and an entire tracemodel allocation cache.

 

idPhysics make use of idClipModel and idClip to query collisions (and other stuff btw), which in turn are passing their idTraceModels to the idCollisionManager.

 

Does this help?

Link to comment
Share on other sites

There are some models that need a collision model to be used as moveables. If a model contains such a collision model is this also used on static objects?

 

Yes. This is a bit unfortunate, as it means that you can't drop things into a static bucket, since the bucket model is also used as a movable and thus has a collision mesh which blocks the top. It also creates problems with chairs.

 

Incidently, this is why I prefer making the CM in a modelling program so that it can fit the shape of the visible mesh as closely as possible, rather than using DR to make one.

Link to comment
Share on other sites

Does this help?
I was asking out of curiousity mainly but, yes, thank you.

 

you can't drop things into a static bucket, since the bucket model is also used as a movable and thus has a collision mesh which blocks the top
But you could disable the model with "noclipmodel" on a static bucket, right? And there's also the "clipmodel" key through wich you can assign a different cm. And, if I'm correct, that isn't as restricted for non movebales.
Link to comment
Share on other sites

But you could disable the model with "noclipmodel" on a static bucket, right

 

Oh really? I wasn't aware of that. What do you do, add "noclipmodel" "1" in the entity window?

Link to comment
Share on other sites

"noclipmodel" "1" will render the entity completely nonsolid, i.e. arrows or the player will run right through. When this is set to "1" the code will not load any clipmodel, unless you specify one using the "clipmodel" spawnarg.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
    • nbohr1more

      Trying to be productive on my down-time before Capcom releases Akuma and my son is constantly on my PC playing Street Fighter...
      · 1 reply
    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 4 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
×
×
  • Create New...