(solved) Collision box definition

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

(solved) Collision box definition

by taikedz » Sat Sep 03, 2016 18:50

Hello

I am trying to find where collision_box is defined, and what its individual numbers represaent but cannot seem to see either in rubenwardy's guide nor on dev.minetest wiki any formal/detailed description....

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},


I tried changing them all to 1 or 2 on a test entity but the collision box remained the same.

What do the numbers mean...?
Last edited by taikedz on Sat Sep 10, 2016 17:03, edited 1 time in total.
 

User avatar
qwertymine3
Member
 
Posts: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: Collision box definition

by qwertymine3 » Sat Sep 03, 2016 19:36

The numbers define the two corners of the box that the player collides with. These are relative the to center of the entity. The center of the entity is the position you get if you call get_pos().

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
collisionbox = { --[[first corner]] x,y,z, --[[second corner]] x,y,z}
collisionbox = { x,y,z,x2,y2,z2}


The sample you gave would produce a 1*1 meter collision box where the center of the entity is in the middle of the
collision box.

2D representations:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
0.5|0.5
+-----+
|     | 0.5
|  o  | -
|     | 0.5
+-----+

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-----+ <(0.5,0.5)
|     |
|  o  |    o = center of entity
|     |
+-----+
^(-0.5,-0.5)
Avatar by :devnko-ennekappao:
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: Collision box definition

by taikedz » Sat Sep 03, 2016 20:31

qwertymine3 wrote:The numbers define the two corners of the box that the player collides with. These are relative the to center of the entity. The center of the entity is the position you get if you call get_pos().


Great thanks - I am pretty sure the brief trials I did ddin't make a diference, but if your notes are indeed the case, then I should probably look harder!

EDIT -- it was due to a typo. Grr.

Cheers
Last edited by taikedz on Sun Sep 04, 2016 17:43, edited 2 times in total.
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Collision box definition

by azekill_DIABLO » Sun Sep 04, 2016 11:33

i encounter the same issue. i can't change the collision box. "collisionbox = {-0.2,-0.4,-0.2, 0.2,0.35,0.2}," still gives me a basic 1*1*1 box.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Collision box definition

by azekill_DIABLO » Sun Sep 04, 2016 11:49

oh sorry i found my error

'collsion_box' instead of 'collisionbox'
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron