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,361 @@
|
|
1
|
+
/* Z Kit - functions/mathematics/geometry/euclidean/ZAABB.h
|
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_functions_mathematics_geometry_euclidean_ZAABB_H_
|
9
|
+
#define _Z_functions_mathematics_geometry_euclidean_ZAABB_H_
|
10
|
+
|
11
|
+
#include <Z/functions/mathematics/geometry/euclidean/Z3DLine.h>
|
12
|
+
|
13
|
+
|
14
|
+
/* MARK: - Common implementation */
|
15
|
+
|
16
|
+
|
17
|
+
#define Z_IMPLEMENTATION_COMMON(Type, type) \
|
18
|
+
\
|
19
|
+
static Z_INLINE \
|
20
|
+
ZBox##Type z_aabb_##type##_box(ZAABB##Type object) \
|
21
|
+
{ \
|
22
|
+
return z_box_##type \
|
23
|
+
(object.a.x, object.a.y, object.a.z, \
|
24
|
+
object.b.x - object.a.x, object.b.y - object.a.y, object.b.z - object.a.z); \
|
25
|
+
} \
|
26
|
+
\
|
27
|
+
\
|
28
|
+
static Z_INLINE \
|
29
|
+
zboolean z_aabb_##type##_contains(ZAABB##Type object, ZAABB##Type other) \
|
30
|
+
{ \
|
31
|
+
return other.a.x != other.b.x && \
|
32
|
+
other.a.y != other.b.y && \
|
33
|
+
other.a.z != other.b.z && \
|
34
|
+
other.a.x >= object.a.x && \
|
35
|
+
other.a.y >= object.a.y && \
|
36
|
+
other.a.z >= object.a.z && \
|
37
|
+
other.b.x <= object.b.x && \
|
38
|
+
other.b.y <= object.b.y && \
|
39
|
+
other.b.z <= object.b.z; \
|
40
|
+
} \
|
41
|
+
\
|
42
|
+
\
|
43
|
+
static Z_INLINE \
|
44
|
+
zboolean z_aabb_##type##_contains_box(ZAABB##Type object, ZBox##Type box) \
|
45
|
+
{ \
|
46
|
+
return box.size.x != (z##type)0 && \
|
47
|
+
box.size.y != (z##type)0 && \
|
48
|
+
box.size.z != (z##type)0 && \
|
49
|
+
box.point.x >= object.a.x && \
|
50
|
+
box.point.y >= object.a.y && \
|
51
|
+
box.point.z >= object.a.z && \
|
52
|
+
box.point.x + box.size.x <= object.b.x && \
|
53
|
+
box.point.y + box.size.y <= object.b.y && \
|
54
|
+
box.point.z + box.size.z <= object.b.z; \
|
55
|
+
} \
|
56
|
+
\
|
57
|
+
\
|
58
|
+
static Z_INLINE \
|
59
|
+
zboolean z_aabb_##type##_contains_point(ZAABB##Type object, Z3D##Type point) \
|
60
|
+
{ \
|
61
|
+
return point.x >= object.a.x && point.y >= object.a.y && point.z >= object.a.z && \
|
62
|
+
point.x < object.b.x && point.y < object.b.y && point.z < object.b.z; \
|
63
|
+
} \
|
64
|
+
\
|
65
|
+
\
|
66
|
+
static Z_INLINE \
|
67
|
+
ZAABB##Type z_aabb_##type##_from_vertices(Z3D##Type a, Z3D##Type b) \
|
68
|
+
{ \
|
69
|
+
ZAABB##Type result; \
|
70
|
+
\
|
71
|
+
result.a = z_3d_##type##_minimum(a, b); \
|
72
|
+
result.b = z_3d_##type##_maximum(a, b); \
|
73
|
+
return result; \
|
74
|
+
} \
|
75
|
+
\
|
76
|
+
\
|
77
|
+
static Z_INLINE \
|
78
|
+
zboolean z_aabb_##type##_intersect(ZAABB##Type a, ZAABB##Type b) \
|
79
|
+
{ \
|
80
|
+
return a.a.x != a.b.x && a.a.y != a.b.y && a.a.z != a.b.z && \
|
81
|
+
b.a.x != b.b.x && b.a.y != b.b.y && b.a.z != b.b.z && \
|
82
|
+
b.b.x > a.a.x && b.b.y > a.a.y && b.b.z > a.a.z && \
|
83
|
+
b.a.x < a.b.x && b.a.y < a.b.y && b.a.z < a.b.z; \
|
84
|
+
} \
|
85
|
+
\
|
86
|
+
\
|
87
|
+
static Z_INLINE \
|
88
|
+
ZAABB##Type z_aabb_##type##_intersection(ZAABB##Type a, ZAABB##Type b) \
|
89
|
+
{ \
|
90
|
+
z##type x1, x2, y1, y2, z1, z2; \
|
91
|
+
\
|
92
|
+
return (x1 = z_##type##_maximum(a.a.x, b.a.x)) < \
|
93
|
+
(x2 = z_##type##_minimum(a.b.x, b.b.x)) && \
|
94
|
+
(y1 = z_##type##_maximum(a.a.y, b.a.y)) < \
|
95
|
+
(y2 = z_##type##_minimum(a.b.y, b.b.y)) && \
|
96
|
+
(z1 = z_##type##_maximum(a.a.z, b.a.z)) < \
|
97
|
+
(z2 = z_##type##_minimum(a.b.z, b.b.z)) \
|
98
|
+
\
|
99
|
+
? z_aabb_##type(x1, y1, z1, x2, y2, z2) \
|
100
|
+
: z_aabb_##type##_zero; \
|
101
|
+
} \
|
102
|
+
\
|
103
|
+
\
|
104
|
+
static Z_INLINE \
|
105
|
+
Z3D##Type z_aabb_##type##_size(ZAABB##Type object) \
|
106
|
+
{return z_3d_##type##_subtract(object.b, object.a);} \
|
107
|
+
\
|
108
|
+
\
|
109
|
+
static Z_INLINE \
|
110
|
+
ZAABB##Type z_aabb_##type##_union(ZAABB##Type a, ZAABB##Type b) \
|
111
|
+
{ \
|
112
|
+
ZAABB##Type result; \
|
113
|
+
\
|
114
|
+
result.a = z_3d_##type##_minimum(a.a, b.a); \
|
115
|
+
result.b = z_3d_##type##_maximum(a.b, b.b); \
|
116
|
+
return result; \
|
117
|
+
} \
|
118
|
+
\
|
119
|
+
\
|
120
|
+
static Z_INLINE \
|
121
|
+
z##type z_aabb_##type##_volume(ZAABB##Type object) \
|
122
|
+
{return z_3d_##type##_inner_product(z_3d_##type##_subtract(object.b, object.a));}
|
123
|
+
|
124
|
+
|
125
|
+
#define z_aabb_type_box( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _box )
|
126
|
+
#define z_aabb_type_contains( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _contains )
|
127
|
+
#define z_aabb_type_contains_box( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _contains_box )
|
128
|
+
#define z_aabb_type_contains_point(TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _contains_point)
|
129
|
+
#define z_aabb_type_from_vertices( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _from_vertices )
|
130
|
+
#define z_aabb_type_intersect( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _intersect )
|
131
|
+
#define z_aabb_type_intersection( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _intersection )
|
132
|
+
#define z_aabb_type_size( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _size )
|
133
|
+
#define z_aabb_type_union( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _union )
|
134
|
+
#define z_aabb_type_volume( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _volume )
|
135
|
+
|
136
|
+
|
137
|
+
/* MARK: - Partial implementation for real types */
|
138
|
+
|
139
|
+
|
140
|
+
#define Z_IMPLEMENTATION_REAL(Type, type) \
|
141
|
+
\
|
142
|
+
static Z_INLINE \
|
143
|
+
Z3D##Type z_aabb_##type##_absolute_point_to_unit(ZAABB##Type object, Z3D##Type point) \
|
144
|
+
{ \
|
145
|
+
return z_3d_##type \
|
146
|
+
((point.x - object.a.x) / (object.b.x - object.a.x), \
|
147
|
+
(point.y - object.a.y) / (object.b.y - object.a.y), \
|
148
|
+
(point.z - object.a.z) / (object.b.z - object.a.z)); \
|
149
|
+
} \
|
150
|
+
\
|
151
|
+
\
|
152
|
+
static Z_INLINE \
|
153
|
+
zboolean z_aabb_##type##_contains_sphere(ZAABB##Type object, ZSphere##Type sphere) \
|
154
|
+
{ \
|
155
|
+
return sphere.radius != (z##type)0 && \
|
156
|
+
sphere.point.x - sphere.radius >= object.a.x && \
|
157
|
+
sphere.point.y - sphere.radius >= object.a.y && \
|
158
|
+
sphere.point.z - sphere.radius >= object.a.z && \
|
159
|
+
sphere.point.x + sphere.radius <= object.b.x && \
|
160
|
+
sphere.point.y + sphere.radius <= object.b.y && \
|
161
|
+
sphere.point.z + sphere.radius <= object.b.z; \
|
162
|
+
} \
|
163
|
+
\
|
164
|
+
\
|
165
|
+
static Z_INLINE \
|
166
|
+
ZSphere##Type z_aabb_##type##_inner_sphere(ZAABB##Type object) \
|
167
|
+
{ \
|
168
|
+
ZSphere##Type result; \
|
169
|
+
\
|
170
|
+
result.point = z_aabb_##type##_center(object); \
|
171
|
+
\
|
172
|
+
result.radius = \
|
173
|
+
z_##type##_minimum \
|
174
|
+
(z_##type##_minimum(object.b.x - object.a.x, object.b.y - object.a.y), \
|
175
|
+
object.b.z - object.a.z) \
|
176
|
+
/ (z##type)2; \
|
177
|
+
\
|
178
|
+
return result; \
|
179
|
+
} \
|
180
|
+
\
|
181
|
+
\
|
182
|
+
static Z_INLINE \
|
183
|
+
Z3D##Type z_aabb_##type##_unit_point_to_absolute(ZAABB##Type object, Z3D##Type point) \
|
184
|
+
{ \
|
185
|
+
return z_3d_##type \
|
186
|
+
(point.x * (object.b.x - object.a.x) + object.a.x, \
|
187
|
+
point.y * (object.b.y - object.a.y) + object.a.y, \
|
188
|
+
point.z * (object.b.z - object.a.z) + object.a.z); \
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
#define z_aabb_type_absolute_point_to_unit(TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _absolute_point_to_unit)
|
193
|
+
#define z_aabb_type_contains_sphere( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _contains_sphere )
|
194
|
+
#define z_aabb_type_inner_sphere( TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _inner_sphere )
|
195
|
+
#define z_aabb_type_unit_point_to_absolute(TYPE) Z_INSERT_##TYPE##_fixed_type(z_aabb_, _unit_point_to_absolute)
|
196
|
+
|
197
|
+
|
198
|
+
/* MARK: - Implementation expansions */
|
199
|
+
|
200
|
+
|
201
|
+
#define z_aabb_sint8_are_equal z_3d_line_sint8_are_equal
|
202
|
+
#define z_aabb_sint8_center z_3d_line_segment_sint8_center
|
203
|
+
#define z_aabb_sint8_is_zero z_3d_line_sint8_is_zero
|
204
|
+
#define z_aabb_sint8_swap z_3d_line_sint8_swap
|
205
|
+
|
206
|
+
Z_IMPLEMENTATION_COMMON(SInt8, sint8)
|
207
|
+
|
208
|
+
#define z_aabb_sint16_are_equal z_3d_line_sint16_are_equal
|
209
|
+
#define z_aabb_sint16_center z_3d_line_segment_sint16_center
|
210
|
+
#define z_aabb_sint16_is_zero z_3d_line_sint16_is_zero
|
211
|
+
#define z_aabb_sint16_swap z_3d_line_sint16_swap
|
212
|
+
|
213
|
+
Z_IMPLEMENTATION_COMMON(SInt16, sint16)
|
214
|
+
|
215
|
+
#define z_aabb_sint32_are_equal z_3d_line_sint32_are_equal
|
216
|
+
#define z_aabb_sint32_center z_3d_line_segment_sint32_center
|
217
|
+
#define z_aabb_sint32_is_zero z_3d_line_sint32_is_zero
|
218
|
+
#define z_aabb_sint32_swap z_3d_line_sint32_swap
|
219
|
+
|
220
|
+
Z_IMPLEMENTATION_COMMON(SInt32, sint32)
|
221
|
+
|
222
|
+
#ifdef Z_SINT64
|
223
|
+
|
224
|
+
# define z_aabb_sint64_are_equal z_3d_line_sint64_are_equal
|
225
|
+
# define z_aabb_sint64_center z_3d_line_segment_sint64_center
|
226
|
+
# define z_aabb_sint64_is_zero z_3d_line_sint64_is_zero
|
227
|
+
# define z_aabb_sint64_swap z_3d_line_sint64_swap
|
228
|
+
|
229
|
+
Z_IMPLEMENTATION_COMMON(SInt64, sint64)
|
230
|
+
|
231
|
+
#endif
|
232
|
+
|
233
|
+
#ifdef Z_SINT128
|
234
|
+
|
235
|
+
# define z_aabb_sint128_are_equal z_3d_line_sint128_are_equal
|
236
|
+
# define z_aabb_sint128_center z_3d_line_segment_sint128_center
|
237
|
+
# define z_aabb_sint128_is_zero z_3d_line_sint128_is_zero
|
238
|
+
# define z_aabb_sint128_swap z_3d_line_sint128_swap
|
239
|
+
|
240
|
+
Z_IMPLEMENTATION_COMMON(SInt128, sint128)
|
241
|
+
|
242
|
+
#endif
|
243
|
+
|
244
|
+
#ifdef Z_FLOAT16
|
245
|
+
|
246
|
+
# define z_aabb_float16_are_equal z_3d_line_float16_are_equal
|
247
|
+
# define z_aabb_float16_center z_3d_line_segment_float16_center
|
248
|
+
# define z_aabb_float16_is_zero z_3d_line_float16_is_zero
|
249
|
+
# define z_aabb_float16_swap z_3d_line_float16_swap
|
250
|
+
|
251
|
+
Z_IMPLEMENTATION_COMMON(Float16, float16)
|
252
|
+
Z_IMPLEMENTATION_REAL (Float16, float16)
|
253
|
+
|
254
|
+
#endif
|
255
|
+
|
256
|
+
#ifdef Z_FLOAT32
|
257
|
+
|
258
|
+
# define z_aabb_float32_are_equal z_3d_line_float32_are_equal
|
259
|
+
# define z_aabb_float32_center z_3d_line_segment_float32_center
|
260
|
+
# define z_aabb_float32_is_zero z_3d_line_float32_is_zero
|
261
|
+
# define z_aabb_float32_swap z_3d_line_float32_swap
|
262
|
+
|
263
|
+
Z_IMPLEMENTATION_COMMON(Float32, float32)
|
264
|
+
Z_IMPLEMENTATION_REAL (Float32, float32)
|
265
|
+
|
266
|
+
#endif
|
267
|
+
|
268
|
+
#ifdef Z_FLOAT64
|
269
|
+
|
270
|
+
# define z_aabb_float64_are_equal z_3d_line_float64_are_equal
|
271
|
+
# define z_aabb_float64_center z_3d_line_segment_float64_center
|
272
|
+
# define z_aabb_float64_is_zero z_3d_line_float64_is_zero
|
273
|
+
# define z_aabb_float64_swap z_3d_line_float64_swap
|
274
|
+
|
275
|
+
Z_IMPLEMENTATION_COMMON(Float64, float64)
|
276
|
+
Z_IMPLEMENTATION_REAL (Float64, float64)
|
277
|
+
|
278
|
+
#endif
|
279
|
+
|
280
|
+
#ifdef Z_FLOAT128
|
281
|
+
|
282
|
+
# define z_aabb_float128_are_equal z_3d_line_float128_are_equal
|
283
|
+
# define z_aabb_float128_center z_3d_line_segment_float128_center
|
284
|
+
# define z_aabb_float128_is_zero z_3d_line_float128_is_zero
|
285
|
+
# define z_aabb_float128_swap z_3d_line_float128_swap
|
286
|
+
|
287
|
+
Z_IMPLEMENTATION_COMMON(Float128, float128)
|
288
|
+
Z_IMPLEMENTATION_REAL (Float128, float128)
|
289
|
+
|
290
|
+
#endif
|
291
|
+
|
292
|
+
#ifdef Z_FLOAT80_X87
|
293
|
+
|
294
|
+
# define z_aabb_float80_x87_are_equal z_3d_line_float80_x87_are_equal
|
295
|
+
# define z_aabb_float80_x87_center z_3d_line_segment_float80_x87_center
|
296
|
+
# define z_aabb_float80_x87_is_zero z_3d_line_float80_x87_is_zero
|
297
|
+
# define z_aabb_float80_x87_swap z_3d_line_float80_x87_swap
|
298
|
+
|
299
|
+
Z_IMPLEMENTATION_COMMON(Float80_x87, float80_x87)
|
300
|
+
Z_IMPLEMENTATION_REAL (Float80_x87, float80_x87)
|
301
|
+
|
302
|
+
#endif
|
303
|
+
|
304
|
+
#ifdef Z_FLOAT96_X87
|
305
|
+
|
306
|
+
# define z_aabb_float96_x87_are_equal z_3d_line_float96_x87_are_equal
|
307
|
+
# define z_aabb_float96_x87_center z_3d_line_segment_float96_x87_center
|
308
|
+
# define z_aabb_float96_x87_is_zero z_3d_line_float96_x87_is_zero
|
309
|
+
# define z_aabb_float96_x87_swap z_3d_line_float96_x87_swap
|
310
|
+
|
311
|
+
Z_IMPLEMENTATION_COMMON(Float96_x87, float96_x87)
|
312
|
+
Z_IMPLEMENTATION_REAL (Float96_x87, float96_x87)
|
313
|
+
|
314
|
+
#endif
|
315
|
+
|
316
|
+
#ifdef Z_FLOAT128_X87
|
317
|
+
|
318
|
+
# define z_aabb_float128_x87_are_equal z_3d_line_float128_x87_are_equal
|
319
|
+
# define z_aabb_float128_x87_center z_3d_line_segment_float128_x87_center
|
320
|
+
# define z_aabb_float128_x87_is_zero z_3d_line_float128_x87_is_zero
|
321
|
+
# define z_aabb_float128_x87_swap z_3d_line_float128_x87_swap
|
322
|
+
|
323
|
+
Z_IMPLEMENTATION_COMMON(Float128_x87, float128_x87)
|
324
|
+
Z_IMPLEMENTATION_REAL (Float128_x87, float128_x87)
|
325
|
+
|
326
|
+
#endif
|
327
|
+
|
328
|
+
|
329
|
+
/* MARK: - Cleanup */
|
330
|
+
|
331
|
+
|
332
|
+
#undef Z_IMPLEMENTATION_COMMON
|
333
|
+
#undef Z_IMPLEMENTATION_REAL
|
334
|
+
|
335
|
+
|
336
|
+
/* MARK: - Default real type definitions */
|
337
|
+
|
338
|
+
|
339
|
+
#ifdef Z_REAL
|
340
|
+
# define z_aabb_absolute_point_to_unit z_aabb_type_absolute_point_to_unit(REAL)
|
341
|
+
# define z_aabb_are_equal z_3d_line_are_equal
|
342
|
+
# define z_aabb_box z_aabb_type_box (REAL)
|
343
|
+
# define z_aabb_center z_3d_line_segment_center
|
344
|
+
# define z_aabb_contains z_aabb_type_contains (REAL)
|
345
|
+
# define z_aabb_contains_box z_aabb_type_contains_box (REAL)
|
346
|
+
# define z_aabb_contains_point z_aabb_type_contains_point (REAL)
|
347
|
+
# define z_aabb_contains_sphere z_aabb_type_contains_sphere (REAL)
|
348
|
+
# define z_aabb_from_vertices z_aabb_type_from_vertices (REAL)
|
349
|
+
# define z_aabb_inner_sphere z_aabb_type_inner_sphere (REAL)
|
350
|
+
# define z_aabb_intersect z_aabb_type_intersect (REAL)
|
351
|
+
# define z_aabb_intersection z_aabb_type_intersection (REAL)
|
352
|
+
# define z_aabb_is_zero z_3d_line_is_zero
|
353
|
+
# define z_aabb_size z_aabb_type_size (REAL)
|
354
|
+
# define z_aabb_swap z_3d_line_swap
|
355
|
+
# define z_aabb_union z_aabb_type_union (REAL)
|
356
|
+
# define z_aabb_unit_point_to_absolute z_aabb_type_unit_point_to_absolute(REAL)
|
357
|
+
# define z_aabb_volume z_aabb_type_volume (REAL)
|
358
|
+
#endif
|
359
|
+
|
360
|
+
|
361
|
+
#endif /* _Z_functions_mathematics_geometry_euclidean_ZAABB_H_ */
|