Changeset 117 for Include/abgl.ab


Ignore:
Timestamp:
Feb 22, 2007, 4:01:02 AM (18 years ago)
Author:
NoWest
Message:

Vector関連のクラスで原因不明のバグが発生中。。。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/abgl.ab

    r102 r117  
    4343        This.Y=y
    4444    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
    4549
    4650Public /* destructor */
     
    7579/*  Function Operator * (SrcVec As Vector2f) As Vector2f
    7680        Return Dot(This,SrcVec)
    77     End Function
    78 */
     81    End Function*/
    7982    Function Operator * (Src As GLint) As Vector2f
    8083        Dim ret As Vector2f(This.X*Src,This.Y*Src)
     
    102105    End Function
    103106
     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
    104114
    105115Public /* method */
    106     Static Function Add(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f
     116    Function Add(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f
    107117        Dim ret As Vector2f(SrcVec1.X+SrcVec2.X,SrcVec1.Y+SrcVec2.Y)
    108118        Return ret
    109119    End Function
    110     Static Function Distance(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat
     120    Function Distance(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat
    111121        Dim ret As Vector2f
    112122        ret=SrcVec1-SrcVec2
    113123        Return ret.Magnitude
    114124    End Function
    115     Static Function Dot(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat
     125    Function Dot(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As GLfloat
    116126        Return SrcVec1.X*SrcVec2.X+SrcVec1.Y*SrcVec2.Y
    117127    End Function
     
    127137        Return ret
    128138    End Function
    129     Static Function Substract(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f
     139    Function Substract(SrcVec1 As Vector2f, SrcVec2 As Vector2f) As Vector2f
    130140        Dim ret As Vector2f(SrcVec1.X-SrcVec2.X,SrcVec1.Y-SrcVec2.Y)
    131141        Return ret
     
    154164        xy.y=y
    155165    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
    156170
    157171Public /* destructor */
     
    179193    End Sub
    180194    Function Operator + (SrcVec As Vector2d) As Vector2d
    181         Return Add(This,SrcVec2)
     195        Return Add(This,SrcVec)
    182196    End Function
    183197    Function Operator - (SrcVec As Vector2d) As Vector2d
    184         Return Substract(This,SrcVec2)
     198        Return Substract(This,SrcVec)
    185199    End Function
    186200/*  Function Operator * (SrcVec As Vector2d) As Vector2d
    187         Return Dot(This,SrcVec2)
     201        Return Dot(This,SrcVec)
    188202    End Function*/
    189 
    190203    Function Operator * (Src As GLint) As Vector2d
    191204        Dim ret As Vector2d(This.X*Src,SrcVec.Y*Src)
     
    211224        Dim ret As Vector2d(This.X/Src,SrcVec.Y/Src)
    212225        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
    213234    End Function
    214235
     
    280301        xyz.z=z
    281302    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
    282308
    283309Public /* destructor */
     
    348374    End Function
    349375
     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
    350383
    351384Public /* method */
     
    406439        xyz.z=z
    407440    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
    408446
    409447Public /* destructor */
     
    474512        Dim ret As Vector3d(This.X/Src,This.Y/Src,This.Z/Src)
    475513        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
    476522    End Function
    477523
     
    541587        rgb.g = g
    542588        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
    543594    End Sub
    544595
     
    667718        rgb.b = b
    668719    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
    669725
    670726Public /* destructor */
     
    799855        rgba.a = a
    800856    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
    801863
    802864Public /* destructor */
     
    875937        Return ret
    876938    End Function
    877     Static Function FromARGB(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4f
     939    Static Function FromArgb(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4f
    878940        Dim ret As Color4f(r/255,g/255,b/255,a/255)
    879941        Return ret
     
    9381000        rgba.a = a
    9391001    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
    9401008
    9411009Public /* destructor */
     
    10141082        Return ret
    10151083    End Function
    1016     Static Function FromARGB(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4d
     1084    Static Function FromArgb(a As GLubyte, r As GLubyte, g As GLubyte, b As GLubyte) As Color4d
    10171085        Dim ret As Color4d(r/255,g/255,b/255,a/255)
    10181086        Return ret
Note: See TracChangeset for help on using the changeset viewer.