13-04-20, 18:47 | #1 |
Member
Joined: Jan 2013
Posts: 276
|
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? Last edited by Ranpyon; 13-04-20 at 18:48. |
13-04-20, 20:17 | #2 | |
Member
Joined: May 2010
Posts: 1,187
|
Taken from above tutorial:
Quote:
|
|
14-04-20, 11:17 | #3 |
Member
Joined: Jan 2013
Posts: 276
|
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.
Thanks! |
14-04-20, 11:38 | #4 |
Member
Joined: May 2010
Posts: 1,187
|
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.
|
14-04-20, 12:28 | #5 | |
Member
Joined: Apr 2012
Posts: 10,346
|
I know Krystian already answered, but:
Quote:
|
|
14-04-20, 18:59 | #6 |
Member
Joined: Mar 2019
Posts: 687
|
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
|
14-04-20, 19:05 | #7 | |
Member
Joined: Mar 2012
Posts: 3,741
|
Well it seems you haven't read the posts just above...
Quote:
|
|
14-04-20, 20:48 | #8 |
Member
Joined: Mar 2019
Posts: 687
|
|
15-04-20, 08:45 | #9 |
Member
Joined: Jan 2013
Posts: 276
|
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? 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. |
15-04-20, 09:40 | #10 |
Member
Joined: May 2010
Posts: 1,187
|
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. Last edited by Krystian; 15-04-20 at 09:43. |
Thread Tools | |
|
|