Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/lib/createArComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
castsShadow,
categoryBitMask,
eulerAngles,
opacity,
orientation,
position,
renderingOrder,
Expand Down Expand Up @@ -42,6 +43,7 @@ const PROP_TYPES_NODE = {
categoryBitMask,
castsShadow,
renderingOrder,
opacity,
};

const NODE_PROPS = keys(PROP_TYPES_NODE);
Expand Down
4 changes: 4 additions & 0 deletions components/lib/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export const shadowMode = PropTypes.oneOf(values(ARKitManager.ShadowMode));
export const colorBufferWriteMask = PropTypes.oneOf(
values(ARKitManager.ColorMask),
);

export const opacity = PropTypes.number;

export const material = PropTypes.shape({
color,
metalness: PropTypes.number,
Expand All @@ -69,5 +72,6 @@ export const material = PropTypes.shape({
colorBufferWriteMask,
doubleSided: PropTypes.bool,
litPerPixel: PropTypes.bool,
transparency: PropTypes.number,
fillMode,
});
8 changes: 8 additions & 0 deletions ios/RCTConvert+ARKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ + (void)setMaterialProperties:(SCNMaterial *)material properties:(id)json {
if (json[@"diffuse"]) {
material.diffuse.contents = [self UIColor:json[@"diffuse"]];
}
if (json[@"transparency"]) {
material.transparency = [json[@"transparency"] floatValue];
}

if (json[@"metalness"]) {
material.lightingModelName = SCNLightingModelPhysicallyBased;
Expand Down Expand Up @@ -353,6 +356,7 @@ + (void)setMaterialProperties:(SCNMaterial *)material properties:(id)json {
material.doubleSided = [json[@"doubleSided"] boolValue];
}


if(json[@"litPerPixel"]) {
material.litPerPixel = [json[@"litPerPixel"] boolValue];
}
Expand Down Expand Up @@ -401,6 +405,10 @@ + (void)setNodeProperties:(SCNNode *)node properties:(id)json {
if (json[@"rotation"]) {
node.rotation = [self SCNVector4:json[@"rotation"]];
}

if (json[@"opacity"]) {
node.opacity = [json[@"opacity"] floatValue];
}
}


Expand Down