[Very Hard] Is origin inside of entity
I have a brush entity here ( yellow { thats one entity} )
http://www.upload.ee/image/3274187/__entity.png I want to create point( with random origin ) and check that is point origin inside of this entity. ( I dont want to use touch because i need to do this without creating new entity ) Thanks! |
Re: [Very Hard] Is origin inside of entity
check this stock:
Code:
You can easily make it work for a point as well. |
Re: [Very Hard] Is origin inside of entity
Quote:
you see it will check a box but what about ohter mdl poly what are inside of that abs box? thats way i tagged it to very hard, ive tried many things for now and no idea how to do it. |
Re: [Very Hard] Is origin inside of entity
That's most likely impossible, I believe HLEngine has no tools to set the entity's solid box by the model's shape.
You could probably give the entity some hitboxes and check if the point is in any of them, but I guess it won't be too amazing for what you're trying to achieve (as I'm sure you're not just throwing lego boxes around the map). |
Re: [Very Hard] Is origin inside of entity
If the entity is solid, you can use trace line. Just like unstuck methods (I guess)
|
Re: [Very Hard] Is origin inside of entity
Quote:
Also i think entity is still needed with trace line... now im having idea what sound crazy i know :) PHP Code:
1. set entity origin[0] -4096 origin[1] -4096 origin[2] -4096 2. wait, when touch is called check entity classnames and stuff and if it is that entity then 3. chuckdata[origin[0]][0] = 1; chuckdata[origin[1]][0] = 1; chuckdata[origin[2]][0] = 1 4. set entity origin[0] -4095 origin[1] -4096 origin[2] -4096 ... so then just check is point touching like that if( chuckdata[pointoriginZ][0] && chuckdata[pointoriginZ][1] && chuckdata[pointoriginZ][2] ) but the problem is that if i check all units in map with 100fps / 2 ( one frame will go to touch ) then time to take to complete this process is 491,52 sec ( 8 minutes ) so basically players need wait 8 minutes before they can play? : ) ( why 100 fps?, because my local game ( where i test ) fps is 100, server will be more than 100fps i think.. ) is there native to check touch? ( then i can do this in loop ) edit: @pokemonmaster I find this here engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr) it does not need angles and such stuff like normal trace need, i test it mayby youre right and it can be done with that. also is it good to call this tracehull 60-100 time per sec? EDIT2: I did tried this but no luck o1 is point entity origin engfunc(EngFunc_TraceHull, o1, o1, 0, HULL_POINT, 0, t) pn_print( 1, "%d :: %d", get_tr2(t, TR_StartSolid), get_tr2(t, TR_AllSolid) ) I just dont know how to use this : / Little help guys? ;( EDIT3: My entity is SOLID_TRIGGER |
Re: [Very Hard] Is origin inside of entity
TraceHull seems a good option though, use hull_point and same origin as start and end, and check if pHit is your entity index. You may have to set your entity SOLID_smth_more_than_trigger during the trace and to set it back to trigger after.
|
| All times are GMT -4. The time now is 10:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.