Collision with Ground?

Blitz3D Forums/Blitz3D Beginners Area/Collision with Ground?

YellBellzDotCom(Posted 2007) [#1]
Man I dont understand this, I thought I had this setup correctly but evidently not. Can someone show the most basic code to setup object to ground collision? I cant believe this...

\code
Include "Globals.bb"

Graphics3D 1024,768,32,1
SetBuffer BackBuffer()


LoadModels()
Collisions Type_Car, Type_Track, 2, 3


While Not KeyHit(1)

PointEntity Cam,Sfere
;MoveEntity Car1,0,-.035,0
MoveEntity Sfere,0,-.035,0

UpdateWorld()
RenderWorld()

Flip False

Wend
ClearWorld
End


Function LoadModels()
Cam = CreateCamera()
PositionEntity Cam,30,30,-30

Lite = CreateLight()

Track1 = LoadAnimMesh("media\models\tracks\track1.b3d")
EntityType Track1,Type_Track
EntityPickMode Track1,2


Sfere = CreateSphere()
SferePiv = CreatePivot()
;ScaleEntity Sfere,.25,.25,.25
EntityColor Sfere,255,255,0
PositionEntity Sfere,30,50,0
PositionEntity SferePiv,30,2,0
EntityPickMode Sfere,2
EntityType SferePiv,Type_Car
EntityRadius SferePiv, 4
EntityParent Sfere, SferePiv


PointEntity Cam,Sfere



; Car1 = LoadAnimMesh("Media\models\cars\Test1.b3d")
; PositionEntity Car1,30,2,0
; EntityType Car1,Type_Car
; EntityRadius Car1, 10
; ScaleEntity Car1,.25,.25,.25
; EntityPickMode Car1,2

;
; PointEntity Cam,Car1



End Function
end code


big10p(Posted 2007) [#2]
Looks like you've forgotten to actually define Type_track and Type_Car anywhere - unless they're in that globals.bb include.


YellBellzDotCom(Posted 2007) [#3]
Oh yeah, sorry bout that. All the variables are stated in the globals.bb and I do have the types defined there. Thanks though big10p.

Im gonna take another look at this today, maybe I can fix this sober, hehehehe.