|
Veteran Member
|

05-29-2013
, 17:28
Re: Getting brush entity height
|
#1
|
Quote:
Originally Posted by ConnorMcLeod
Send SetOrigin or SetSize, set pev_origin has no effect.
Anyway, origin is not used with brush entities, so for your start and end trace position, you have to deal with absmin and absmax.
|
uh, still having problems with that
PHP Code:
static Float:end[3], Float:end2[3], tr, Float:dd
pev( ent, pev_absmax, o6 )
pev( ent, pev_absmin, v )
xs_vec_sub( o1, Float:{ 0.0, 0.0, -9999.0 }, end )
engfunc( EngFunc_TraceLine, o1, end, IGNORE_MONSTERS, 0, tr )
get_tr2( tr, TR_vecEndPos, end )
set_pev( ent, pev_movetype, MOVETYPE_TOSS )
set_pev( ent, pev_solid, SOLID_BBOX )
set_pev( ent, pev_absmin, o6 )
entity_set_origin(ent, Float:{ 0.2,0.2,0.2})
// entity_set_size(ent, o6, v) // this say that min/max backwards:: it was bacwards, i fix it but still setting size not helping.
// also, each time when this code run somehow the entity size (absmin&max) get bigger every time, caused by entity_set_size
xs_vec_sub( end, Float:{ 0.0, 0.0, 9999.0 }, end2 )
engfunc( EngFunc_TraceLine, end, end2, IGNORE_MONSTERS, 0, tr )
get_tr2( tr, TR_vecEndPos, end2 )
dd = end2[2] - o1[2]
pn_print( 1, "dist:%f org: %f/%f(%f)/%f", dd, end[2], end2[2], ps(id, ps_water_height), o1[2] )
// ps(id, ps_water_height) return a value here entity height should be.
// because brush entity can have many heights i cant use it because i can get ohter heights, only the higher point.
entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER)
entity_set_int(ent, EV_INT_movetype, MOVETYPE_NOCLIP)
set_pev( ent, pev_absmin, o6 )
entity_set_origin(ent, Float:{ 0.1,0.1,0.1})
// entity_set_size(ent, o6, v)
Mayby i didint get that what you exacly meant.
Last edited by .Dare Devil.; 05-29-2013 at 17:35.
|
|