EntityBox collisions

Blitz3D Forums/Blitz3D Programming/EntityBox collisions

_PJ_(Posted 2009) [#1]
While I was working how to ensure that any scaling applied to meshes is also reflected in the collision detection (hurrah for Blitz collisions .... ), I kinda hit a weird issue with EntityBox.
As you see in the program below, it seems as though the box isn't scaled up at all. Am I missing something?

Graphics3D 800,600
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,0,-10

light=CreateLight()
PositionEntity light,-50,50,-50

sphere=CreateSphere()
PositionEntity sphere,5,0,0
EntityType sphere,1

scale#=1

sphere1=CreateSphere()
PositionEntity sphere1,-3,0,0
EntityType sphere1,2
EntityRadius sphere1,1
EntityBox sphere1,EntityX#(sphere1,True),EntityY#(sphere1,True),EntityZ#(sphere1,True),MeshWidth#(sphere1),MeshHeight#(sphere1),MeshDepth#(sphere1)

Collisions 1,2,1,1

While Not KeyHit(1)
scale=1
If KeyDown(203) Then MoveEntity sphere,-0.1,0,0
If KeyDown(205) Then MoveEntity sphere,0.1,0,0
If KeyDown(200) Then scale=1.1
If KeyDown(208) Then scale=-0.9
ScaleMesh sphere,scale,scale,scale
EntityRadius sphere,MeshDepth#(sphere)/2
EntityBox sphere,EntityX#(sphere,True),EntityY#(sphere,True),EntityZ#(sphere,True),MeshWidth#(sphere),MeshHeight#(sphere),MeshDepth#(sphere)
UpdateWorld
RenderWorld

Flip

Wend
End



Stevie G(Posted 2009) [#2]
You're not using entitybox command correctly. See the manual, it includes an example which will help with the scaling issue:

http://www.blitzbasic.com/b3ddocs/command.php?name=EntityBox&ref=3d_a-z


_PJ_(Posted 2009) [#3]
Thanks, STevie - I guess I shoulda checked the online docs before posting DJ Woodgate's info and example is much clearer than the 'offline' BB Docs.

This has prompted me, actually, to update my offline docs with those found online. I wonder if anyone would find it helpful if I packaged these up-to-date-docs as a download to use in the blitz Help directory?


_PJ_(Posted 2009) [#4]
Well, I've gotten cracking with sorting the docs, adding some of the best algorithms and some snippets from the code archives and tutorials/examples like the one linked to above by the users here.

I included the Tokamak documentation by Bot-Builder, and Mark McVittie's 1.99 docs as well as added a link to the "Collisions" command in EntityCollisions
If anyone has any ideas of what else would eb suitable or good examples that can be used which may not be found in the manuals threads here, please let me know :)


_PJ_(Posted 2009) [#5]
I fixed a few broken links that seem to have cropped up. Particularly for scancodes.

Still open to ideas ;) (hint hint!)