entity_set_size() Help / Model Solidification
Hmm I've been having issues with figuring out how the entity_set_size function works, and why there are two sets of coordinates.
Well...I just don't know what each x,y,z is used for so I ripped the function out of the source....and I'm still stuck... Now...I just don't understand WHY there are two sets of coords, and HOW they work...I've played around with them for at least a few hours and I'm still baffled. Now I have a theory....Tell me if I'm right or wrong... Is one set of origins for the size, then the other set for the angles its placed in at? ------- Second issue...I even PM'd Bailopan to try and figure this out, but for some reason, when you set a bounding box with this function, it keep the location the same always. The angle never changed and I'm stuck as to why it never changes... Here's the code I was using: Code:
The angle is set on the model of the ent, but not the bounding box. Do you think my theory comes into play? ------- Any help would be appreciated. Thanks. Code:
static cell AMX_NATIVE_CALL entity_set_size(AMX *amx, cell *params) |
Re: entity_set_size() Help / Model Solidification
min/max are offset vectors from the entity's current origin, I believe. Which is why it never changes.
|
Re: entity_set_size() Help / Model Solidification
Offset vectors? Explain please.
And why would something like this be even included in AMXX if I cannot really "work" with it :S. |
Re: entity_set_size() Help / Model Solidification
I'm not sure about the exact implementation or what I'm saying is correct, fyi. When I say offset vectors, it takes the entities current origin at w/e time and add those offsets to it to get the effect of a bounding box and do collision checks with the new vectors. You the values, I thought you just meant why doesn't it ever change (like when you move and stuff).
|
Re: entity_set_size() Help / Model Solidification
http://avalanche.epherion.com/images/bbox.jpg
Here's a bounding box, in two dimensions. The blue dot is the entity's origin. The red dot is the entity's "max size." The green dot is the entity's "minimum size." Since horizontally there are 24 pixels between the origin and the max size position, and vertically there are 48 pixels between the origin and the max size position, the max size (second parameter of EngFunc_SetSize) would be {24.0,48.0}. Similarly, since horizontally there are 24 pixels between the origin and the min size position, and vertically there are 48 pixels between the origin and the min size position, but in the opposite direction, the min size (first parameter of EngFunc_SetSize) would be {-24.0,-48.0}. Essentially, the mins and maxs are the distances from the origin of the entity to the two extreme corners of the bounding box of the entity. Note that in Half-Life, these are in 3D. |
Re: entity_set_size() Help / Model Solidification
All the meanings of "size" is just like Avalanche's post, a little supplement:
the entity "origin" is not all the entity's center in many case, it is the entity's "eye-position" which tie to the entity's model. for example, the "money-bag" model ( which use in my infinite money plugin) 's "origin" is at it's underside, that means it's "maxs" & "mins" size are not "symmetrical" parameter(z axis). http://cs-friends.com.cn/bbs/UploadF...4511591412.jpg |
Re: entity_set_size() Help / Model Solidification
Angle only changes how the entity model is rotated. It does not affect bounding box.
|
Re: entity_set_size() Help / Model Solidification
GG Half-Life.
|
Re: entity_set_size() Help / Model Solidification
You can always calculate it manually, but I'd wish you luck with that.
|
Re: entity_set_size() Help / Model Solidification
Quote:
|
| All times are GMT -4. The time now is 00:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.