
How do I find blocks that are in the same spot(x, y, z wise) as me?
Posted Saturday, 1 October, 2011 - 01:44 by msz9 inFreeCamera.cs:
http://paste.ubuntu.com/700205/
Player.cs(it's camera.cs in the code because this is an old backup. Not much difference besides comments and the file name change though):
http://paste.ubuntu.com/700206/
Block.cs:
http://paste.ubuntu.com/700207/
Terrain.cs:
http://paste.ubuntu.com/700209/
Level.cs:
http://paste.ubuntu.com/700210/
I though I may need to post the code so I don't have to wait any longer for a response by pasting it later.
Anyway, instead of AABB crap which I don't understand, I want to be able to see "hey, there is a block in this x, y, z position" and I can see if it solid and then if it is not, you walk through it. Else, speed = 0;.
How would I find out if my x, y, z is shared by a block(which it always is, seeing how the air is filled with... air block :/)
So any ideas?


Comments
Re: How do I find blocks that are in the same spot(x, y, z ...
If this is some sort of Minecraft like thing then for each (x,y,z) location there is exactly one block, thus GetBlock(x,y,z).TerrainInfo.Solid should tell you if the block at (x,y,z) is solid or not.
Re: How do I find blocks that are in the same spot(x, y, z ...
I tried that, here is my code that failed:
Camera.cs new code:
FreeCamera.cs new code:
Location being a double and GetBlock uses ints, I had to convert it. It still won't work.
If I also try
MoveSpeed = 0;, it freezes me when I try to move with any key.