![]() |
Bridge custom collisions
It's been a long time that I try to follow the chapter about bridge collisions here https://www.tombraiderforums.com/sho...d.php?t=212038, but simply I can't get it.
Until now I've always catched the right depth collisions by chance, but now I want do understand. Since I want to apply a depth of 4 clicks to a Bridge_flat (let's say I want a box), how can I set it? |
Taken from above tutorial:
Quote:
|
Unfortunately I still don't understand. But I've found that the OCB depth for one click is 1024, so for 4 clicks is enough to multiply 1024*4, so 4096. That's what I needed. :o
Thanks! |
The "unit" of the depth is 1/4 of a click (64 "game units"), so for each click there are 4 "depth units". And for one sector there would be 4*4 = 16 depth units. However, as stated in the formula, the depth value must be multiplied by 256. So if you want a 4 click depth, you have 256*16 depth units, which gives 4096. :D
|
I know Krystian already answered, but:
Quote:
|
in the game code, a click is 256, so if you want for example a pushblock size, you just need to set 1024 which is 4 click for a pushblock :)
|
Well it seems you haven't read the posts just above... :p
Quote:
|
Quote:
|
I've kinda of understood now, thank you.
But I still find it quite complicated: wouldn't it be easier if it was said that, as a starting point for example, the depth for one click is 1024? :ponder: In this way it would be easier to calculate more or less deep depths. In fact in my level I also have a slim tilt1 bridge (about an half click): setting 512 was perfect for its depth. And, as I repeat, 4096 was perfect for a 1x1 sector cube. |
Yes, it's true that 1/4 click would be 256 and to get just bigger depths you can multiply that value by how many quarter-clicks are in that depth. So for 1 sector it's 16, and 16*256 is 4096.
I was just trying to explain the formula, that's given for the bridges. Notice that aside from depth you can also specify some other flags, for example if you want to enable hanging from bridge, on top of the calculated depth value (like 4096) you must also add the 64 flag, so you would get 4096 + 64 = 4160. To you this may simply seem like adding two numbers together, but there is a particular reason why the depth value must be multiplied by 256 and can't be represented by the default "game units". Without going into much detail, if going by the "game units" depth, to get 1/4 click, you would need to enter 64. But 64 Is already reserved for the "Enable hanging" feature. And if you add them, you get 128, which is reserved for "No sliding" feature. So to avoid this, the depth values have this strange calculation. ;) |
All times are GMT. The time now is 10:32. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.