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 loadTarget, it can be detected and tracked by ObjectTracker.
void easyar_ObjectTarget_createFromParameters(easyar_ObjectTargetParameters * parameters, easyar_OptionalOfObjectTarget * Return)
static std::optional<std::shared_ptr<ObjectTarget>> createFromParameters(std::shared_ptr<ObjectTargetParameters> parameters)
public static @Nullable ObjectTarget createFromParameters(@Nonnull ObjectTargetParameters parameters)
companion object fun createFromParameters(parameters: ObjectTargetParameters): ObjectTarget?
+ (easyar_ObjectTarget *)createFromParameters:(easyar_ObjectTargetParameters *)parameters
public static func createFromParameters(_ parameters: ObjectTargetParameters) -> ObjectTarget?
public static Optional<ObjectTarget> createFromParameters(ObjectTargetParameters parameters)
void easyar_ObjectTarget_createFromObjectFile(easyar_String * path, easyar_StorageType storageType, easyar_String * name, easyar_String * uid, easyar_String * meta, float scale, easyar_OptionalOfObjectTarget * Return)
static std::optional<std::shared_ptr<ObjectTarget>> createFromObjectFile(std::string path, StorageType storageType, std::string name, std::string uid, std::string meta, float scale)
public static @Nullable ObjectTarget createFromObjectFile(java.lang.@Nonnull String path, int storageType, java.lang.@Nonnull String name, java.lang.@Nonnull String uid, java.lang.@Nonnull String meta, float scale)
companion object fun createFromObjectFile(path: String, storageType: Int, name: String, uid: String, meta: String, scale: Float): ObjectTarget?
+ (easyar_ObjectTarget *)createFromObjectFile:(NSString *)path storageType:(easyar_StorageType)storageType name:(NSString *)name uid:(NSString *)uid meta:(NSString *)meta scale:(float)scale
public static func createFromObjectFile(_ path: String, _ storageType: StorageType, _ name: String, _ uid: String, _ meta: String, _ scale: Float) -> ObjectTarget?
public static Optional<ObjectTarget> createFromObjectFile(string path, StorageType storageType, string name, string uid, string meta, float 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 of measurement in the model coordinate system is meters.)
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
void easyar_ObjectTarget_boundingBox(easyar_ObjectTarget * This, easyar_ListOfVec3F * * Return)
std::vector<Vec3F> boundingBox()
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> boundingBox()
fun boundingBox(): ArrayList<Vec3F>
- (NSArray<easyar_Vec3F *> *)boundingBox
public func boundingBox() -> [Vec3F]
public virtual List<Vec3F> boundingBox()
Set the scaling factor of the model. After setting, it will override 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 of measurement in the model coordinate system is meters.)
Additionally, you need to set this model scaling separately in the rendering engine.
Note that this setting must be done before loading into ObjectTracker via loadTarget.
bool easyar_ObjectTarget_setScale(easyar_ObjectTarget * This, float scale)
bool setScale(float scale)
public boolean setScale(float scale)
fun setScale(scale: Float): Boolean
- (bool)setScale:(float)scale
public func setScale(_ scale: Float) -> Bool
public virtual bool setScale(float scale)
Get the target UID. The UID of ImageTarget is used in cloud-recognition algorithms. When not connected to cloud-recognition, you can set this UID in the JSON configuration and use it as another way to distinguish targets in your own code.
void easyar_ObjectTarget_setName(easyar_ObjectTarget * This, easyar_String * name)
void setName(std::string name)
public void setName(java.lang.@Nonnull String name)
fun setName(name: String): Unit
- (void)setName:(NSString *)name
public override func setName(_ name: String) -> Void
public override void setName(string name)
Get the meta data set by setMetaData. Or, in targets returned by cloud-recognition, get the meta data set by the server.
void easyar_ObjectTarget_setMeta(easyar_ObjectTarget * This, easyar_String * data)
void setMeta(std::string data)
public void setMeta(java.lang.@Nonnull String data)
fun setMeta(data: String): Unit
- (void)setMeta:(NSString *)data
public override func setMeta(_ data: String) -> Void
public override void setMeta(string data)