Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > Drawable
Filters

Class Drawable - extends ARchitectObject

Known Subclasses:
Drawable2D Model
A Drawable is the base class for any graphical representation of a GeoObject.

Drawable is a superclass for other classes and must not be directly instantiated by the developer.

Rotations can be applied to Drawables. The local coordinate system of a Drawable is defined as a righthanded coordinate system, following the definitions below:
  • The origin of the coordinate system is in the location of the Object the Drawable is attached to.
  • The x axis is pointing right
  • The y axis is pointing up
  • The z axis is pointing out of the screen.
The definition of right and up depend on the type of the ARObject the Drawable is attached to. In case of a GeoObject, the direction are defined relative to the earth's surface, and the Drawable is always oriented towards the user. In case of an Trackable2DObject, the directions are defined relative to the underlying tracked object.

Rotations are defined and applied in roll-tilt-heading definition (in this order), using static axis.

Properties

enabled - boolean

Flag to enable/disable the Drawable. If the Drawable is disabled, it will never appear on the screen and triggers on this Drawable will never be fired. In case it is enabled, it can be rendered on the screen and fire triggers.
Default Value: true

heading - float

Deprecated: Use rotate.heading instead.

roll - float

Deprecated: Use rotate.roll instead.

rotate.heading - float

Defines a rotation of the Drawable around the y-axis, specified in degrees. Values will be applied modulo 360. A value of 361 degrees has the same effect as setting the value to 1 degree.
Default Value: 0

rotate.roll - float

Defines a rotation of the Drawable around the z-axis, specified in degrees. Values will be applied modulo 360. A value of 361 degrees has the same effect as setting the value to 1 degree.
Default Value: 0

rotate.tilt - float

Defines a rotation of the Drawable around the x-axis, specified in degrees. Values will be applied modulo 360. A value of 361 degrees has the same effect as setting the value to 1 degree.
Default Value: 0

tilt - float

Deprecated: Use rotate.tilt instead.

Properties inherited from ARchitectObject:

Methods

onClick

boolean onClick ( arObject )
When the Drawable is clicked, the system will trigger Drawable.onClick(ARObject). A click on the screen might hit multiple Drawables, thus a click creates a "clicked Drawables-queue", with the uppermost Drawable in the front of the queue. The return value of the function determines if, after the onClick()-Function was executed for this Drawable, the queue shall continue to execute onClick() for the next Drawable in the queue. In case the last Drawable in the queue still requests to continue the click-queue, ARObject.onClick() will be executed. If the queue still continues, context.onScreenClick() will be executed.
Parameters:
arObject <ARObject> the ARObject the clicked Drawable is attached to.
Returns: boolean
  • false - The click-queue should not stop with this Drawable. Thus, the next Drawable's onClick() function will be executed. This is the default value in case no return value is set or the function is not defined for this Drawable.
  • true - The queue-execution will stop at the current Drawable, underlying Drawables will not receive onClick() calls.
The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onClick.

triggers.onClick

void triggers.onClick ( )
Returns: void
Deprecated Use onClick instead.

Methods inherited from ARchitectObject:


Copyright © 2013 Wikitude GmbH. All rights reserved.