Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure vecRight(Vec.f, Ang.f, pAng.f)
- Protected A.f, B.f
- A = (Vec + Ang)
- If A >= 360
- If (pAng >= Vec And pAng <= 360.0)
- ProcedureReturn 1
- EndIf
- B = (A - 360.0)
- If (pAng >= 0.0 And pAng <= B)
- ProcedureReturn 1
- EndIf
- Else
- If (pAng >= Vec And pAng <= A)
- ProcedureReturn 1
- EndIf
- EndIf
- ProcedureReturn 0
- EndProcedure
- Procedure vecLeft(Vec.f, Ang.f, pAng.f)
- Protected A.f
- A = (Vec - Ang)
- If A <= 0
- If pAng >= 0 And pAng <= Vec
- ProcedureReturn 1
- EndIf
- B = (360.0 + A)
- If pAng >= B And pAng <= 360.0
- ProcedureReturn 1
- EndIf
- Else
- If (pAng >= Vec And pAng <= A)
- ProcedureReturn 1
- EndIf
- EndIf
- EndProcedure
- Procedure vecPoint(Vec.f, Lang.f, Rand.f, pAng.f)
- If vecRight(Vec.f, Rang.f, pAng.f)
- ProcedureReturn 1
- EndIf
- If vecLeft(Vec.f, Lang.f, pAng.f)
- ProcedureReturn 1
- EndIf
- ProcedureReturn 0
- EndProcedure
- Vec.f = 21.0 ; // Куда я двигаюсь
- Rang.f = 20.0
- Lang.f = 20.0
- pAng.f = 13.0
- Debug vecPoint(Vec.f, Lang.f, Rand.f, pAng.f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement