Skip to content

Commit 1d83fee

Browse files
committed
ar::LightEstimate classes
1 parent 8ce1043 commit 1d83fee

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

cidre/pomace/ar/ar.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Class AR_WORLD_TRACKING_CONFIGURATION;
1515
Class AR_ANCHOR;
1616
Class AR_PLANE_ANCHOR;
1717
Class AR_RAYCAST_QUERY;
18+
Class AR_LIGHT_ESTIMATE;
19+
Class AR_DIRECTIONAL_LIGHT_ESTIMATE;
1820

1921
__attribute__((constructor))
2022
static void ar_initializer(void)
@@ -29,6 +31,8 @@ static void ar_initializer(void)
2931
AR_ANCHOR = NSClassFromString(@"ARAnchor");
3032
AR_PLANE_ANCHOR = NSClassFromString(@"ARPlaneAnchor");
3133
AR_RAYCAST_QUERY = NSClassFromString(@"ARRaycastQuery");
34+
AR_LIGHT_ESTIMATE = NSClassFromString(@"ARLightEstimate");
35+
AR_DIRECTIONAL_LIGHT_ESTIMATE = NSClassFromString(@"ARDirectionalLightEstimate");
3236
}
3337
}
3438

cidre/src/ar/light_estimate.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{arc, cg, define_obj_type, ns, objc, simd};
1+
use crate::{arc, cg, define_cls, define_obj_type, ns, objc, simd};
22

33
define_obj_type!(
44
#[doc(alias = "ARLightEstimate")]
@@ -7,6 +7,8 @@ define_obj_type!(
77
);
88

99
impl LightEstimate {
10+
define_cls!(AR_LIGHT_ESTIMATE);
11+
1012
/// Ambient intensity of the scene lighting.
1113
///
1214
/// In a well-lit environment this value is usually near `1000`.
@@ -25,6 +27,8 @@ define_obj_type!(
2527
);
2628

2729
impl DirectionalLightEstimate {
30+
define_cls!(AR_DIRECTIONAL_LIGHT_ESTIMATE);
31+
2832
/// Second-degree spherical harmonics coefficients.
2933
///
3034
/// The data contains 27 `f32` values in three non-interleaved RGB sets.
@@ -59,3 +63,9 @@ impl DirectionalLightEstimate {
5963
#[objc::msg_send(primaryLightIntensity)]
6064
pub fn primary_light_intensity(&self) -> cg::Float;
6165
}
66+
67+
#[link(name = "ar", kind = "static")]
68+
unsafe extern "C" {
69+
static AR_LIGHT_ESTIMATE: &'static objc::Class<LightEstimate>;
70+
static AR_DIRECTIONAL_LIGHT_ESTIMATE: &'static objc::Class<DirectionalLightEstimate>;
71+
}

0 commit comments

Comments
 (0)