Raised This Month: $51 Target: $400
 12% 

Rotate an entity, then update the hullsize based on its new angle.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-09-2017 , 14:25   Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #1

Hello, I have problems with a custom entity I'm creating, basically with the hullsize/boundingbox/etc.

The best way I can explain myself is with pictures, in the next one you can see the entity model (black lines) and its hullsize (red lines), defined by pev_size, pev_mins, pev_absmin, pev_maxs and pev_absmax.



However, when I rotate the entity, the model itself is rotated, yet the solid area is left the same, allowing players to get "inside the models" and colliding with "empty space". (because the hullsize is not actually changed, picture related)



My question is, is there any way to change the hullsize based on a new angle?

PHP Code:
//entity hullsize, assuming the player is facing south
size = {300.0300.0300.0}
mins = {-150.0, -50.00.0}
maxs = {150.0250.075.0}
    
set_pev(entidpev_sizesize)
set_pev(entidpev_minsmins)
set_pev(entidpev_absminmins)
set_pev(entidpev_maxsmaxs)
set_pev(entidpev_absmaxmaxs
Thanks in advance.

EDIT: Apparently this is not possible due limitations on the engine, I decided to update the hullsize manually based on the angles, but it can either point north, south, east or west. Thanks for reading anyway.
Attached Thumbnails
Click image for larger version

Name:	exibit a.png
Views:	553
Size:	2.4 KB
ID:	159993   Click image for larger version

Name:	exibit b.png
Views:	597
Size:	2.0 KB
ID:	159994  
__________________

Last edited by gabuch2; 04-20-2017 at 13:58.
gabuch2 is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-09-2017 , 14:41   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #2

Even if you make it you will have problems with stuck on rotating.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-09-2017 , 14:43   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #3

Quote:
Originally Posted by PRoSToTeM@ View Post
Even if you make it you will have problems with stuck on rotating.
I forgot to say this entity is a "prop", as such it will never rotate or move by itself. I only need to adjust the hullsize based on its angle when I spawn it at map start.
__________________
gabuch2 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-09-2017 , 15:18   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #4

I don't know if it's possible, I've never seen anyone do it. I believe these bounding boxes are axis-aligned, but I could be wrong. I guess someone with more engine knowledge, like Prostotema, could say for sure.
klippy is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-09-2017 , 17:39   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #5

Quote:
Originally Posted by PRoSToTeM@ View Post
Even if you make it you will have problems with stuck on rotating.
he can make SOLID_NOT
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-10-2017 , 07:54   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #6

Apparently this is not possible due limitations on the engine, I decided to update the hullsize manually based on the angles, but it can either point north, south, east or west. Thanks for reading anyway.
__________________
gabuch2 is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-10-2017 , 08:02   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #7

Quote:
Originally Posted by Shattered Heart Lynx View Post
I forgot to say this entity is a "prop", as such it will never rotate or move by itself. I only need to adjust the hullsize based on its angle when I spawn it at map start.
So, you can use HitBoxes for colliding (which can rotate). How to enable it? You need to add flag STUDIO_TRACE_HITBOX to your entity model. How to add it? You need patch the .mdl file: replace 00 00 at 0x88 offset to 00 02. You can try with arcticorange.mdl.

Quote:
Originally Posted by Craxor View Post
he can make SOLID_NOT
What is the purpose of rotating BBOX for not solid entity?
__________________

Last edited by PRoSToTeM@; 01-10-2017 at 09:26.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
safetymoose
Senior Member
Join Date: Feb 2015
Old 01-10-2017 , 15:21   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #8

oh wow, that's awesome
safetymoose is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-11-2017 , 10:55   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #9

Quote:
Originally Posted by PRoSToTeM@ View Post
So, you can use HitBoxes for colliding (which can rotate). How to enable it? You need to add flag STUDIO_TRACE_HITBOX to your entity model. How to add it? You need patch the .mdl file: replace 00 00 at 0x88 offset to 00 02. You can try with arcticorange.mdl.


What is the purpose of rotating BBOX for not solid entity?
Which entity are you using?
__________________
gabuch2 is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-11-2017 , 11:45   Re: Rotate an entity, then update the hullsize based on its new angle.
Reply With Quote #10

Custom info_target.
Patched arcticorange https://mega.nz/#!ToJWBTID!ToesB1tvF...fO6hQt1dxk-X3M
__________________

Last edited by PRoSToTeM@; 01-11-2017 at 11:49.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode