Announcement

Collapse
No announcement yet.

FTEQW collision meshes?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTEQW collision meshes?

    I see there's a thread up regarding Darkplaces and colliding using models. Is there similar functionality in FTE?
    The thread is here
    http://quakeone.com/forum/quake-help...ision-question

    Apparently DP does this by setting the entity's .solid field to SOLID_BSP and setting it's bounding box to be larger than the model. I've tried this with FTE using the regular player.mdl but it doesn't work.

  • #2
    Should work pretty much the same.

    There's also a custom iqm exporter that allows you to set per-mesh contents flags, so that you can have collision on specific surfaces/meshes and not others, with shader's using surfaceparm nodraw on the collision ones to fully separate rendering and hitmodel (for performance reasons, but you can also provide body ids which can easily tell you which part of the model was hit).
    See also: http://forums.insideqc.com/viewtopic...&t=5839#p58369
    (the exporter should work with any engine [which can be nice if you come from a half-life background and love smds that are badly rotated etc], but only FTE will notice the format extensions)
    Some Game Thing

    Comment


    • #3
      player_legend

      I noticed recently that this doesn't work with models of certain movetypes, like MOVETYPE_STEP for monsters, so I doubt the player model will work either. The engine will trip an error that the entity has a bad solid. I had a strong feeling this would be the case, but I thought I'd try just for the hell of it. However, this was on QuakeSpasm, maybe FTE handles it differently?
      'Replacement Player Models' Project

      Comment


      • #4
        My problem turned out to be that the entities I was trying to collide with had my player entity set as their owner. I've got it working, though it seems to have some trouble.
        I appear to be able to clip into this IQM if I run in to it at certain spots. I've got the entity's movetype set to MOVETYPE_NONE, so I can't imagine any strangeness there would be the cause. The bounding box of the entity is set to a +/- 256 cube, more than large enough to fit the model. My best guess is that the engine might not support rotating these models well.

        Here are some screenshots, #1 is colliding correctly on the front of the model, and #2 is clipping in when I hit a corner.

        1.png2.png


        Here's the Quake C I'm using to spawn these entities:
        Code:
        void touch_grenade()
        {
          self.touch = SUB_Null;
          self.velocity = '0 0 0';
          self.solid = SOLID_BSP;
          self.movetype = MOVETYPE_NONE;
          setsize( self, 2*'-128 -128 -128', 2*'128 128 128' );
          setmodel( self, "models/level3.iqm" );
          self.owner = world;
        }
        void launch_grenade( vector org, vector dir )
        {
          entity gren = spawn_missile( self, org, dir, 600, "models/level3.iqm" );
          gren.movetype = MOVETYPE_BOUNCE;
          gren.touch = touch_grenade;
          setsize( gren, 2*'-128 -128 -128', 2*'128 128 128' );
        }



        Comment


        • #5
          setmodel on non-bsp models does a setsize of +/-16 (in nq, for compat reasons, there's some gameplayfix cvar that can override that - the check for 'bsp models' in this case is actually on the filename itself as this tends to give the best compatibility with replacement content plus is a legacy of quakeworld servers not even bothering to try to load .mdl models).
          always do setmodel THEN setsize.
          Last edited by Spike; 09-12-2017, 07:04 PM. Reason: clarified 'non-bsp models'
          Some Game Thing

          Comment

          Working...
          X