zemu 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/zemu/config.rb +312 -0
- data/lib/zemu/instance.rb +179 -0
- data/lib/zemu.rb +172 -0
- data/src/debug.c +118 -0
- data/src/debug.h +30 -0
- data/src/external/Z/API/Z/ABIs/generic/allocator.h +36 -0
- data/src/external/Z/API/Z/ABIs/generic/cipher.h +47 -0
- data/src/external/Z/API/Z/ABIs/generic/data codec.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/emulation.h +103 -0
- data/src/external/Z/API/Z/ABIs/generic/hash function.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/module.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/wave codec.h +40 -0
- data/src/external/Z/API/Z/classes/base/InitializerList.hpp +34 -0
- data/src/external/Z/API/Z/classes/base/OpaqueFunctionPointer.hpp +26 -0
- data/src/external/Z/API/Z/classes/base/OpaqueMemberFunctionPointer.hpp +26 -0
- data/src/external/Z/API/Z/classes/base/Pair.hpp +46 -0
- data/src/external/Z/API/Z/classes/base/Range.hpp +111 -0
- data/src/external/Z/API/Z/classes/base/SizedString.hpp +66 -0
- data/src/external/Z/API/Z/classes/base/Status.hpp +89 -0
- data/src/external/Z/API/Z/classes/base/Symbol.hpp +39 -0
- data/src/external/Z/API/Z/classes/base/Tuple.hpp +111 -0
- data/src/external/Z/API/Z/classes/base/Value2D.hpp +389 -0
- data/src/external/Z/API/Z/classes/base/Value3D.hpp +368 -0
- data/src/external/Z/API/Z/classes/buffering/RingBuffer.hpp +93 -0
- data/src/external/Z/API/Z/classes/buffering/TripleBuffer.hpp +68 -0
- data/src/external/Z/API/Z/classes/functional/Functor.hpp +265 -0
- data/src/external/Z/API/Z/classes/functional/MemberFunction.hpp +98 -0
- data/src/external/Z/API/Z/classes/functional/ObjectMemberFunction.hpp +172 -0
- data/src/external/Z/API/Z/classes/functional/ObjectSelector.hpp +219 -0
- data/src/external/Z/API/Z/classes/functional/Selector.hpp +146 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABB.hpp +81 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABR.hpp +685 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Box.hpp +219 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Circle.hpp +80 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line2D.hpp +93 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line3D.hpp +80 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Rectangle.hpp +675 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Sphere.hpp +0 -0
- data/src/external/Z/API/Z/classes/memory/Shared.hpp +90 -0
- data/src/external/Z/API/Z/constants/base.h +35 -0
- data/src/external/Z/API/Z/constants/chemical elements.h +6385 -0
- data/src/external/Z/API/Z/constants/numbers.h +963 -0
- data/src/external/Z/API/Z/constants/version.h +15 -0
- data/src/external/Z/API/Z/formats/character set/ASCII.h +158 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP437.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP737.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP775.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP850.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP852.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP855.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP857.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP858.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP860.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP861.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP862.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP863.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP864.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP865.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP866.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP869.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP872.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP874.h +159 -0
- data/src/external/Z/API/Z/formats/character set/Unicode.h +30119 -0
- data/src/external/Z/API/Z/formats/data model/I16LP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/ILP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/ILP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/IP16L32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LLP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/SILP64.h +19 -0
- data/src/external/Z/API/Z/formats/file system/FAT12.h +61 -0
- data/src/external/Z/API/Z/formats/floating-point/IEEE 754.h +141 -0
- data/src/external/Z/API/Z/formats/floating-point/x87.h +74 -0
- data/src/external/Z/API/Z/formats/image/ICNS.h +39 -0
- data/src/external/Z/API/Z/formats/keymap/Mac OS.h +284 -0
- data/src/external/Z/API/Z/formats/keymap/Z.h +141 -0
- data/src/external/Z/API/Z/formats/multimedia/Creative Voice.h +106 -0
- data/src/external/Z/API/Z/formats/multimedia/Microsoft Wave.h +49 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ACH.h +44 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/FRZ.h +54 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/PRG.h +33 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SEM.h +46 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SIT.h +34 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNA.h +117 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNP.h +37 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SP.h +62 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/Z80.h +117 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX.h +56 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX82.h +70 -0
- data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/UNIF.h +26 -0
- data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/iNES.h +76 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/TAP.h +25 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/TZX.h +1185 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/Warajevo TAP.h +32 -0
- data/src/external/Z/API/Z/formats/storage medium image/floppy disk/FDI.h +45 -0
- data/src/external/Z/API/Z/functions/base/Z2D.h +583 -0
- data/src/external/Z/API/Z/functions/base/Z3D.h +712 -0
- data/src/external/Z/API/Z/functions/base/ZRange.h +137 -0
- data/src/external/Z/API/Z/functions/base/all.h +16 -0
- data/src/external/Z/API/Z/functions/base/casting.hpp +37 -0
- data/src/external/Z/API/Z/functions/base/character.h +38 -0
- data/src/external/Z/API/Z/functions/base/constructors.h +326 -0
- data/src/external/Z/API/Z/functions/base/structure.hpp +26 -0
- data/src/external/Z/API/Z/functions/base/type.hpp +60 -0
- data/src/external/Z/API/Z/functions/base/value.h +1901 -0
- data/src/external/Z/API/Z/functions/base/value.hpp +112 -0
- data/src/external/Z/API/Z/functions/buffering/ZRingBuffer.h +85 -0
- data/src/external/Z/API/Z/functions/buffering/ZTripleBuffer.h +65 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z2DLine.h +179 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z3DLine.h +168 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABB.h +361 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABR.h +1081 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZBox.h +340 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZCircle.h +142 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZRectangle.h +1267 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZSphere.h +156 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/all.h +18 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/constructors.h +620 -0
- data/src/external/Z/API/Z/functions/time/date.h +29 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/6502.h +90 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/Z80.h +245 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/i4004.h +37 -0
- data/src/external/Z/API/Z/hardware/PSG/General Instrument/AY-3-891x.h +180 -0
- data/src/external/Z/API/Z/hardware/VDC/Ricoh/RP2C0x.h +625 -0
- data/src/external/Z/API/Z/hardware/bus/AGP.h +24 -0
- data/src/external/Z/API/Z/hardware/bus/USB.h +510 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Inves Spectrum +.h +47 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Pentagon.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Scorpion.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum + 128K.h +158 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +.h +82 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2A.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +3.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum.h +109 -0
- data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (NTSC).h +29 -0
- data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (PAL).h +29 -0
- data/src/external/Z/API/Z/hardware/machine/platform/computer/ZX Spectrum.h +405 -0
- data/src/external/Z/API/Z/hardware/machine/platform/console/Game Boy.h +49 -0
- data/src/external/Z/API/Z/hardware/machine/platform/console/Nintendo Entertainment System.h +350 -0
- data/src/external/Z/API/Z/hardware/storage medium/ROM cartridge/SNES Game Pak.h +238 -0
- data/src/external/Z/API/Z/inspection/C/completion.h +178 -0
- data/src/external/Z/API/Z/inspection/C/modules/C11.h +41 -0
- data/src/external/Z/API/Z/inspection/C/modules/C18.h +13 -0
- data/src/external/Z/API/Z/inspection/C/modules/C89.h +19 -0
- data/src/external/Z/API/Z/inspection/C/modules/C90.h +13 -0
- data/src/external/Z/API/Z/inspection/C/modules/C94.h +15 -0
- data/src/external/Z/API/Z/inspection/C/modules/C99.h +29 -0
- data/src/external/Z/API/Z/inspection/C/modules/KR C.h +19 -0
- data/src/external/Z/API/Z/inspection/C++/completion.h +512 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++03.h +15 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++11.h +80 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++14.h +26 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++17.h +55 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++85.h +11 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++89.h +13 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++98.h +17 -0
- data/src/external/Z/API/Z/inspection/C++.h +78 -0
- data/src/external/Z/API/Z/inspection/C.h +79 -0
- data/src/external/Z/API/Z/inspection/CPU/completion.h +56 -0
- data/src/external/Z/API/Z/inspection/CPU/detection.h +714 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/6502.h +25 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/AArch32.h +32 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/AArch64.h +32 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/Z80.h +26 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/x86-32.h +31 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/x86-64.h +312 -0
- data/src/external/Z/API/Z/inspection/CPU.h +209 -0
- data/src/external/Z/API/Z/inspection/OS/completion.h +36 -0
- data/src/external/Z/API/Z/inspection/OS/detection.h +768 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Linux.h +22 -0
- data/src/external/Z/API/Z/inspection/OS/modules/MS-DOS.h +16 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Mac OS X.h +23 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Windows.h +19 -0
- data/src/external/Z/API/Z/inspection/OS/modules/iPhone OS.h +23 -0
- data/src/external/Z/API/Z/inspection/OS.h +236 -0
- data/src/external/Z/API/Z/inspection/Objective-C/completion.h +8 -0
- data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v1.0.h +11 -0
- data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v2.0.h +15 -0
- data/src/external/Z/API/Z/inspection/Objective-C.h +51 -0
- data/src/external/Z/API/Z/inspection/Z.h +19 -0
- data/src/external/Z/API/Z/inspection/build.h +22 -0
- data/src/external/Z/API/Z/inspection/character set.h +66 -0
- data/src/external/Z/API/Z/inspection/compiler/completion.h +2885 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Apple LLVM.h +26 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Clang.h +1664 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/GCC.h +1366 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/SCCZ80.h +473 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Visual C++.h +606 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/cc65.h +529 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/generic.h +13 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/template.h +650 -0
- data/src/external/Z/API/Z/inspection/compiler.h +299 -0
- data/src/external/Z/API/Z/inspection/data model/completion.h +128 -0
- data/src/external/Z/API/Z/inspection/data model/deduction.h +9 -0
- data/src/external/Z/API/Z/inspection/data model/detection.h +45 -0
- data/src/external/Z/API/Z/inspection/data model.h +362 -0
- data/src/external/Z/API/Z/inspection/floating-point/completion.h +50 -0
- data/src/external/Z/API/Z/inspection/floating-point.h +324 -0
- data/src/external/Z/API/Z/inspection/language.h +163 -0
- data/src/external/Z/API/Z/inspection/platform/detection.h +9 -0
- data/src/external/Z/API/Z/inspection/platform.h +29 -0
- data/src/external/Z/API/Z/keys/C++.h +27 -0
- data/src/external/Z/API/Z/keys/C.h +29 -0
- data/src/external/Z/API/Z/keys/CPU.h +80 -0
- data/src/external/Z/API/Z/keys/OS.h +182 -0
- data/src/external/Z/API/Z/keys/Objective-C.h +17 -0
- data/src/external/Z/API/Z/keys/chemistry.h +26 -0
- data/src/external/Z/API/Z/keys/compiler.h +178 -0
- data/src/external/Z/API/Z/keys/data model.h +32 -0
- data/src/external/Z/API/Z/keys/endianness.h +24 -0
- data/src/external/Z/API/Z/keys/language.h +21 -0
- data/src/external/Z/API/Z/keys/layout.h +20 -0
- data/src/external/Z/API/Z/keys/mathematics/geometry.h +29 -0
- data/src/external/Z/API/Z/keys/mathematics/number.h +21 -0
- data/src/external/Z/API/Z/keys/order.h +18 -0
- data/src/external/Z/API/Z/keys/platform.h +87 -0
- data/src/external/Z/API/Z/keys/program.h +39 -0
- data/src/external/Z/API/Z/keys/science/chemical elements.h +200 -0
- data/src/external/Z/API/Z/keys/science/electricity.h +18 -0
- data/src/external/Z/API/Z/keys/science/magnetism.h +19 -0
- data/src/external/Z/API/Z/keys/status.h +69 -0
- data/src/external/Z/API/Z/keys/text.h +27 -0
- data/src/external/Z/API/Z/keys/value.h +88 -0
- data/src/external/Z/API/Z/macros/arguments.h +25 -0
- data/src/external/Z/API/Z/macros/casting.h +22 -0
- data/src/external/Z/API/Z/macros/character.h +159 -0
- data/src/external/Z/API/Z/macros/date.h +14 -0
- data/src/external/Z/API/Z/macros/key.h +20 -0
- data/src/external/Z/API/Z/macros/language.h +126 -0
- data/src/external/Z/API/Z/macros/language.hpp +81 -0
- data/src/external/Z/API/Z/macros/members.h +86 -0
- data/src/external/Z/API/Z/macros/pasting.h +308 -0
- data/src/external/Z/API/Z/macros/pointer.h +33 -0
- data/src/external/Z/API/Z/macros/repetition.h +283 -0
- data/src/external/Z/API/Z/macros/structure.h +104 -0
- data/src/external/Z/API/Z/macros/templating.h +407 -0
- data/src/external/Z/API/Z/macros/tokens.h +14 -0
- data/src/external/Z/API/Z/macros/type enumeration.h +43 -0
- data/src/external/Z/API/Z/macros/type selection.hpp +76 -0
- data/src/external/Z/API/Z/macros/value.h +489 -0
- data/src/external/Z/API/Z/macros/variadic pasting.h +21 -0
- data/src/external/Z/API/Z/macros/variadic selection.h +56 -0
- data/src/external/Z/API/Z/macros/variadic.h +46 -0
- data/src/external/Z/API/Z/macros/version.h +17 -0
- data/src/external/Z/API/Z/network/3/IP.h +36 -0
- data/src/external/Z/API/Z/network/4/TCP.h +24 -0
- data/src/external/Z/API/Z/network/4/UDP.h +26 -0
- data/src/external/Z/API/Z/network/7/ED2K.h +104 -0
- data/src/external/Z/API/Z/network/7/HTTP.h +100 -0
- data/src/external/Z/API/Z/traits/SelectType.hpp +71 -0
- data/src/external/Z/API/Z/traits/TernaryType.hpp +20 -0
- data/src/external/Z/API/Z/traits/Type.hpp +4516 -0
- data/src/external/Z/API/Z/traits/TypeCount.hpp +52 -0
- data/src/external/Z/API/Z/traits/TypeList.hpp +376 -0
- data/src/external/Z/API/Z/traits/base.hpp +19 -0
- data/src/external/Z/API/Z/traits/filtering.hpp +30 -0
- data/src/external/Z/API/Z/traits/mathematics.hpp +48 -0
- data/src/external/Z/API/Z/types/arguments.h +19 -0
- data/src/external/Z/API/Z/types/base.h +1655 -0
- data/src/external/Z/API/Z/types/base.hpp +169 -0
- data/src/external/Z/API/Z/types/buffering.h +27 -0
- data/src/external/Z/API/Z/types/mathematics.h +135 -0
- data/src/external/Z/API/Z/types/time.h +23 -0
- data/src/external/Z/COPYING.LESSER +165 -0
- data/src/external/Z/development/Qt Creator/Z.pro +253 -0
- data/src/external/Z/distribution/CocoaPods/Zeta.podspec +18 -0
- data/src/external/Z/distribution/Gentoo Linux/Zeta-0.1.ebuild +22 -0
- data/src/external/Z/distribution/Gentoo Linux/metadata.xml +8 -0
- data/src/external/Z/distribution/Homebrew/Zeta.rb +11 -0
- data/src/external/z80/API/emulation/CPU/Z80.h +201 -0
- data/src/external/z80/README.md +229 -0
- data/src/external/z80/building/premake4.lua +33 -0
- data/src/external/z80/development/Xcode/Z80.xcodeproj/project.pbxproj +520 -0
- data/src/external/z80/sources/Z80.c +1660 -0
- data/src/interrupt.c +6 -0
- data/src/interrupt.h +3 -0
- data/src/io.c.erb +115 -0
- data/src/io.h.erb +18 -0
- data/src/main.c +69 -0
- data/src/memory.c.erb +43 -0
- data/src/memory.h.erb +9 -0
- metadata +329 -0
@@ -0,0 +1,219 @@
|
|
1
|
+
/* Z Kit - classes/mathematics/geometry/euclidean/Box.hpp
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_classes_mathematics_geometry_euclidean_Box_HPP_
|
9
|
+
#define _Z_classes_mathematics_geometry_euclidean_Box_HPP_
|
10
|
+
|
11
|
+
#include <Z/classes/base/Value3D.hpp>
|
12
|
+
#include <Z/types/mathematics.h>
|
13
|
+
|
14
|
+
|
15
|
+
#define Z_IMPLEMENTATION_COMMON \
|
16
|
+
\
|
17
|
+
typedef typename ZTypeFixedSigned(ZBox, T) Base; \
|
18
|
+
Value3D<T> point, size; \
|
19
|
+
\
|
20
|
+
Z_INLINE Box() Z_DEFAULTED({}) \
|
21
|
+
\
|
22
|
+
\
|
23
|
+
Z_CT(CPP11) Box(const Value3D<T> &point, const Value3D<T> &size) \
|
24
|
+
: point(point), size(size) {} \
|
25
|
+
\
|
26
|
+
\
|
27
|
+
Z_CT(CPP11) Box(const Value3D<T> &point, T size_x, T size_y, T size_z) \
|
28
|
+
: point(point), size(size_x, size_y, size_z) {} \
|
29
|
+
\
|
30
|
+
\
|
31
|
+
Z_CT(CPP11) Box(const Value3D<T> &point, T size_xyz) \
|
32
|
+
: point(point), size(size_xyz) {} \
|
33
|
+
\
|
34
|
+
\
|
35
|
+
Z_CT(CPP11) Box(T point_x, T point_y, T point_z, const Value3D<T> &size) \
|
36
|
+
: point(point_x, point_y, point_z), size(size) {} \
|
37
|
+
\
|
38
|
+
\
|
39
|
+
Z_CT(CPP11) Box(T point_x, T point_y, T point_z, T size_x, T size_y, T size_z) \
|
40
|
+
: point(point_x, point_y, point_z), size(size_x, size_y, size_z) {} \
|
41
|
+
\
|
42
|
+
\
|
43
|
+
Z_CT(CPP11) Box(T point_x, T point_y, T point_z, T size_xyz) \
|
44
|
+
: point(point_x, point_y, point_z), size(size_xyz) {} \
|
45
|
+
\
|
46
|
+
\
|
47
|
+
Z_CT(CPP11) Box(T point_xyz, const Value3D<T> &size) \
|
48
|
+
: point(point_xyz), size(size) {} \
|
49
|
+
\
|
50
|
+
\
|
51
|
+
Z_CT(CPP11) Box(const Value3D<T> &size) \
|
52
|
+
: point(T(0)), size(size) {} \
|
53
|
+
\
|
54
|
+
\
|
55
|
+
Z_CT(CPP11) Box(T size_x, T size_y, T size_z) \
|
56
|
+
: point(T(0)), size(size_x, size_y, size_z) {} \
|
57
|
+
\
|
58
|
+
\
|
59
|
+
Z_CT(CPP11) Box(T size_xyz) \
|
60
|
+
: point(T(0)), size(size_xyz) {} \
|
61
|
+
\
|
62
|
+
\
|
63
|
+
static Z_CT(CPP14) Box from_vertices(const Value3D<T> &a, const Value3D<T> &b) \
|
64
|
+
{ \
|
65
|
+
Value3D<T> minimum = a.minimum(b); \
|
66
|
+
\
|
67
|
+
return Box(minimum, a.maximum(b) - minimum); \
|
68
|
+
} \
|
69
|
+
\
|
70
|
+
\
|
71
|
+
Z_CT(CPP11) operator Boolean() const {return point || size;} \
|
72
|
+
Z_INLINE operator Base& () const {return *((Base *)this);} \
|
73
|
+
\
|
74
|
+
\
|
75
|
+
Z_CT(CPP11) Boolean operator ==(const Box &rhs) const \
|
76
|
+
{return point == rhs.point && size == rhs.size;} \
|
77
|
+
\
|
78
|
+
\
|
79
|
+
Z_CT(CPP11) Boolean operator !=(const Box &rhs) const \
|
80
|
+
{return point != rhs.point || size != rhs.size;} \
|
81
|
+
\
|
82
|
+
\
|
83
|
+
/* Intersection */ \
|
84
|
+
Z_CT(CPP14) Box operator &(const Box &rhs) const \
|
85
|
+
{ \
|
86
|
+
T x1, x2, y1, y2, z1, z2; \
|
87
|
+
\
|
88
|
+
return (x1 = maximum<T>(point.x, rhs.point.x)) < \
|
89
|
+
(x2 = minimum<T>(point.x + size.x, rhs.point.x + rhs.size.x)) && \
|
90
|
+
(y1 = maximum<T>(point.y, rhs.point.y)) < \
|
91
|
+
(y2 = minimum<T>(point.y + size.y, rhs.point.y + rhs.size.y)) && \
|
92
|
+
(z1 = maximum<T>(point.z, rhs.point.z)) < \
|
93
|
+
(z2 = minimum<T>(point.z + size.z, rhs.point.z + rhs.size.z)) \
|
94
|
+
\
|
95
|
+
? Box(x1, y1, z1, x2 - x1, y2 - y1, z2 - z1) \
|
96
|
+
: Box(T(0)); \
|
97
|
+
} \
|
98
|
+
\
|
99
|
+
\
|
100
|
+
/* Union */ \
|
101
|
+
Z_CT(CPP14) Box operator |(const Box &rhs) const \
|
102
|
+
{ \
|
103
|
+
Box result; \
|
104
|
+
\
|
105
|
+
result.point = point.minimum(rhs.point); \
|
106
|
+
result.size = (point + size).maximum(rhs.point + rhs.size) - result.point; \
|
107
|
+
return result; \
|
108
|
+
} \
|
109
|
+
\
|
110
|
+
\
|
111
|
+
Z_INLINE Box &operator &=(const Box &rhs) {return *this = *this & rhs;} \
|
112
|
+
Z_INLINE Box &operator |=(const Box &rhs) {return *this = *this | rhs;} \
|
113
|
+
\
|
114
|
+
Z_CT(CPP11) Box operator +(const Value3D<T> &rhs) const {return Box(point + rhs, size);} \
|
115
|
+
Z_CT(CPP11) Box operator -(const Value3D<T> &rhs) const {return Box(point - rhs, size);} \
|
116
|
+
Z_CT(CPP11) Box operator *(const Value3D<T> &rhs) const {return Box(point * rhs, size);} \
|
117
|
+
Z_CT(CPP11) Box operator /(const Value3D<T> &rhs) const {return Box(point / rhs, size);} \
|
118
|
+
\
|
119
|
+
Z_INLINE Box &operator +=(const Value3D<T> &rhs) {return *this = *this + rhs;} \
|
120
|
+
Z_INLINE Box &operator -=(const Value3D<T> &rhs) {return *this = *this - rhs;} \
|
121
|
+
Z_INLINE Box &operator *=(const Value3D<T> &rhs) {return *this = *this * rhs;} \
|
122
|
+
Z_INLINE Box &operator /=(const Value3D<T> &rhs) {return *this = *this / rhs;} \
|
123
|
+
\
|
124
|
+
Z_CT(CPP11) Box operator +(T rhs) const {return Value3D<T>(point + rhs, size);} \
|
125
|
+
Z_CT(CPP11) Box operator -(T rhs) const {return Value3D<T>(point - rhs, size);} \
|
126
|
+
Z_CT(CPP11) Box operator *(T rhs) const {return Value3D<T>(point * rhs, size);} \
|
127
|
+
Z_CT(CPP11) Box operator /(T rhs) const {return Value3D<T>(point / rhs, size);} \
|
128
|
+
\
|
129
|
+
Z_INLINE Box &operator +=(T rhs) {return *this = *this + rhs;} \
|
130
|
+
Z_INLINE Box &operator -=(T rhs) {return *this = *this - rhs;} \
|
131
|
+
Z_INLINE Box &operator *=(T rhs) {return *this = *this * rhs;} \
|
132
|
+
Z_INLINE Box &operator /=(T rhs) {return *this = *this / rhs;} \
|
133
|
+
\
|
134
|
+
\
|
135
|
+
Z_CT(CPP11) Value3D<T> center() const \
|
136
|
+
{return point + size / T(2);} \
|
137
|
+
\
|
138
|
+
\
|
139
|
+
Z_CT(CPP11) Boolean contains(const Box &other) const \
|
140
|
+
{ \
|
141
|
+
return !other.size.has_zero() && \
|
142
|
+
other.point >= point && other.point + other.size <= point + size; \
|
143
|
+
} \
|
144
|
+
\
|
145
|
+
\
|
146
|
+
/*Z_CT(CPP11) Boolean contains(const AABB<T> &aabb) const \
|
147
|
+
{ \
|
148
|
+
return aabb.a.x != aabb.b.x && aabb.a.y != aabb.b.y && aabb.a.z != aabb.b.z && \
|
149
|
+
aabb.a >= point && aabb.b <= point + size; \
|
150
|
+
}*/ \
|
151
|
+
\
|
152
|
+
\
|
153
|
+
Z_CT(CPP11) Boolean contains(const Value3D<T> &point) const \
|
154
|
+
{return point >= this->point && point < this->point + this->size;} \
|
155
|
+
\
|
156
|
+
\
|
157
|
+
Z_CT(CPP11) Boolean intersects(const Box &other) const \
|
158
|
+
{ \
|
159
|
+
return !size.has_zero() && !other.size.has_zero() && \
|
160
|
+
other.point + other.size > point && other.point < point + size; \
|
161
|
+
} \
|
162
|
+
\
|
163
|
+
\
|
164
|
+
Z_CT(CPP11) Boolean is_zero() const \
|
165
|
+
{return point.is_zero() && size.is_zero();} \
|
166
|
+
\
|
167
|
+
\
|
168
|
+
Z_INLINE Box &correct() \
|
169
|
+
{ \
|
170
|
+
if (size.x < T(0)) point.x -= (size.x = -size.x); \
|
171
|
+
if (size.y < T(0)) point.y -= (size.y = -size.y); \
|
172
|
+
if (size.z < T(0)) point.z -= (size.z = -size.z); \
|
173
|
+
return *this; \
|
174
|
+
} \
|
175
|
+
\
|
176
|
+
\
|
177
|
+
Z_INLINE void swap(Box &other) \
|
178
|
+
{Zeta::swap<Base>((Base *)this, (Base *)&other);} \
|
179
|
+
};}
|
180
|
+
|
181
|
+
|
182
|
+
namespace Zeta {
|
183
|
+
template <class T, UInt T_number_set = Type<T>::number_set> struct Box {};
|
184
|
+
|
185
|
+
|
186
|
+
template <class T> struct Box<T, Z_NUMBER_SET_Z> {
|
187
|
+
Z_IMPLEMENTATION_COMMON
|
188
|
+
};
|
189
|
+
|
190
|
+
|
191
|
+
template <class T> struct Box<T, Z_NUMBER_SET_R> {
|
192
|
+
Z_IMPLEMENTATION_COMMON
|
193
|
+
|
194
|
+
|
195
|
+
Z_CT(CPP11) Value3D<T> absolute_point_to_unit(const Value3D<T> &point) const
|
196
|
+
{return (point - this->point) / this->size;}
|
197
|
+
|
198
|
+
|
199
|
+
/*Z_CT(CPP11) Boolean contains(const Sphere<T> &sphere) const
|
200
|
+
{
|
201
|
+
return sphere.radius != T(0) &&
|
202
|
+
sphere.point - sphere.radius >= point &&
|
203
|
+
sphere.point + sphere.radius <= point + size;
|
204
|
+
}*/
|
205
|
+
|
206
|
+
|
207
|
+
/*Z_CT(CPP11) Sphere<T> inner_sphere() const
|
208
|
+
{return Sphere<T>(center(), size.inner_minimum() / T(2));}*/
|
209
|
+
|
210
|
+
|
211
|
+
Z_CT(CPP11) Value3D<T> unit_point_to_absolute(const Value3D<T> &point) const
|
212
|
+
{return point * this->size + this->point;}
|
213
|
+
};
|
214
|
+
}
|
215
|
+
|
216
|
+
|
217
|
+
#undef Z_IMPLEMENTATION_COMMON
|
218
|
+
|
219
|
+
#endif // _Z_classes_mathematics_geometry_euclidean_Box_HPP_
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/* Z Kit - classes/mathematics/geometry/euclidean/Rectangle.hpp
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_classes_mathematics_geometry_euclidean_Rectangle_HPP_
|
9
|
+
#define _Z_classes_mathematics_geometry_euclidean_Rectangle_HPP_
|
10
|
+
|
11
|
+
#include <Z/classes/base/Value2D.hpp>
|
12
|
+
#include <Z/types/mathematics.h>
|
13
|
+
|
14
|
+
|
15
|
+
namespace Zeta {template <class T> struct Circle {
|
16
|
+
|
17
|
+
typedef typename ZTypeFixedReal(ZCircle, T) Base;
|
18
|
+
|
19
|
+
Value2D<T> point;
|
20
|
+
T radius;
|
21
|
+
|
22
|
+
|
23
|
+
Z_INLINE Circle() Z_DEFAULTED({})
|
24
|
+
|
25
|
+
Z_CT(CPP11) Circle(const Value2D<T> &point, T radius) : point(point), radius(radius) {}
|
26
|
+
Z_CT(CPP11) Circle(T x, T y, T radius) : point(x, y), radius(radius) {}
|
27
|
+
|
28
|
+
Z_INLINE Circle(const Base &circle) {(*(Base *)this) = circle;}
|
29
|
+
|
30
|
+
|
31
|
+
Z_CT(CPP11) Boolean operator ==(const Circle &circle) const
|
32
|
+
{return point.x == circle.point.x && point.y == circle.point.y && radius == circle.radius;}
|
33
|
+
|
34
|
+
|
35
|
+
Z_CT(CPP11) Boolean operator !=(const Circle &circle) const
|
36
|
+
{return point.x != circle.point.x || point.y != circle.point.y || radius != circle.radius;}
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
Z_INLINE ZAABR##Type z_circle_##type##_inner_aabr(ZCircle##Type object) \
|
42
|
+
{ \
|
43
|
+
z##type half_size = object.radius / _(Z_SQUARE_ROOT_2); \
|
44
|
+
\
|
45
|
+
return z_aabr_##type \
|
46
|
+
(object.point.x - half_size, object.point.y - half_size, \
|
47
|
+
object.point.x + half_size, object.point.x + half_size); \
|
48
|
+
} \
|
49
|
+
\
|
50
|
+
\
|
51
|
+
Z_INLINE ZRectangle##Type z_circle_##type##_inner_rectangle(ZCircle##Type object) \
|
52
|
+
{ \
|
53
|
+
z##type half_size = object.radius / _(Z_SQUARE_ROOT_2); \
|
54
|
+
z##type size = half_size * _(2.0); \
|
55
|
+
\
|
56
|
+
return z_rectangle_##type \
|
57
|
+
(object.point.x - half_size, object.point.y - half_size, size, size); \
|
58
|
+
} \
|
59
|
+
\
|
60
|
+
\
|
61
|
+
|
62
|
+
|
63
|
+
Z_CT(CPP11) Boolean is_zero() const
|
64
|
+
{return radius == T(0) && point.is_zero();}
|
65
|
+
|
66
|
+
|
67
|
+
Z_CT(CPP11) AABR<T> outer_aabr() const
|
68
|
+
{return AABR<T>(point - radius, point + radius);}
|
69
|
+
|
70
|
+
|
71
|
+
Z_CT(CPP11) Rectangle<T> outer_rectangle() const
|
72
|
+
{return Rectangle<T>(point - radius, radius * T(2));}
|
73
|
+
|
74
|
+
|
75
|
+
Z_INLINE void swap(Circle &circle)
|
76
|
+
{Zeta::swap<Base>((Base *)this, (Base *)&circle);}
|
77
|
+
};}
|
78
|
+
|
79
|
+
|
80
|
+
#endif // _Z_classes_mathematics_geometry_euclidean_Rectangle_HPP_
|
@@ -0,0 +1,93 @@
|
|
1
|
+
/* Z Kit - classes/mathematics/geometry/euclidean/Line2D.hpp
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_classes_mathematics_geometry_euclidean_Line2D_HPP_
|
9
|
+
#define _Z_classes_mathematics_geometry_euclidean_Line2D_HPP_
|
10
|
+
|
11
|
+
#include <Z/classes/base/Value2D.hpp>
|
12
|
+
#include <Z/types/mathematics.h>
|
13
|
+
|
14
|
+
|
15
|
+
#define Z_IMPLEMENTATION_COMMON \
|
16
|
+
\
|
17
|
+
typedef typename ZTypeFixedSigned(Z2DLine, T) Base; \
|
18
|
+
Value2D<T> a, b; \
|
19
|
+
\
|
20
|
+
Z_INLINE Line2D() Z_DEFAULTED({}) \
|
21
|
+
\
|
22
|
+
Z_CT(CPP11) Line2D(const Value2D<T> &a, const Value2D<T> &b) : a(a), b(b) {} \
|
23
|
+
Z_CT(CPP11) Line2D(const Value2D<T> &a, T b_x, T b_y) : a(a), b(b_x, b_y) {} \
|
24
|
+
Z_CT(CPP11) Line2D(const Value2D<T> &a, T b_xy) : a(a), b(b_xy) {} \
|
25
|
+
Z_CT(CPP11) Line2D(T a_x, T a_y, const Value2D<T> &b) : a(a_x, a_y), b(b) {} \
|
26
|
+
Z_CT(CPP11) Line2D(T a_x, T a_y, T b_x, T b_y) : a(a_x, a_y), b(b_x, b_y) {} \
|
27
|
+
Z_CT(CPP11) Line2D(T a_xy, T b_x, T b_y) : a(a_xy), b(b_x, b_y) {} \
|
28
|
+
Z_CT(CPP11) Line2D(T a_xy, const Value2D<T> &b) : a(a_xy), b(b) {} \
|
29
|
+
Z_CT(CPP11) Line2D(const Value2D<T> &b) : a(T(0)), b(b) {} \
|
30
|
+
Z_CT(CPP11) Line2D(T b_x, T b_y) : a(T(0)), b(b_x, b_y) {} \
|
31
|
+
Z_CT(CPP11) Line2D(T b_xy) : a(T(0)), b(b_xy) {} \
|
32
|
+
\
|
33
|
+
Z_INLINE Line2D(const Base &line) {(*(Base *)this) = line;} \
|
34
|
+
\
|
35
|
+
Z_CT(CPP11) Boolean operator ==(const Line2D &line) const {return a == line.a && b == line.b;} \
|
36
|
+
Z_CT(CPP11) Boolean operator !=(const Line2D &line) const {return a != line.a || b != line.b;} \
|
37
|
+
\
|
38
|
+
\
|
39
|
+
Z_CT(CPP11) Boolean is_perpendicular(const Line2D &line) const \
|
40
|
+
{return ((a.b - a.a).is_perpendicular(line.b - line.a));} \
|
41
|
+
\
|
42
|
+
\
|
43
|
+
Z_CT(CPP11) Boolean is_zero() const \
|
44
|
+
{return a.is_zero() && b.is_zero();} \
|
45
|
+
\
|
46
|
+
\
|
47
|
+
Z_CT(CPP11) Line2D reverse() const \
|
48
|
+
{return Line2D(b, a);} \
|
49
|
+
\
|
50
|
+
\
|
51
|
+
Z_INLINE void swap(Line2D &line) \
|
52
|
+
{Zeta::swap<Base>((Base *)this, (Base *)&line);} \
|
53
|
+
\
|
54
|
+
\
|
55
|
+
Z_CT(CPP11) Value2D<T> segment_center() const \
|
56
|
+
{return a.middle(b);}
|
57
|
+
|
58
|
+
|
59
|
+
namespace Zeta {
|
60
|
+
template <class T, UInt T_number_set = Type<T>::number_set> struct Line2D {};
|
61
|
+
|
62
|
+
|
63
|
+
template <class T> struct Line2D<T, Z_NUMBER_SET_Z> {
|
64
|
+
Z_IMPLEMENTATION_COMMON
|
65
|
+
};
|
66
|
+
|
67
|
+
|
68
|
+
template <class T> struct Line2D<T, Z_NUMBER_SET_R> {
|
69
|
+
Z_IMPLEMENTATION_COMMON
|
70
|
+
|
71
|
+
|
72
|
+
Z_CT(CPP14) Boolean segment_intersects(Line2D line_segment) const
|
73
|
+
{
|
74
|
+
Value2D<T> d = line_segment.a - a;
|
75
|
+
Value2D<T> va = b - a;
|
76
|
+
Value2D<T> vb = line_segment.b - line_segment.a;
|
77
|
+
T c = va.cross_product(vb);
|
78
|
+
T t = d.cross_product(vb) / c;
|
79
|
+
T u = d.cross_product(va) / c;
|
80
|
+
|
81
|
+
return !(t < T(0) || t > T(1) || u < T(0) || u > T(1));
|
82
|
+
}
|
83
|
+
|
84
|
+
|
85
|
+
Z_CT(CPP11) Value2D<T> segment_lerp(T alpha) const
|
86
|
+
{return a.lerp(b, alpha);}
|
87
|
+
};
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
#undef Z_IMPLEMENTATION_COMMON
|
92
|
+
|
93
|
+
#endif // _Z_classes_mathematics_geometry_euclidean_Line2D_HPP_
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/* Z Kit - classes/mathematics/geometry/euclidean/Line3D.hpp
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_classes_mathematics_geometry_euclidean_Line3D_HPP_
|
9
|
+
#define _Z_classes_mathematics_geometry_euclidean_Line3D_HPP_
|
10
|
+
|
11
|
+
#include <Z/classes/base/Value3D.hpp>
|
12
|
+
#include <Z/types/mathematics.h>
|
13
|
+
|
14
|
+
|
15
|
+
#define Z_IMPLEMENTATION_COMMON \
|
16
|
+
\
|
17
|
+
typedef typename ZTypeFixedSigned(Z3DLine, T) Base; \
|
18
|
+
Value3D<T> a, b; \
|
19
|
+
\
|
20
|
+
Z_INLINE Line3D() Z_DEFAULTED({}) \
|
21
|
+
\
|
22
|
+
Z_CT(CPP11) Line3D(const Value3D<T> &a, const Value3D<T> &b) : a(a), b(b) {} \
|
23
|
+
Z_CT(CPP11) Line3D(const Value3D<T> &a, T b_x, T b_y, T b_z) : a(a), b(b_x, b_y, b_z) {} \
|
24
|
+
Z_CT(CPP11) Line3D(const Value3D<T> &a, T b_xyz) : a(a), b(b_xyz) {} \
|
25
|
+
Z_CT(CPP11) Line3D(T a_x, T a_y, T a_z, const Value3D<T> &b) : a(a_x, a_y, a_z), b(b) {} \
|
26
|
+
Z_CT(CPP11) Line3D(T a_x, T a_y, T a_z, T b_x, T b_y, T b_z) : a(a_x, a_y, a_z), b(b_x, b_y, b_z) {} \
|
27
|
+
Z_CT(CPP11) Line3D(T a_xyz, T b_x, T b_y, T b_z) : a(a_xyz), b(b_x, b_y, b_z) {} \
|
28
|
+
Z_CT(CPP11) Line3D(T a_xyz, const Value3D<T> &b) : a(a_xyz), b(b) {} \
|
29
|
+
Z_CT(CPP11) Line3D(const Value3D<T> &b) : a(T(0)), b(b) {} \
|
30
|
+
Z_CT(CPP11) Line3D(T b_x, T b_y, T b_z) : a(T(0)), b(b_x, b_y, b_z) {} \
|
31
|
+
Z_CT(CPP11) Line3D(T b_xyz) : a(T(0)), b(b_xyz) {} \
|
32
|
+
\
|
33
|
+
Z_INLINE Line3D(const Base &line) {(*(Base *)this) = line;} \
|
34
|
+
\
|
35
|
+
Z_CT(CPP11) Boolean operator ==(const Line3D &line) const {return a == line.a && b == line.b;} \
|
36
|
+
Z_CT(CPP11) Boolean operator !=(const Line3D &line) const {return a != line.a || b != line.b;} \
|
37
|
+
\
|
38
|
+
\
|
39
|
+
Z_CT(CPP11) Boolean is_perpendicular(const Line3D &line) const \
|
40
|
+
{return ((a.b - a.a).is_perpendicular(line.b - line.a));} \
|
41
|
+
\
|
42
|
+
\
|
43
|
+
Z_CT(CPP11) Boolean is_zero() const \
|
44
|
+
{return a.is_zero() && b.is_zero();} \
|
45
|
+
\
|
46
|
+
\
|
47
|
+
Z_CT(CPP11) Line3D reverse() const \
|
48
|
+
{return Line3D(b, a);} \
|
49
|
+
\
|
50
|
+
\
|
51
|
+
Z_INLINE void swap(Line3D &line) \
|
52
|
+
{Zeta::swap<Base>((Base *)this, (Base *)&line);} \
|
53
|
+
\
|
54
|
+
\
|
55
|
+
Z_CT(CPP11) Value3D<T> segment_center() const \
|
56
|
+
{return a.middle(b);}
|
57
|
+
|
58
|
+
|
59
|
+
namespace Zeta {
|
60
|
+
template <class T, UInt T_number_set = Type<T>::number_set> struct Line3D {};
|
61
|
+
|
62
|
+
|
63
|
+
template <class T> struct Line3D<T, Z_NUMBER_SET_Z> {
|
64
|
+
Z_IMPLEMENTATION_COMMON
|
65
|
+
};
|
66
|
+
|
67
|
+
|
68
|
+
template <class T> struct Line3D<T, Z_NUMBER_SET_R> {
|
69
|
+
Z_IMPLEMENTATION_COMMON
|
70
|
+
|
71
|
+
|
72
|
+
Z_CT(CPP11) Value3D<T> segment_lerp(T alpha) const
|
73
|
+
{return a.lerp(b, alpha);}
|
74
|
+
};
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
#undef Z_IMPLEMENTATION_COMMON
|
79
|
+
|
80
|
+
#endif // _Z_classes_mathematics_geometry_euclidean_Line3D_HPP_
|