Collisions (bah!)

Blitz3D Forums/Blitz3D Programming/Collisions (bah!)

_PJ_(Posted 2005) [#1]
Im having real difficulty trying to get EntityBox to be of any use. Whatever values I use, don't seem to represent the effeccts I see in the program.

Here's what I have anyway (I removed references to Loading texture files so it should just run as-is.)

Hopefully it should be clear enough whats going on, the EntityBox lines are withing the CreateWall function and at the Initialisation stage where the camera is set.

Any help offered here will be immensely appreciated!




Stevie G(Posted 2005) [#2]
Note that the EntityBox command should be used in a similar way to FitMesh ... so for a centered cube of length 1 unit size if would be EntityBox, entity,-.5,-.5,-.5,1,1,1.

I haven't really looked at your code so I'm not sure if that helps. Also, I don't think that the entitybox aligns with the entity during rotations ... could be wrong though as I never use them.

Stevie


_PJ_(Posted 2005) [#3]
Well although all the wall meshes are slightly deformed, tey still fit roughly to blitz-unit coords. This is all I need for collisions, just the blitz units, Each wall segment has an approximate square base, and are not rotatetd anyway, so rotations shouldnt matter.

I gathered that EntityBox sizes should represent blitz units as the coords, but in practice it doesnt seem so - thats my problem. I wonder if the EntityBox coordinates relate to the centre of me wall segemnts.. this might have something to do with it...


big10p(Posted 2005) [#4]
Of course EntityBox uses blitz units - what else would it use? :)

To elaborate on what Stevie G showed you, the first 3 params of EntityBox are used to say where a corner (any corner) of the box is, relative to the centre of the mesh. The final 3 params specify where the opposite corner of the box is, relative to the first corner.

Well, that's how I remember it working, anyway - it's been a while. The docs for EntityBox are sparse and somewhat misleading, it has to be said.


Stevie G(Posted 2005) [#5]
This bit of code is a bit strange and makes very little sense to me as you arent freeing the added mesh. If your going to add all the meshes together then you must use the sphere to poly collision as sphere to box will definately not work. You have unused meshes all over the place?!


If f>1
				AddMesh Map(f),Map(f-1)
			EndIf




Anyway, I fiddled about with this for a bit but got nowhere as the code is a wee bit messy ;) I changed and simplified a few things and this works. Hope it helps.






octothorpe(Posted 2005) [#6]
[codebox]


Stevie G(Posted 2005) [#7]
Oops ...


_PJ_(Posted 2005) [#8]
Hey thanks Stevie, yeah it is messy, because it started out just as quick little something whic developed quite well.. I hope to incorporate it as a game engine soon -

Well I had to re-do my head-bobbing code (hence the funcs for walking) and add in again the morphing of the walls (whicch I know caused a lot of collision headaches with irregular verts and camera bbbing), but thanks because of using the entityradius and different collision methods really made a difference.

Ive got it running now with the colisions working fine thanks again.

Thanks again!


Damien Sturdy(Posted 2005) [#9]
hehe, one thing:


wonder if the EntityBox coordinates relate to the centre of me wall segemnts.. this might have something to do with it...



They do.

Glad its fixed :)


_PJ_(Posted 2005) [#10]
thanks Cygnus! That makes a lot of sense now ;)


Damien Sturdy(Posted 2005) [#11]
No prob. ANother note is that they DO rotate with the mesh.

Spherical/eliptical collisions don't.


Stevie G(Posted 2005) [#12]
Your welcome mate. Good luck with your Dungeon Master clone?!


_PJ_(Posted 2005) [#13]
Yes it is! A kinda Dungeon Master/Bloodwych type game (to be!) Hopefully with a few little extra's thrown in!

Cheers!