Changeset 117 for Include/abgl.ab
- Timestamp:
- Feb 22, 2007, 4:01:02 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/abgl.ab
r102 r117 43 43 This.Y=y 44 44 End Sub 45 Sub Vector2f(Vec As Vector2d) 46 This.X=Vec.X As GLfloat 47 This.Y=Vec.Y As GLfloat 48 End Sub 45 49 46 50 Public /* destructor */ … … 75 79 /* Function Operator * (SrcVec As Vector2f) As Vector2f 76 80 Return Dot(This,SrcVec) 77 End Function 78 */ 81 End Function*/ 79 82 Function Operator * (Src As GLint) As Vector2f 80 83 Dim ret As Vector2f(This.X*Src,This.Y*Src) … … 102 105 End Function 103 106 107 Function Operator == (Vec As Vector2f) As Boolean 108 If This.X=Vec.X and This.Y=Vec.Y Then 109 Return True 110 Else 111 Return False 112 End If 113 End Function 104 114 105 115 Public /* method */ 106 StaticFunction Add(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f116 Function Add(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f 107 117 Dim ret As Vector2f(SrcVec1.X+SrcVec2.X,SrcVec1.Y+SrcVec2.Y) 108 118 Return ret 109 119 End Function 110 StaticFunction Distance(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat120 Function Distance(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat 111 121 Dim ret As Vector2f 112 122 ret=SrcVec1-SrcVec2 113 123 Return ret.Magnitude 114 124 End Function 115 StaticFunction Dot(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat125 Function Dot(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat 116 126 Return SrcVec1.X*SrcVec2.X+SrcVec1.Y*SrcVec2.Y 117 127 End Function … … 127 137 Return ret 128 138 End Function 129 StaticFunction Substract(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f139 Function Substract(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f 130 140 Dim ret As Vector2f(SrcVec1.X-SrcVec2.X,SrcVec1.Y-SrcVec2.Y) 131 141 Return ret … … 154 164 xy.y=y 155 165 End Sub 166 Sub Vector2d(Vec As Vector2f) 167 This.X=Vec.X As GLdouble 168 This.Y=Vec.Y As GLdouble 169 End Sub 156 170 157 171 Public /* destructor */ … … 179 193 End Sub 180 194 Function Operator + (SrcVec As Vector2d) As Vector2d 181 Return Add(This,SrcVec 2)195 Return Add(This,SrcVec) 182 196 End Function 183 197 Function Operator - (SrcVec As Vector2d) As Vector2d 184 Return Substract(This,SrcVec 2)198 Return Substract(This,SrcVec) 185 199 End Function 186 200 /* Function Operator * (SrcVec As Vector2d) As Vector2d 187 Return Dot(This,SrcVec 2)201 Return Dot(This,SrcVec) 188 202 End Function*/ 189 190 203 Function Operator * (Src As GLint) As Vector2d 191 204 Dim ret As Vector2d(This.X*Src,SrcVec.Y*Src) … … 211 224 Dim ret As Vector2d(This.X/Src,SrcVec.Y/Src) 212 225 Return ret 226 End Function 227 228 Function Operator == (Vec As Vector2d) As Boolean 229 If This.X=Vec.X and This.Y=Vec.Y Then 230 Return True 231 Else 232 Return False 233 End If 213 234 End Function 214 235 … … 280 301 xyz.z=z 281 302 End Sub 303 Sub Vector3f(Vec As Vector3d) 304 This.X=Vec.X As GLfloat 305 This.Y=Vec.Y As GLfloat 306 This.Z=Vec.Z As GLfloat 307 End Sub 282 308 283 309 Public /* destructor */ … … 348 374 End Function 349 375 376 Function Operator == (Vec As Vector3f) As Boolean 377 If This.X=Vec.X and This.Y=Vec.Y and This.Z=Vec.Z Then 378 Return True 379 Else 380 Return False 381 End If 382 End Function 350 383 351 384 Public /* method */ … … 406 439 xyz.z=z 407 440 End Sub 441 Sub Vector3d(Vec As Vector3f) 442 This.X=Vec.X As GLdouble 443 This.Y=Vec.Y As GLdouble 444 This.Z=Vec.Z As GLdouble 445 End Sub 408 446 409 447 Public /* destructor */ … … 474 512 Dim ret As Vector3d(This.X/Src,This.Y/Src,This.Z/Src) 475 513 Return ret 514 End Function 515 516 Function Operator == (Vec As Vector3d) As Boolean 517 If This.X=Vec.X and This.Y=Vec.Y and This.Z=Vec.Z Then 518 Return True 519 Else 520 Return False 521 End If 476 522 End Function 477 523 … … 541 587 rgb.g = g 542 588 rgb.b = b 589 End Sub 590 Sub Color3f(color As Color3d) 591 rgba.r = color.R As GLfloat 592 rgba.g = color.G As GLfloat 593 rgba.b = color.B As GLfloat 543 594 End Sub 544 595 … … 667 718 rgb.b = b 668 719 End Sub 720 Sub Color3d(color As Color3f) 721 rgba.r = color.R As GLdouble 722 rgba.g = color.G As GLdouble 723 rgba.b = color.B As GLdouble 724 End Sub 669 725 670 726 Public /* destructor */ … … 799 855 rgba.a = a 800 856 End Sub 857 Sub Color4f(color As Color4d) 858 rgba.r = color.R As GLfloat 859 rgba.g = color.G As GLfloat 860 rgba.b = color.B As GLfloat 861 rgba.a = color.A As GLfloat 862 End Sub 801 863 802 864 Public /* destructor */ … … 875 937 Return ret 876 938 End Function 877 Static Function FromA RGB(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4f939 Static Function FromArgb(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4f 878 940 Dim ret As Color4f(r/255,g/255,b/255,a/255) 879 941 Return ret … … 938 1000 rgba.a = a 939 1001 End Sub 1002 Sub Color4d(color As Color4f) 1003 rgba.r = color.R As GLdouble 1004 rgba.g = color.G As GLdouble 1005 rgba.b = color.B As GLdouble 1006 rgba.a = color.A As GLdouble 1007 End Sub 940 1008 941 1009 Public /* destructor */ … … 1014 1082 Return ret 1015 1083 End Function 1016 Static Function FromA RGB(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4d1084 Static Function FromArgb(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4d 1017 1085 Dim ret As Color4d(r/255,g/255,b/255,a/255) 1018 1086 Return ret
Note:
See TracChangeset
for help on using the changeset viewer.