| 1 |
{%MainUnit castlevectors.pas} |
| 2 |
{ |
| 3 |
Copyright 2017-2022 Michalis Kamburelis. |
| 4 |
|
| 5 |
This file is part of "Castle Game Engine". |
| 6 |
|
| 7 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 8 |
included in this distribution, for details about the copyright. |
| 9 |
|
| 10 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
---------------------------------------------------------------------------- |
| 15 |
} |
| 16 |
|
| 17 |
{ Miscellaneous stuff for CastleVectors. } |
| 18 |
|
| 19 |
{$ifdef read_interface} |
| 20 |
|
| 21 |
type |
| 22 |
{ Vector of 4 Pointers. } |
| 23 |
TVector4Pointer = packed record |
| 24 |
X, Y, Z, W: Pointer; |
| 25 |
end; |
| 26 |
|
| 27 |
EPlanesParallel = class(Exception); |
| 28 |
ELinesParallel = class(Exception); |
| 29 |
|
| 30 |
const |
| 31 |
{ Epsilon used by default when compating Single (Single-precision float values). |
| 32 |
Compatible with Math unit value, used by standard routines like Math.SameValue |
| 33 |
and Math.IsZero. } |
| 34 |
SingleEpsilon = 1E-4; |
| 35 |
|
| 36 |
{ Epsilon used by default when compating Double (Double-precision float values). |
| 37 |
Compatible with Math unit value, used by standard routines like Math.SameValue |
| 38 |
and Math.IsZero. } |
| 39 |
DoubleEpsilon = 1E-12; |
| 40 |
|
| 41 |
SingleEqualityEpsilon = SingleEpsilon deprecated 'use SingleEpsilon'; |
| 42 |
DoubleEqualityEpsilon = DoubleEpsilon deprecated 'use DoubleEpsilon'; |
| 43 |
ExtendedEqualityEpsilon = 1E-16 deprecated 'use only Math functions, like SameValue and IsZero, to operate on Extended type; CastleVectors unit does not deal with Extended type anymore'; |
| 44 |
|
| 45 |
{$endif read_interface} |
| 46 |
|
| 47 |
{$ifdef read_implementation} |
| 48 |
|
| 49 |
{ Separated from PointsDistance2DSqr, to not slow it down by implicit |
| 50 |
try/finally section because we use string. } |
| 51 |
procedure PointsDistance2DSqr_InvalidIgnoreIndex; |
| 52 |
begin |
| 53 |
raise EInternalError.Create('Invalid IgnoreIndex for PointsDistance2DSqr'); |
| 54 |
end; |
| 55 |
|
| 56 |
{$endif read_implementation} |