com.supermap.realspace
Class ARControl
- java.lang.Object
-
- com.supermap.realspace.ARControl
-
public class ARControl extends java.lang.Object3D AR control.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interfaceARControl.ARPlaneTrackingListenerAR plane tracking monitoring.static interfaceARControl.AugmentedImageTrackingListenerThe monitoring callback method after image tracking returns the name of the image that is currently successfully tracked, and can track up to 20 images simultaneously.
-
Constructor Summary
Constructors Constructor and Description ARControl(android.app.Activity activity, SceneControl sceneControl)Constructor, construct ARControl object according to activity and SceneControl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidconfigAugmentedImageInfo(java.lang.String[] picfilepath)Configure the name array of the reference image, place the reference image in the assets directory, and use the arcoreimg tool to check the image quality of the image.booleangetAugmentedImageTrackState()Get whether to enable enhanced image tracking status.voidsetAnchorOnClickListener(AnchorOnClickListener listener)Click the monitor on the anchor point to return the ID of the identified plane.voidsetARPlaneState(boolean value)Sets whether to display AR planesvoidsetARPlaneTrackingListener(ARControl.ARPlaneTrackingListener listenner)Set up AR plane tracking monitoring.voidsetARstate(boolean value)Set AR status.voidsetAugmentedImageTrackingListener(ARControl.AugmentedImageTrackingListener listenner)Set up image tracking monitoring.voidsetAugmentedImageTrackState(boolean isAugmentedImageTrack)Set whether to enable enhanced image tracking.voidsetFrustumDist(double NearDist, double FarDist)Set the near and far cropping plane of the AR camera.voidsetSceneRotation(double rotX, double rotY, double rotZ)Set the rotation of the scene.voidsetSceneScale(double scalex, double scaley, double scalez)Set the zoom of the scene.voidsetSceneTransLation(double transLationX, double transLationY, double transLationZ)Set the translation of the scene.voidsetUpdateAnchor(boolean value)Set whether to update the anchor status.
-
-
-
Constructor Detail
-
ARControl
public ARControl(android.app.Activity activity, SceneControl sceneControl)Constructor, construct ARControl object according to activity and SceneControl.- Parameters:
activity- specifies the activity.sceneControl- specifies sceneControl.
-
-
Method Detail
-
setARstate
public void setARstate(boolean value)
Set AR status.- Parameters:
value- A boolean value, true turns on AR mode, false turns off AR mode.
-
setAnchorOnClickListener
public void setAnchorOnClickListener(AnchorOnClickListener listener)
Click the monitor on the anchor point to return the ID of the identified plane.- Parameters:
listener- specifies the listener.
-
setSceneScale
public void setSceneScale(double scalex, double scaley, double scalez)Set the zoom of the scene.- Parameters:
scalex- X-axis scaling factor, default 1.0.scaley- Y-axis scaling factor, the default is 1.0.scalez- Z-axis zoom factor, the default is 1.0.
-
setSceneRotation
public void setSceneRotation(double rotX, double rotY, double rotZ)Set the rotation of the scene.- Parameters:
rotX- Rotation coefficient around X axis.rotY- Rotation coefficient around Y axis.rotZ- Rotation coefficient around the Z axis.
-
setSceneTransLation
public void setSceneTransLation(double transLationX, double transLationY, double transLationZ)Set the translation of the scene.- Parameters:
transLationX- The translation coefficient in the X-axis direction.transLationY- Y-axis translation coefficient.transLationZ- The translation coefficient in the Z-axis direction.
-
setUpdateAnchor
public void setUpdateAnchor(boolean value)
Set whether to update the anchor status.- Parameters:
value- Whether to update the anchor point, a boolean value. true update anchor point false do not update anchor point.
-
setAugmentedImageTrackState
public void setAugmentedImageTrackState(boolean isAugmentedImageTrack)
Set whether to enable enhanced image tracking.- Parameters:
isAugmentedImageTrack- is a boolean value, true turns on enhanced image tracking, false turns off enhanced image tracking.
-
getAugmentedImageTrackState
public boolean getAugmentedImageTrackState()
Get whether to enable enhanced image tracking status.- Returns:
- a boolean value, true turns on enhanced image tracking, false turns off enhanced image tracking.
-
configAugmentedImageInfo
public void configAugmentedImageInfo(java.lang.String[] picfilepath)
Configure the name array of the reference image, place the reference image in the assets directory, and use the arcoreimg tool to check the image quality of the image. The higher the quality, the better the tracking effect.- Parameters:
picfilepath- The name array of the reference image.
-
setAugmentedImageTrackingListener
public void setAugmentedImageTrackingListener(ARControl.AugmentedImageTrackingListener listenner)
Set up image tracking monitoring.- Parameters:
listenner- image tracking monitoring.
-
setARPlaneTrackingListener
public void setARPlaneTrackingListener(ARControl.ARPlaneTrackingListener listenner)
Set up AR plane tracking monitoring.- Parameters:
listenner- AR plane tracking monitoring.
-
setFrustumDist
public void setFrustumDist(double NearDist, double FarDist)Set the near and far cropping plane of the AR camera.
-
setARPlaneState
public void setARPlaneState(boolean value)
Sets whether to display AR planes- Parameters:
value- true means to display the plane. false means the plane is invisible
-
-