devils shadow system

Blitz3D Forums/Blitz3D Userlibs/devils shadow system

ok i'm new to this shadow system and i'm having some issues.
first i get some very weird z-order like issue. also if i use setshadowmesh on my cube character it no longer participates in collisions. heres the code.
Function loadlevel()
MaskImage mouseim,0,0,0
Repeat 
Cls
DrawImage backim,0,0
DrawImage L1im,280,300
DrawImage mouseim,MouseX(),MouseY()
If ImagesOverlap (mouseim,MouseX(),MouseY(),L1im,280,300) And MouseHit(1)
levelnum=1
Exit
End If 
Flip
Until KeyHit(1)
Select levelnum
Case levelnum=1
Cls
loadlevel1()
Case levelnum=2
Return
End Select
End Function

Function loadlevel1()
InitShadows(cam)
Light=CreateShadowLight(3)
level=LoadShadowMesh("lev1.b3d", False)
UpdateNormals level
bounds=CopyEntity(level)
FlipMesh bounds
EntityType bounds,world
Restore level1data
Read goodienum
 For q=1 To goodienum
	 Read x
	 Read y
	 Read z
	 g.gbox=New gbox
	 g\x=x
	 g\y=y
	 g\z=z
	 g\e=CreateCube()
	 EntityAlpha g\e,.4
	 EntityTexture g\e,goodietex
	 PositionEntity g\e,g\x,g\y,g\z
	 EntityType g\e,goodie
 Next
EntityType level,world
End Function

Function updatecam()
dx#=(TFormedX()-EntityX(cam))*.08
dy#=(TFormedY()-EntityY(cam))*.01
dz#=(TFormedZ()-EntityZ(cam))*.08

TranslateEntity cam,dx,dy,dz

End Function

Function loadplayer()
c.char=New char
c\e=CreateCube()
SetShadowMesh(c\e,True,"cube.shd")
c\x=0
c\y=1
c\z=0
PositionEntity c\e,c\x,c\y,c\z
EntityType c\e,player
EntityParent itempiv,c\e
End Function

Function updatelevel()
For g.gbox=Each gbox
 TurnEntity g\e,.5,.5,.5

 For c.char=Each char
  If EntityCollided(c\e,goodie)
   HideEntity g\e
   c\i=g\i
  End If
 Next

 g\time=g\time+1
 If g\time>120 g\time=0
 If g\time=120 
  SeedRnd MilliSecs()
  ShowEntity g\e
  g\i=Rnd(5)
 End If 
Next
End Function

Function updateplayer()
For c.char= Each char
 TFormPoint 0,2,-4,c\e,0
 PointEntity cam,c\e
 If KeyDown(200)
  MoveEntity c\e,0,0,1
 ElseIf KeyDown(208)
  MoveEntity c\e,0,0,-1
 ElseIf KeyDown(203)
  TurnEntity c\e,0,1,0
 ElseIf KeyDown(205)
  TurnEntity c\e,0,-1,0
 EndIf
 LinePick EntityX(c\e),EntityY(c\e),EntityZ(c\e),0,-10,0
 AlignToVector c\e,PickedNX(),PickedNY(),PickedNZ(),2
 MoveEntity c\e,0,gravity,0
;ITEMS
 ;Select c\i
 ;Case c\i=1
 ; i.item=New item
 ; i\e=CreateSphere(8,itempiv)
 ; MoveEntity i\e,0,0,-2;        i'm still working on this
 ; EntityColor i\e,0,255,0
 ;End Select
 Next
End Function


This code does not run. These are only a bunch of functions and no main program or init part etc. You can't expect us to hack this.

oops heres the rest of the code
;thursday,feburary 14,2008
;R. Manwiller
Include "DevilShadowSystem.bb"
Include "ShadowVolumes.bb"
Include "UserInterface.bb"

Graphics3D 1280,1024,128,2
SetBuffer BackBuffer()
AppTitle "BATTLE CART"
HidePointer
frametimer=CreateTimer(60)

Type char
Field e,x,y,z,fx,fy,fz,i,hp,wins
End Type

Type item
Field e,i_type,x,y,z,prob
End Type

Type gbox
Field e,x,y,z,i,time
End Type

Include "globals.bb"

Const player=1,pickup=2,goodie=3,world=4,bottom=5
Collisions player,world,2,2
Collisions player,pickup,2,2
Collisions player,goodie,2,2
Collisions player,bottom,2,2

loadlevel()
loadplayer()

While Not KeyHit(1)

updateplayer()
;updateitems()
updatelevel()
updatecam()

Render(2,1)
UpdateWorld
Text 0,0,TrisRendered(),0,0
WaitTimer frametimer
Flip
Wend
End
Include "data.bb"
Include "functions.bb" 


this code still is incomplete.
please send the entire source code with media and everything. if you cant or dont want to post it here, jus email me :)

i'll email you the source and media.