Thanks for your help Saul, but it doesn't solve my problem.

As far as I'm understanding this with my limited knowledge of C++ the function
PhysicsSolidMaskForEntity sets the mask to be used for collision detection by
the physic system to MASK_SOLID combined with CONTENTS_HITBOX. However the
projectile still triggers a hit upon hiting the bounding box. I tested this by
making the VEC_HULL_MAX larger then the actual model.

If I make the VEC_HULL_MAX smaller then the actual model I get another result.
See these two screenshots:

http://i.imgur.com/8ISQHI1.jpg <- projectile flys trough the hitbox
http://i.imgur.com/uExNUhc.jpg <- projectile flys trough the boundingbox and
hitting.

According to https://developer.valvesoftware.com/wiki/CollisionProperty hitbox
detection doesn't even happen when we're not inside the bounding box. Which
explains the results from the screenshot.

So how do I solve this? Is there a way to tell the game to recalculate the
bounding box according to the size of the model and or its hitboxes?

I tried using CollisionProp()->SetSurroundingBoundsType( USE_HITBOXES ); which
sets them up correctly when killing yourself: http://i.imgur.com/s88NKQV.jpg
However upon re-spawning its back to the old values:
http://i.imgur.com/aeNqaz5.jpg
Any ideas why this happens or whats causing it?

Another thing I noticed is that size of the boundingbox is in direct relation to
values defined in HL2MPViewVectors. More precisely the values in VEC_HULL_MIN
and VEC_HULL_MAX. How do I make these values dynamic for each player? Is that
even possible? Because unlike the traditional game we will have different sized
props as the player in multiplayer. So in one instance it will be the size of a
chair and in another one the size of a refrigerator.


Kind regards,
Tobias


Saul Rennison <saul.renni...@gmail.com> hat am 4. Juli 2013 um 20:58
geschrieben:

>  It seems crossbow bolts already respect hitboxes (see
> CCrossbowBolt::PhysicsSolidMaskForEntity)
> 
> 
> 
>  Kind regards,
>  Saul Rennison
> 
> 
>  On 4 July 2013 19:17, Saul Rennison <saul.renni...@gmail.com
> <mailto:saul.renni...@gmail.com> > wrote:
>    > >    If the crossbow projectile is an entity, you need to override a
>    > > specific VPhysics function to tell it to respect hitboxes when doing
>    > > collision detection. I can get this method override for you shortly.
> > 
> > 
> > 
> >    Kind regards,
> >    Saul Rennison
> > 
> > 
> >    On 4 July 2013 19:12, Tobias Baumann <m...@tobiasbaumann.net
> > <mailto:m...@tobiasbaumann.net> > wrote:
> >      > > >      Hi Ben,
> > > 
> > >      I did but I looked into it again and adjusted its size which provided
> > > me with the following result:
> > > 
> > >      http://i.imgur.com/ffA9ZE7.jpg <http://i.imgur.com/ffA9ZE7.jpg>
> > > 
> > >      The big box is the bounding box with ViewVector values. The little
> > > boxes are the hitboxes visible with sv_showhitboxes 1. Now why are they
> > > ignored and all hit-detection only happens on the bounding box? I did some
> > > testing and found out that this only happens with the Crossbow or my own
> > > weapon script which is a mixture of the crossbow and grenade code. So in
> > > other words the crossbow bolt uses the boundingbox for hit detection while
> > > other weapons use the hitboxes. Which makes sense since the other weapons
> > > don't actually fire a physical projectile but instead use raytracing. At
> > > least thats what I'm assuming. So long story short I'm left with two
> > > questions:
> > > 
> > >      How do I tell the crossbow bolt to use hitboxes and not boundingboxes
> > > for hit detection?
> > > 
> > >      And how can I set individual ViewVectors for each player and is that
> > > even possible with the engine? (What I noticed is that the hardcoded
> > > vectors are uniform for everyone).
> > > 
> > >      In case you're wondering: This is for the Suicide Survival mod.
> > >      The weapon script is a physical book you throw, hence the crossbow
> > > bolt code.
> > >      The individual ViewVectors are needed because I wan't to use
> > > different kind of prop models for the suiciders and the problem with this
> > > was that they get position in the ground by half their size (due to the
> > > origin being at 0,0,0 and the model not having any bones I'm assuming).
> > > 
> > >      I hope this makes things a bit clearer :)
> > > 
> > >      Thanks for any advice/help,
> > >      Tobias
> > > 
> > > 
> > > 
> > > 
> > >      "Ben K." < amo...@online.de <mailto:amo...@online.de> > hat am 3.
> > > Juli 2013 um 15:53 geschrieben:
> > > 
> > >       > > > >       You probably haven't adjusted the bounding box. Check
> > >       > > > > out your game rules and look for "ViewVectors".
> > > > 
> > > >       Ben
> > > > 
> > > >       Tobias <m...@tobiasbaumann.net> <mailto:m...@tobiasbaumann.net> 
> > > > wrote:
> > > > 
> > > >           > > > > >           Already try that and it only shows the
> > > >           > > > > > local hitboxes for me. I mean it displays the proper
> > > >           > > > > > hitboxes the same way they're displayed in the
> > > >           > > > > > modelviewer. However these are totally ignored for
> > > >           > > > > > actual hit detection when I fire on the player. :(
> > > > > 
> > > > >           Check this screenshot: http://i.imgur.com/KGJ1Kys.jpg
> > > > > <http://i.imgur.com/KGJ1Kys.jpg>
> > > > > 
> > > > >           Thats with "sv_showhitboxes 1". If I fire on the model with
> > > > > another client the bullets go right trough the model until about half
> > > > > the vertical size of it. Or in other words if I fire at the base/lower
> > > > > part I get hits and everything above is ignored. Since the model is
> > > > > pretty large/high I'm guessing that there might be some maximum height
> > > > > value for the hitbox? Or for the collision box? A standard playermodel
> > > > > reaches until about the middle of the cactus.
> > > > > 
> > > > >           Best regards,
> > > > >           Tobias
> > > > > 
> > > > >       > > > > 
> > > >      > > >        _______________________________________________
> > >      To unsubscribe, edit your list preferences, or view the list
> > > archives, please visit:
> > >      https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
> > > <https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders>
> > > 
> > >      _______________________________________________
> > >      To unsubscribe, edit your list preferences, or view the list
> > > archives, please visit:
> > >      https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
> > > <https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders>
> > > 
> > >    > >  > 
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Reply via email to