Small test of the PolyModule : http://indiepath.com/tim/vector_test.rar
Here's the code :
Here's the code :
Import indiepath.projmatrix Import indiepath.poly SetGraphicsDriver GLMax2DDriver() Graphics 640,480,0 'Graphics 480,360,0 ProjectionMatrix.Initialise(640,480) SetBlend(ALPHABLEND) Global BurnIn:Timage = LoadImage("screen512.png",FILTEREDIMAGE) Global Dot3:TImage = LoadAnimImage("glowing_dot_64.png",64,64,0,4) Global Ship:iPoly = iPoly.Load("ship009",100,100,$FFFFFF,1,ALPHABLEND,14,False) Global Ship2:iPoly = Ship.Duplicate() Ship.Scale(0.6,0.6) Ship.VisSet(1) Ship2.ColorSet($99aaFF) Ship2.WidthSet(18) Ship2.BlendSet(LIGHTBLEND) While Not KeyHit(KEY_ESCAPE) Cls Local hull = False If KeyDown(KEY_H) hull = True SetBlend(ALPHABLEND) SetAlpha(1) SetColor 205,205,255 DrawImageRect(BurnIn,0,0,640,480) Ship.Turn(3) Ship2.Turn(-1) Ship2.Position(MouseX(),MouseY()) iPoly.DrawAll(Dot3,3,hull) TPoly._Begin() TPoly.GlowingLine(Dot3,0,300,100,500,300,20) TPoly._End() If iPoly.PolyOverlap(ship,ship2) Then DrawText("PolyOverlap : Collision",0,0) Else DrawText("PolyOverlap : No Collision",0,0) EndIf Local rx#,ry# If Ship2.RayIntersect(300,100,500,300,rx#,ry#) DrawText "RayIntersect : "+rx+" : "+ry,0,20 'If Ship2.PointInside(MouseX(),MouseY()) DrawText "Inside",0,40 Flip '0 Wend