AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to discover entity/model size? (https://forums.alliedmods.net/showthread.php?t=133097)

alexx109 07-21-2010 19:39

How to discover entity/model size?
 
Hello!

When I spawn entities with models I always wonder what size (mins and maxs) should i set it so no one can be able to pass throught it by usual ways...

There's any way to discover the model size to use with entity_set_size? Or should I just go on tryin' 'til i get a better result :x

I've tried with absmin and absmax, but it obviously didn't worked, cause absmin and absmax are origin[i] + mins[i] -1 and origin[i] + maxs[i] + 1 or something like that, and when we spawn an entity, maxs and mins are 0.00000 (all of them >.>), so, this is not a way...

The actual solution I got was making a plugin to measure the distance between 2 points horizontally (so i can divide it by 2 to get the mins and maxs 0 and 1) and vertically (to get the mins and max 2)...

Althought this does OK, i actually feel that this is not the correct way, or at least not the simplest way to measure the mins and maxs needed...

Does anyone knows a simplier way to do that?

joropito 07-21-2010 22:50

Re: How to discover entity/model size?
 
Quote:

Originally Posted by alexx109 (Post 1247290)
Hello!

When I spawn entities with models I always wonder what size (mins and maxs) should i set it so no one can be able to pass throught it by usual ways...

There's any way to discover the model size to use with entity_set_size? Or should I just go on tryin' 'til i get a better result :x

I've tried with absmin and absmax, but it obviously didn't worked, cause absmin and absmax are origin[i] + mins[i] -1 and origin[i] + maxs[i] + 1 or something like that, and when we spawn an entity, maxs and mins are 0.00000 (all of them >.>), so, this is not a way...

The actual solution I got was making a plugin to measure the distance between 2 points horizontally (so i can divide it by 2 to get the mins and maxs 0 and 1) and vertically (to get the mins and max 2)...

Althought this does OK, i actually feel that this is not the correct way, or at least not the simplest way to measure the mins and maxs needed...

Does anyone knows a simplier way to do that?


Open the model with model viewer, dump model info into txt file and see there hitboxes sizes.
You have to do some math with that...

alexx109 07-21-2010 22:56

Re: How to discover entity/model size?
 
Well i get things like this:

Code:


lots of stuff.....
...
 
 
Hitbox 1 Bone: 0
Hitbox 1 Group: 0
Hitbox 1 Bounding Box Min: -0.000016 -2.707704 -27.064304
Hitbox 1 Bounding Box Max: 15.237869 0.000000 27.064302
Hitbox 2 Bone: 1
Hitbox 2 Group: 0
Hitbox 2 Bounding Box Min: -36.090000 -18.329100 -34.799999
Hitbox 2 Bounding Box Max: 36.080002 34.549999 43.310001
Hitbox 3 Bone: 2
Hitbox 3 Group: 0
Hitbox 3 Bounding Box Min: -39.250000 -93.669998 -39.880001
Hitbox 3 Bounding Box Max: 39.230000 0.300000 48.889999
Hitbox 4 Bone: 3
Hitbox 4 Group: 0
Hitbox 4 Bounding Box Min: -12.853217 -14.020194 0.000000
Hitbox 4 Bounding Box Max: 12.853216 5.394288 2.372181
Hitbox 5 Bone: 4
Hitbox 5 Group: 0
Hitbox 5 Bounding Box Min: -14.560000 -25.709999 -10.800000
Hitbox 5 Bounding Box Max: 14.550000 5.130000 31.170000
Hitbox 6 Bone: 5
Hitbox 6 Group: 0
Hitbox 6 Bounding Box Min: -44.470001 -12.990000 -31.100000
Hitbox 6 Bounding Box Max: 44.450001 0.000000 32.720001
Hitbox 7 Bone: 6
Hitbox 7 Group: 0
Hitbox 7 Bounding Box Min: 0.000000 -39.478043 -31.950001
Hitbox 7 Bounding Box Max: 28.809999 3.690000 13.230000
Hitbox 8 Bone: 7
Hitbox 8 Group: 0
Hitbox 8 Bounding Box Min: -29.950001 -64.119003 -37.740002
Hitbox 8 Bounding Box Max: 22.090000 16.299999 31.480000
Hitbox 9 Bone: 8
Hitbox 9 Group: 0
Hitbox 9 Bounding Box Min: -21.580000 -69.790001 -27.200001
Hitbox 9 Bounding Box Max: 33.470001 5.970000 29.600000
Hitbox 10 Bone: 9
Hitbox 10 Group: 0
Hitbox 10 Bounding Box Min: -34.430000 -58.360001 -38.360001
Hitbox 10 Bounding Box Max: 32.369999 1.340000 26.680000
Hitbox 11 Bone: 10
Hitbox 11 Group: 0
Hitbox 11 Bounding Box Min: -28.790001 -39.478027 -31.930000
Hitbox 11 Bounding Box Max: 0.000009 3.680000 13.220000
Hitbox 12 Bone: 11
Hitbox 12 Group: 0
Hitbox 12 Bounding Box Min: -22.100000 -64.119019 -37.740002
Hitbox 12 Bounding Box Max: 29.940001 16.299999 31.490000
Hitbox 13 Bone: 12
Hitbox 13 Group: 0
Hitbox 13 Bounding Box Min: -33.480000 -69.800003 -27.200001
Hitbox 13 Bounding Box Max: 21.570000 5.970000 29.610001
Hitbox 14 Bone: 13
Hitbox 14 Group: 0
Hitbox 14 Bounding Box Min: -32.369999 -58.360001 -38.380001
Hitbox 14 Bounding Box Max: 34.430000 1.340000 26.660000
Hitbox 15 Bone: 14
Hitbox 15 Group: 0
Hitbox 15 Bounding Box Min: -23.160000 -66.820000 -33.310001
Hitbox 15 Bounding Box Max: 26.760000 0.790000 32.220001
Hitbox 16 Bone: 15
Hitbox 16 Group: 0
Hitbox 16 Bounding Box Min: -23.889999 -63.950001 -26.770000
Hitbox 16 Bounding Box Max: 23.090000 5.810000 32.980000
Hitbox 17 Bone: 16
Hitbox 17 Group: 0
Hitbox 17 Bounding Box Min: -29.549999 -32.860001 -19.629999
Hitbox 17 Bounding Box Max: 29.230000 6.670000 57.549999
Hitbox 18 Bone: 17
Hitbox 18 Group: 0
Hitbox 18 Bounding Box Min: -31.430000 -66.820000 -33.310001
Hitbox 18 Bounding Box Max: 23.170000 0.790000 32.220001
Hitbox 19 Bone: 18
Hitbox 19 Group: 0
Hitbox 19 Bounding Box Min: -23.080000 -63.959999 -26.770000
Hitbox 19 Bounding Box Max: 23.900000 5.810000 32.980000
Hitbox 20 Bone: 19
Hitbox 20 Group: 0
Hitbox 20 Bounding Box Min: -29.219999 -32.860001 -19.629999
Hitbox 20 Bounding Box Max: 29.570000 6.670000 57.549999
 
...
more stuff

i'll try to figure out some math, but if u could give me a clue >.>


All times are GMT -4. The time now is 07:09.

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