-
Notifications
You must be signed in to change notification settings - Fork 0
API References uARWorld2D
setLigtingFactor(factor: CGFloat)
World object has a lighting factor parameter between 0.0 and 1.0, which controls the lighting of augmented items. Only Image and Label items are effected by lighting, Video is exception. If you set the factor to 1.0, it means fully related to real lighting. For example in a bright environment items will be shown as they are. In a dark environment, they will be shown darker like they are part of real world.
setCoordinateMode(mode: CoordinateMode)
enum CoordinateMode {
case relative
case compass
}
Each World runs in a Coordinate Mode [.relative or .compass]. Coordinate mode defines how to position the items which are created as type of coordinate. If the world is in relative mode, the item will be positioned according to the device facing direction. Please see relative concept section in this page.
For example position of coordinate(top:1, right:2, front: 3) in relative mode means; 3 meters in direction of the device camera facing, 2 meter of right and 1 meter up.
Position of coordinate(top:1, right:2, front: 3) in compass mode means; 3 meters in direction of north, 2 meter of east and 1 meter up. Please see compass concept section in this page.
Default is relative mode.
resetRelativeCoordinate()
Augmentation is done according to device orientation and position of the device when View is created. This method resets the reference of relative positions of augmented items according to position and orientation at the time it is called
addLabel(label: String, fontSize: CGFloat = 36, fontColor: UIColor = UIColor.white, fontName: String = "Helvetica") -> Int
label: text message to augment
fontSize (optional): font size of text
fontColor (optional): color of font
fontName (optional): font name of type
return value is the indice of item in array of items list
This method augments the text message in label, on the first auto detected plane parallel to ground found at the middle point of the screen. Please see Auto detected plane concept in this page for more information.
addLabel(label: String, fontSize: CGFloat = 36, fontColor: UIColor = UIColor.white, fontName: String = "Helvetica", position: coordinate) -> Int
This method augments the text message in label, at the position of coordinate.
addLabel(facingMe: Bool, label: String, fontSize: CGFloat = 36, fontColor: UIColor = UIColor.white, fontName: String = "Helvetica", position: coordinate) -> Int
This method augments the text message in label, at the position of coordinate but according to the position of device if facingMe is true, otherwise it is same with above method. see the "facingMe concept" section on this page for more details.
addImage(imageName: String) -> Int
This method augments the image on the first auto detected plane parallel to ground found at the middle point of the screen. Please see Auto detected plane concept in this page for more information.
imageName can be a file name in assets or an http:// or https:// url. If you want to use http:// you have to add below keys into info.plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
addImage(imageName: String, position: coordinate) -> Int
This method augments the image at the position of coordinate.
addImage(facingMe: Bool, imageName: String, position: coordinate) -> Int
This method augments the timage, at the position of coordinate but according to the position of device if facingMe is true, otherwise it is same with above method. see the "facingMe concept" section on this page for more details.
addVideo(videoName: String) -> Int
This method augments the video on the first auto detected plane parallel to ground found at the middle point of the screen. Please see Auto detected plane concept in this page for more information.
videoName can be a file name in project bundle or an http:// or https:// url. If you want to use http:// you have to add below keys into info.plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
addVideo(videoName: String, position: coordinate) -> Int
This method augments the video at the position of coordinate.
addVideo(facingMe: Bool, videoName: String, position: coordinate) -> Int
This method augments the video, at the position of coordinate but according to the position of device if facingMe is true, otherwise it is same with above method. see the "facingMe concept" section on this page for more details.
If you set the facingMe parameter to true, the augmented object will be placed to coordinate according to the device's orientation. You can think there is a straight line through the device's back camera, so front means X meter away on this ine, top means X meters above from this line, and right is X meters right of this line.
If your world runs in relative mode, objects in coordinate mode will be placed according to devices facing direction.
If your world runs in compass mode, objects in coordinate mode will be placed according to north direction, wherever device is facing.
Auto detected plane is the plane in real world detected automatically by ARKit, intersecting the line which is going through the back of device. If you run the method to augment the item on auto detected plane, it will be placed on the plane in real world scene when it is detected.