Table of Contents

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. You can modify the size by changing the `scale`. The default `scale` is 1. After ObjectTarget is successfully loaded into `ObjectTracker` via `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()

Returns

CloneObject()

protected override object CloneObject()

Returns

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()

Returns

createFromObjectFile(string, StorageType, string, string, string, float)

Created 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

path
storageType
name
uid
meta
scale

Returns

createFromParameters(ObjectTargetParameters)

Created from parameters.

public static Optional<ObjectTarget> createFromParameters(ObjectTargetParameters parameters)

Parameters

parameters

Returns

meta()

Get the meta data set by setMetaData. Or, in targets returned by cloud recognition, get the meta data set by the server.

public override string meta()

Returns

name()

Get the target name. The name is used to distinguish targets in the json file.

public override string name()

Returns

runtimeID()

Get the target id. The target id is an integer created at runtime, and it is only valid (non-zero) after successful configuration. This id is non-zero and globally incremented.

public override int runtimeID()

Returns

scale()

The scaling factor of the model. Its value is the ratio of the physical size of the model in space to its size in the model coordinate system, with a default value of 1. (Assuming the unit in the model coordinate system is meters.)

public virtual float scale()

Returns

setMeta(string)

Set meta data. This operation overwrites the previous setting or data returned by the server.

public override void setMeta(string data)

Parameters

data

setName(string)

Set the target name. This operation overwrites the previous setting or data returned by the server.

public override void setName(string name)

Parameters

name

setScale(float)

Set the scaling factor of the model. After setting, it overrides the default value and the value set in the json file. Its value is the ratio of the physical size of the model in space to its size in the model coordinate system, with a default value of 1. (Assuming the unit in the model coordinate system is meters.) You also need to set this model scaling separately in the rendering engine. Note that this setting must be done before loading into `ObjectTracker` via `ObjectTracker.loadTarget`.

public virtual bool setScale(float scale)

Parameters

scale

Returns

uid()

Get the target uid. The uid of ImageTarget is used in cloud recognition algorithms. When cloud recognition is not connected, you can set this uid in the json configuration and use it as another way to distinguish targets in your own code.

public override string uid()

Returns