/[cvs]/rabit/RaBit's Rapid Racers/Class_TrackSegment.cls
ViewVC logotype

Contents of /rabit/RaBit's Rapid Racers/Class_TrackSegment.cls

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Tue Mar 12 21:23:10 2002 UTC (22 years, 9 months ago) by cvsrabit
Branch point for: NFO, MAIN
Initial revision

1 VERSION 1.0 CLASS
2 BEGIN
3 MultiUse = -1 'True
4 Persistable = 0 'NotPersistable
5 DataBindingBehavior = 0 'vbNone
6 DataSourceBehavior = 0 'vbNone
7 MTSTransactionMode = 0 'NotAnMTSObject
8 END
9 Attribute VB_Name = "Class_TrackSegment"
10 Attribute VB_GlobalNameSpace = False
11 Attribute VB_Creatable = True
12 Attribute VB_PredeclaredId = False
13 Attribute VB_Exposed = False
14 Option Explicit
15
16 ' --- public ----------------------------------------------------------------------------------------------
17
18 ' --- private --------------------------------------------------------------------------------------------
19
20 Private prvtpVecPoint1 As D3DVECTOR
21 Private prvtpVecPoint2 As D3DVECTOR
22 '
23
24 Public Sub SetPoints(tpVecPoint1 As D3DVECTOR, tpVecPoint2 As D3DVECTOR)
25
26 prvtpVecPoint1 = tpVecPoint1
27 prvtpVecPoint2 = tpVecPoint2
28
29 End Sub
30
31 Public Function GetSide(tpVecPoint As D3DVECTOR) As Boolean
32
33 Dim sgVsX As Single
34 Dim sgVsZ As Single
35
36 Dim sgVnX As Single
37 Dim sgVnZ As Single
38
39 Dim sgVpX As Single
40 Dim sgVpZ As Single
41
42 Dim sgScalar As Single
43
44 sgVsX = prvtpVecPoint2.X - prvtpVecPoint1.X ' Vs
45 sgVsZ = prvtpVecPoint2.Z - prvtpVecPoint1.Z
46
47 sgVnX = sgVsZ ' normal of Vs
48 sgVnZ = -sgVsX
49
50 sgVpX = tpVecPoint.X - prvtpVecPoint1.X ' Vs
51 sgVpZ = tpVecPoint.Z - prvtpVecPoint1.Z ' Vs
52
53 sgScalar = sgVpX * sgVnX + sgVpZ * sgVnZ
54
55 GetSide = sgScalar < 0
56
57 End Function

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed