Tag Info

Hot answers tagged

5

No, there's no way to do this. What you're looking for is a container, that holds references to rectangles that are insides its bounds. This isn't an easy thing to do when you really think about it. There is no way for the rectangle object to know any other rectangle object exists, let alone know if one is inside of it or not. However, there is a few data ...


2

This is more of a design decision, since objects are implicitly references in Java, so it really doesn't make much difference to be copying an extra reference. I'd suggest you just do whatever works first and then, if you feel you need to, start to optimise/change things and see if you get a better result. That's the best way to learn.


2

you are in a voxel engine which means that each box should have a discrete x, y and z coordinate thus: if you have a box at index (x, y, z) then you can get all neighbouring boxes by getting the boxes at index (x, y +/- 1, z), (x +/- 1, y, z) and (x, y, z +/- 1) edit: after some more info... just detect the collisions for a line between the center of the ...


1

I have a 'full width UI' script that deduces the aspect ratio of the screen relative to some reference screen dimensions, and adds a scale to the transform to compensate for a change in aspect ratio. Then I build my UI to the reference screen dimensions (in my case 1024 x 768). At runtime, the actual screen width is asked for, and the adjustment ratio ...


1

Collision callbacks are explained in http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Collision_Callbacks_and_Triggers. This translates quite straightforward to JBullet. However if you have already tried and failed to follow that, I'll just provide the code I have been using myself. First set-up a callback that is called on every physics ...


1

As far as I know, most programs will separate geometry for rendering from geometry for physics. (This is because rendered models can be incredibly detailed, and hit testing against each polygon will take way longer than say, a couple quadtree intersection tests.) If you're using a small number of simple rectangles, you could simply test each rectangle ...


1

Well what I do for my 2D game is that inside of checking before the players moves, I deal with collision after the player moves. Before I used to run into problems like yours because of the fact that when you check before hand, you stop the player from moving. Heres what you have to do, lets say that there is a block at some x, y, width and height ...


1

With only the given information I would assume one of a few scenarios is happening here: Something very mysterious because you provided very little information Your player is on the enemy layer and subsequently the ray immediately hits the player You are not setting up your EnemyLayer variable correctly. To filter a Raycast based on layer you need to set ...


1

You stated that it will be a MMO game - don't do this kind of stuff client-side. You will have problems with cheaters, because it's fairly easy to modify your code so they can fly/no-clip etc. If your terrain is heightmap-based just prepare your world so you have all of the objects inserted (houses, trees etc.) and generate some kind of mask which will ...



Only top voted, non community-wiki answers of a minimum length are eligible