Raised This Month: $ Target: $400
 0% 

Entity within entity touching


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-04-2014 , 11:22   Entity within entity touching
Reply With Quote #1

How does this happen? One entity is solid_trigger, other solid_bbox. Trigger one is large cube. What I need is that bbox one can't leave this trigger area. So I was thinking of touch, when does touch triggers - when it touches the sides or all the time when inside?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 07-05-2014 , 09:25   Re: Entity within entity touching
Reply With Quote #2

in theory, all the time inside
an entity is not a box, it's a full cube
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 07-06-2014 , 00:58   Re: Entity within entity touching
Reply With Quote #3

Can you explain a bit more ??
Not able to understand you what exactly you are trying to do..

BTW this code detects if Entity1's origin is inside the Entity2 Cube, hopefully this helps you

PHP Code:
bool:IsEntityInsideEntity( const iEntity1, const iEntity2 
{
    new 
Float:vOrigin], Float:vAbsMin], Float:vAbsMax];         
    
peviEntity1pev_originvOrigin );  
    
peviEntity2pev_absminvAbsMin );     
    
peviEntity2pev_absmaxvAbsMax );         
    
    if( ( 
vAbsMin] <= vOrigin] <= vAbsMax] ) &&  ( vAbsMin] <= vOrigin] <= vAbsMax] ) && ( vAbsMin] <= vOrigin] <= vAbsMax] ) )
        return 
true
    
    return 
false;

__________________
Preparing to release my plugins..
r0ck is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-06-2014 , 07:36   Re: Entity within entity touching
Reply With Quote #4

I think he is trying to make a solid entity not be able to leave a trigger entity. So he was asking if touch forward between these 2 entities is called every frame while solid entity is inside trigger one, or is it just called when they collide their bounding box edges.
I guess it is just on edges, because this is the SOLID_TRIGGER description:
Code:
#define	SOLID_TRIGGER		1		/* touch on edge, but not blocking */
So, you may detect their touch and just put your solid entity inside trigger one again.
Although you could test it by moving your entity inside a trigger entity and print out a message on every touch forward call, then move it in a way that only their edges will be touching.

Last edited by klippy; 07-06-2014 at 07:38.
klippy is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-06-2014 , 09:18   Re: Entity within entity touching
Reply With Quote #5

Quote:
Originally Posted by KliPPy View Post
I think he is trying to make a solid entity not be able to leave a trigger entity. So he was asking if touch forward between these 2 entities is called every frame while solid entity is inside trigger one, or is it just called when they collide their bounding box edges.
Bingo

Thanks for answer, will test it. I just wanted to know more before starting to work on.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
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:14.


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