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
105unsafe impl NSObjectProtocol for SCNHitTestResult {}
106
107impl SCNHitTestResult {
108 extern_methods!(
109 #[cfg(feature = "SCNNode")]
110 #[unsafe(method(node))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn node(&self) -> Retained<SCNNode>;
114
115 #[unsafe(method(geometryIndex))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn geometryIndex(&self) -> NSInteger;
119
120 #[unsafe(method(faceIndex))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn faceIndex(&self) -> NSInteger;
124
125 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
126 #[unsafe(method(localCoordinates))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn localCoordinates(&self) -> SCNVector3;
130
131 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
132 #[unsafe(method(worldCoordinates))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn worldCoordinates(&self) -> SCNVector3;
136
137 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
138 #[unsafe(method(localNormal))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn localNormal(&self) -> SCNVector3;
142
143 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
144 #[unsafe(method(worldNormal))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn worldNormal(&self) -> SCNVector3;
148
149 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-quartz-core"))]
150 #[cfg(not(target_os = "watchos"))]
151 #[unsafe(method(modelTransform))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn modelTransform(&self) -> SCNMatrix4;
155
156 #[cfg(feature = "SCNNode")]
157 #[unsafe(method(boneNode))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn boneNode(&self) -> Option<Retained<SCNNode>>;
161
162 #[cfg(feature = "objc2-core-foundation")]
163 #[unsafe(method(textureCoordinatesWithMappingChannel:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn textureCoordinatesWithMappingChannel(&self, channel: NSInteger) -> CGPoint;
169 );
170}
171
172impl SCNHitTestResult {
174 extern_methods!(
175 #[unsafe(method(init))]
176 #[unsafe(method_family = init)]
177 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
178
179 #[unsafe(method(new))]
180 #[unsafe(method_family = new)]
181 pub unsafe fn new() -> Retained<Self>;
182 );
183}
184
185impl SCNHitTestResult {
187 extern_methods!();
188}