Class ObjectTarget
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
ObjectTarget represents a 3D object target, which can be tracked by `ObjectTracker`_. The size of ObjectTarget is determined by the `obj` file. The size can be changed by modifying `scale`. `scale` defaults to 1. After ObjectTarget is successfully loaded into `ObjectTracker`_ through `ObjectTracker.loadTarget`_, it can be detected and tracked by `ObjectTracker`_.
public class ObjectTarget : Target, IDisposable
- Inheritance
-
ObjectTarget
- Implements
- Inherited Members
Constructors
ObjectTarget()
public ObjectTarget()
Methods
Clone()
public ObjectTarget Clone()
boundingBox()
The bounding box of the object, including the 8 vertices of the box. Vertex indices are defined as follows: ::
4-----7
/| /|
5-----6 | z
| | | | |
| 0---|-3 o---y
|/ |/ /
1-----2 x
</p>
public virtual List<Vec3F> boundingBox()
createFromObjectFile(string, StorageType, string, string, string, float)
Creates from obj, mtl, and jpg/png files.
public static Optional<ObjectTarget> createFromObjectFile(string path, StorageType storageType, string name, string uid, string meta, float scale)
Parameters
pathstorageTypenameuidmetascale
createFromParameters(ObjectTargetParameters)
Creates from parameters.
public static Optional<ObjectTarget> createFromParameters(ObjectTargetParameters parameters)
Parameters
parameters
meta()
Gets the meta data set by setMetaData. Or, in a target returned by cloud recognition, gets the meta data set by the server.
public override string meta()
name()
Gets the target name. The name is used to distinguish targets in a json file.
public override string name()
runtimeID()
Gets the target id. target id is integer data created at runtime and is valid (non-zero) only after successful configuration. This id is non-zero and globally incremental.
public override int runtimeID()
scale()
Scale ratio of the model. Its value is the ratio between the physical size of the model in space and its size in the model coordinate system. The default value is 1. (Assuming the scale unit in the model coordinate system is meters.)
public virtual float scale()
setMeta(string)
Sets meta data. This operation overrides the previous setting or data returned by the server.
public override void setMeta(string data)
Parameters
data
setName(string)
Sets the target name. This operation overrides the previous setting or data returned by the server.
public override void setName(string name)
Parameters
name
setScale(float)
Sets the scale ratio of the model. After it is set, it overrides the default value and the value set in the json file. Its value is the ratio between the physical size of the model in space and its size in the model coordinate system. The default value is 1. (Assuming the scale unit in the model coordinate system is meters.) This model scale also needs to be set separately in the rendering engine. Note that this setting must be made before loading it into `ObjectTracker`_ through `ObjectTracker.loadTarget`_.
public virtual bool setScale(float scale)
Parameters
scale
uid()
Gets the target uid. The uid of ImageTarget is used in the cloud recognition algorithm. When cloud recognition is not integrated, you can set this uid in json configuration and use it in your own code as another way to distinguish targets.
public override string uid()