Entity mins and maxs - how to set properly
I've difficulties in setting mins and maxs for an entity. I know how to apply them and I have worked with entities before. However, now I am making a plugin and the size of an entity must be precise otherwise the plugin will fail.
Is there any information available about what point in 3D field each min and max (both are arrays with 3 cells) point define and where is the null point (origin of the entity, ground?). I would prefer an image if possible. And how could I display this entity in-game if I am not planning to set a model to it (I guess render (set_rendering) would be sufficient, but is it going to work if entity has no model ?). I will appreciate any help. |
Re: Entity mins and maxs - how to set properly
http://www.faludi.com/images/blog/cube.jpg
Left bottom corner is mins and top right corner is maxs. The values are offsets from the center... example: Code:
entity_set_size(ent, Float:{-16.0, -16.0, 0.0}, Float:{16.0, 16.0, 32.0}) |
Re: Entity mins and maxs - how to set properly
Quote:
|
Re: Entity mins and maxs - how to set properly
If the origin is 0, 0, 0 then wouldn't it be in the center of the bottom face of the cube?
|
Re: Entity mins and maxs - how to set properly
It means, I must calculate both min and max values from the center of the box ?
For example, if I have a regular figure 30 units in lenght (X axis), 20 in width (Y axis) and 10 in height (Z axis) then proper mins are -15.0 ; -10.0 ; -5.0 and maxs are 15.0 ; 10.0 ; 5.0? edit: And what are the possibilities of displaying such entity ? |
Re: Entity mins and maxs - how to set properly
That's just the size of the collision box.
If you want to view it, you can send a couple of line messages that go from each coord to the other, making a box. See plugins like "Info Zone" and such that have visual editing stuff, I remember that having a "draw_box()" stock. |
Re: Entity mins and maxs - how to set properly
Quote:
http://i.imgur.com/s522R.png The origin is where those 3 lines intersect. The blue lines indicate the maxs, and the red lines indicate the mins. |
Re: Entity mins and maxs - how to set properly
Quote:
Meaning that: Code:
entity_set_size(ent, Float:{-16.0, -16.0, 0.0}, Float:{16.0, 16.0, 32.0})Code:
entity_set_size(ent, Float:{-16.0, -16.0, -16.0}, Float:{16.0, 16.0, 16.0}) |
Re: Entity mins and maxs - how to set properly
Quote:
However, the origin will be on the bottom of the box since it has no mins below it. |
Re: Entity mins and maxs - how to set properly
Thank you all for help, I found out everything I wanted :)
|
| All times are GMT -4. The time now is 23:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.