objc2_scene_kit/generated/
SCNHitTest.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct SCNHitTestSearchMode(pub NSInteger);
18impl SCNHitTestSearchMode {
19 #[doc(alias = "SCNHitTestSearchModeClosest")]
20 pub const Closest: Self = Self(0);
21 #[doc(alias = "SCNHitTestSearchModeAll")]
22 pub const All: Self = Self(1);
23 #[doc(alias = "SCNHitTestSearchModeAny")]
24 pub const Any: Self = Self(2);
25}
26
27unsafe impl Encode for SCNHitTestSearchMode {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for SCNHitTestSearchMode {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35pub type SCNHitTestOption = NSString;
40
41extern "C" {
42 pub static SCNHitTestClipToZRangeKey: &'static SCNHitTestOption;
44}
45
46extern "C" {
47 pub static SCNHitTestBackFaceCullingKey: &'static SCNHitTestOption;
49}
50
51extern "C" {
52 pub static SCNHitTestBoundingBoxOnlyKey: &'static SCNHitTestOption;
54}
55
56extern "C" {
57 pub static SCNHitTestIgnoreChildNodesKey: &'static SCNHitTestOption;
59}
60
61extern "C" {
62 pub static SCNHitTestRootNodeKey: &'static SCNHitTestOption;
64}
65
66extern "C" {
67 pub static SCNHitTestIgnoreHiddenNodesKey: &'static SCNHitTestOption;
69}
70
71extern "C" {
72 pub static SCNHitTestOptionCategoryBitMask: &'static SCNHitTestOption;
74}
75
76extern "C" {
77 pub static SCNHitTestOptionSearchMode: &'static SCNHitTestOption;
79}
80
81extern "C" {
82 pub static SCNHitTestOptionIgnoreLightArea: &'static SCNHitTestOption;
84}
85
86extern "C" {
87 pub static SCNHitTestFirstFoundOnlyKey: &'static SCNHitTestOption;
89}
90
91extern "C" {
92 pub static SCNHitTestSortResultsKey: &'static SCNHitTestOption;
94}
95
96extern_class!(
97 #[unsafe(super(NSObject))]
101 #[derive(Debug, PartialEq, Eq, Hash)]
102 pub struct SCNHitTestResult;
103);
104
105extern_conformance!(
106 unsafe impl NSObjectProtocol for SCNHitTestResult {}
107);
108
109impl SCNHitTestResult {
110 extern_methods!(
111 #[cfg(feature = "SCNNode")]
112 #[unsafe(method(node))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn node(&self) -> Retained<SCNNode>;
116
117 #[unsafe(method(geometryIndex))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn geometryIndex(&self) -> NSInteger;
121
122 #[unsafe(method(faceIndex))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn faceIndex(&self) -> NSInteger;
126
127 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
128 #[unsafe(method(localCoordinates))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn localCoordinates(&self) -> SCNVector3;
132
133 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
134 #[unsafe(method(worldCoordinates))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn worldCoordinates(&self) -> SCNVector3;
138
139 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
140 #[unsafe(method(localNormal))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn localNormal(&self) -> SCNVector3;
144
145 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
146 #[unsafe(method(worldNormal))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn worldNormal(&self) -> SCNVector3;
150
151 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-quartz-core"))]
152 #[cfg(not(target_os = "watchos"))]
153 #[unsafe(method(modelTransform))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn modelTransform(&self) -> SCNMatrix4;
157
158 #[cfg(feature = "SCNNode")]
159 #[unsafe(method(boneNode))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn boneNode(&self) -> Option<Retained<SCNNode>>;
163
164 #[cfg(feature = "objc2-core-foundation")]
165 #[unsafe(method(textureCoordinatesWithMappingChannel:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn textureCoordinatesWithMappingChannel(&self, channel: NSInteger) -> CGPoint;
171 );
172}
173
174impl SCNHitTestResult {
176 extern_methods!(
177 #[unsafe(method(init))]
178 #[unsafe(method_family = init)]
179 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
180
181 #[unsafe(method(new))]
182 #[unsafe(method_family = new)]
183 pub unsafe fn new() -> Retained<Self>;
184 );
185}
186
187impl SCNHitTestResult {
189 extern_methods!();
190}