This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* get the date format by using the date as a string. | |
* This Extension function returns date format, if it matches with any format else it will return null | |
*/ | |
fun String.getDateFormat(): String? { | |
val dateFormats = arrayOf( | |
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", | |
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", | |
"yyyy-MM-dd'T'HH:mm:ss.SSSZ", | |
"yyyy-MM-dd'T'HH:mm:ss'Z'", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? { | |
let node = SCNNode() | |
if let imageAnchor = anchor as? ARImageAnchor { | |
let plane = SCNPlane(width: imageAnchor.referenceImage.physicalSize.width, height: imageAnchor.referenceImage.physicalSize.height) | |
plane.firstMaterial?.diffuse.contents = UIColor(white: 1, alpha: 0.8) | |
let material = SCNMaterial() | |
material.diffuse.contents = viewObj | |
plane.materials = [material] | |
let planeNode = SCNNode(geometry: plane) | |
planeNode.eulerAngles.x = -.pi / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import classNames from 'classnames'; | |
import PropTypes from 'prop-types'; | |
import { withStyles } from '@material-ui/core/styles'; | |
import Table from '@material-ui/core/Table'; | |
import TableBody from '@material-ui/core/TableBody'; | |
import TableCell from '@material-ui/core/TableCell'; | |
import TableHead from '@material-ui/core/TableHead'; | |
import TablePagination from '@material-ui/core/TablePagination'; | |
import TableRow from '@material-ui/core/TableRow'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from 'react' | |
import cx from 'classnames' | |
import { connect } from 'react-redux' | |
import { Icon } from 'antd' | |
import { Helmet } from 'react-helmet' | |
import { FormattedMessage } from 'react-intl' | |
import { withRouter } from 'react-router-dom' | |
import { truncatePhoneNumber } from 'config/utils' | |
import { required, phoneConstraints } from 'config/validators' | |
import { actions } from 'rdx/auth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let configuration = ARWorldTrackingConfiguration() | |
// ARReferenceObject(archiveURL :... this method used when we have ARReferenceObject Store in local Document Directory | |
configuration.detectionObjects = Set([try ARReferenceObject(archiveURL: objectURL!)]) | |
// ARReferenceObject.referenceObjects(inGroupNamed... this method used when we have ARReferenceObject Store in Assest Folder | |
configuration.detectionObjects = ARReferenceObject.referenceObjects(inGroupNamed: "", bundle: .main)! | |
sceneView.session.run(configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func receivedData(_ data: Data, from peer: MCPeerID) { | |
if let unarchived = try? NSKeyedUnarchiver.unarchivedObject(of: ARWorldMap.classForKeyedArchiver()!, from: data), let worldMap = unarchived as? ARWorldMap { | |
// Run the session with the received world map. | |
let configuration = ARWorldTrackingConfiguration() | |
configuration.planeDetection = .horizontal | |
configuration.initialWorldMap = worldMap | |
sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors]) | |
mapProvider = peer | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sceneView.session.getCurrentWorldMap { worldMap, error in | |
guard let map = worldMap | |
else { print("Error: \(error!.localizedDescription)"); return } | |
guard let data = try? NSKeyedArchiver.archivedData(withRootObject: map, requiringSecureCoding: true) | |
else { fatalError("can't encode map") } | |
self.multipeerSession.sendToAllPeers(data) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? { | |
let node = SCNNode() | |
if let imageAnchor = anchor as? ARImageAnchor { | |
let plane = SCNPlane(width: imageAnchor.referenceImage.physicalSize.width, height: imageAnchor.referenceImage.physicalSize.height) | |
plane.firstMaterial?.diffuse.contents = UIColor(white: 1, alpha: 0.8) | |
let material = SCNMaterial() | |
material.diffuse.contents = viewObj | |
plane.materials = [material] | |
let planeNode = SCNNode(geometry: plane) | |
planeNode.eulerAngles.x = -.pi / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let configuration = ARImageTrackingConfiguration() | |
let warrior = ARReferenceImage(UIImage(named: "DD")!.cgImage!,orientation: CGImagePropertyOrientation.up,physicalWidth: 0.90) | |
configuration.trackingImages = [warrior] | |
configuration.maximumNumberOfTrackedImages = 1 |
NewerOlder