how to use entitybox ?

Blitz3D Forums/Blitz3D Beginners Area/how to use entitybox ?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Here is a sample I had help with a while back and here is
a pretty good explanation I got.
http://www.blitzbasic.com/codearcs/codearcs.php?code=944
;1. Since you scaled the cube by 6 (the cube was originally from -1 To 1
;on it's Local axis) the -6's are the start position of the collision
;box (since 0,0,0 is the exact centre of the cube, in it's Local axis of
; course)...

;Not sure If I have explained that clearly enough - but essentially the
;midpoint of the cube is 0,0,0 - using EntityBox you have To specify the
; start point of the collision box (ie. one corner) And tell it the size.
; In this Case the New scaled up corner is now -6,-6,-6 And the New size
;is 12,12,12. It's much easier To grasp this If you draw it on paper - in
;effect it means that your collision box can be anywhere relative To
;your actual geometry.

;2. The collision normal will always be of length 1. Now, since my
; was moving by 0.2 units Each frame I just scaled down this
;length To make an arbitrary but reasonable effect of pushing the boxes
;at half the speed of the player - ie. 1/10 = 0.1 - this gives the effect
;that the boxes have friction against the Floor.

;In your instance you are moving the character by 0.25 units Each
;frame - therefore If you divide the collision normal values by 4 you
; will be moving the boxes at the exact speed of the player (1/4 = 0.25).