Class arel.Object.Model3D
Creates a 3D Object to be used with junaio GLUE or junaio Location Based Channels
- Version 2.0
- Defined in: Model3D.js
- Extends arel.Object
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
arel.Object.Model3D(_id, _modelPath, _texturePath)
|
Method Summary
Class Detail
arel.Object.Model3D(_id, _modelPath, _texturePath)
Author: metaio GmbH.
- Parameters:
- {String} _id
- object id
- {String} _modelPath
- path to the model's texture
- {String} _texturePath
- path to the model's texture
Method Detail
-
<static> arel.Object.Model3D.create(_id, _modelPath, _texturePath)Create an 3D Model based on model and texture (can also only have modelPath if the model is a zipped obj or md2/fbx including the texture)
- Parameters:
- {String} _id
- object id
- {String} _modelPath
- path to the model's texture
- {String} _texturePath
- path to the model's texture
-
<static> arel.Object.Model3D.createFromImage(_id, _imagePath)Create an Image 3D Model based on an image provided.
- Parameters:
- {String} _id
- object id
- {String} _imagePath
- path to the image that shall be rendered
-
<static> arel.Object.Model3D.createFromMovie(_id, _moviePath)Create a Movie 3D Model based on an the movie file provided.
- Parameters:
- {String} _id
- object id
- {String} _moviePath
- path to the image that shall be rendered
-
{int} getAnimationSpeed()Defines the animation speed of an object (only valid for md2/fbx models).
- Returns:
- {int} The speed of the animation in fps. Default is 25fps.
- Requires:
- API level 8
-
{int} getCoordinateSystemID()Get the ID of the coordinateSystem the object is currently attached to (only valid feedback for GLUE channels/obejcts)
- Returns:
- {int} the coordinateSystem ID the object is bound to
- See:
- arel.Object.Model3D#setCoordinateSystemID
-
{String} getModel()Get the path to the model file
- Returns:
- {String} model path
- See:
- arel.Object.Model3D#getMovie()
- arel.Object.Model3D#getTexture()
-
{String} getMovie()Get the path to the movie file(3g2) mapped on the 3D model - can be undefined if zipped obj or md2/fbx used or texture is set
- Returns:
- {String} movie path
- See:
- arel.Object.Model3D#getModel()
- arel.Object.Model3D#getTexture()
-
getMovieTextureStatus(callback, caller)If an object has a movie texture applied, this method retrieves the current status (playing, paused, stopped, etc.) and position in seconds.
- Parameters:
- {function} callback
- a callback function resetAnimationSpeedceiving playback information as arel.MovieTextureStatus object
- {Object} caller
- the "this" object for the callback function call -> optional
-
{int} getRenderOrderPosition()Get the position where the object will be rendered. The z-Buffer will be ignored. The smaller the number, the earlier it will be drawn (further back in the scene)
- Returns:
- {int} Get the z-Buffer position of where the object shall be rendered. The "calculated" z-Buffer will be ignored.
- See:
- arel.Object.Model3D#setRenderOrderPosition
-
{arel.Rotation} getRotation()Get the Objects rotation from the point of origin. Rotation values unit depend on the type given.
- Returns:
- {arel.Rotation} Rotation of the 3D Object.
-
{arel.Vector3D} getScale()Get the Objects scale values along all axis.
- Returns:
- {arel.Vector3D} Scale of the 3D Object along all axis. To scale in "aspect ratio" use the same value for all axis.
- See:
- arel.Object.Model3D#setScale
-
{int} getScreenAnchor()Get the current screen anchor
- Returns:
- {int} _screenanchor integer created through bitmask:
ANCHOR_NONE No anchor, i.e. not relative-to-screen ANCHOR_LEFT Anchor to the left edge ANCHOR_RIGHT Anchor to the right edge ANCHOR_BOTTOM Anchor to the bottom edge ANCHOR_TOP Anchor to the top edge ANCHOR_CENTER_H Anchor to the horizontal center ANCHOR_CENTER_V Anchor to the vertical center
ANCHOR_TL Anchor to the Top-Left ANCHOR_TC Anchor to the Top-Center ANCHOR_TR Anchor to the Top-Right ANCHOR_CL Anchor to the Center-Left ANCHOR_CC Anchor to the Center ANCHOR_CR Anchor to the Center-Right ANCHOR_BL Anchor to the Bottom-Left ANCHOR_BC Anchor to the Bottom-Center ANCHOR_BR Anchor to the Bottom-Right
-
{int} getScreenAnchorFlags()Get the current screen anchor flags
- Returns:
- {int} the current screenanchor flags
FLAG_NONE No flag, all geometric transforms are considered FLAG_IGNORE_ROTATION ignore rotation of the geometry FLAG_IGNORE_ANIMATIONS ignore animations of the geometry FLAG_IGNORE_SCREEN_RESOLUTION same as FLAG_MATCH_DISPLAY FLAG_MATCH_DISPLAY scale model to be same physical size on all displays FLAG_AUTOSCALE Autoscale geometries according to the screen resolution and/or display density.
-
{arel.Vector2D} getScreenCoordinates()Get the Objects relative to screen coordinates (Only if Translation and Location is not set)
- Returns:
- {arel.Vector2D} Position of the 3D Object on the Screen
- See:
- arel.Object.Model3D#setScreenCoordinates
-
{String} getTexture()Get the path to the texture file (jpg/png) which is mapped on the model - can be undefined if zipped obj or md2/fbx used or movie is set
- Returns:
- {String} texture path
- See:
- arel.Object.Model3D#getModel()
- arel.Object.Model3D#getMovie()
-
{arel.Vector3D} getTranslation()Get the Objects translation from the point of origin (Only if OnScreen is not set). For location-based Channels the point of origin is at the position of the user. For GLUE Channels i is in the center of the pattern.
- Returns:
- {arel.Vector3D} Position of the 3D Object from the point of origin
-
{float} getTransparency()Get the transparency of the 3D model.
- Returns:
- {float} The transparency value, where 1 corresponds to an invisible model and 0 corresponds to a fully opaque model).
- See:
- arel.Object.Model3D#setTransparency
-
getType()Get the Object type constant (3d)
-
{boolean} isOccluding()Get whether the Object is an occlusion Object
- Returns:
- {boolean} true if Object is an occlusion model
-
{boolean} isPickingEnabled()use this method to determine whether an object can be picked or not (clicked)
- Returns:
- {boolean} true if picking is enabled, false otherwise
-
pauseAnimation()Pause the currently playing animation of the 3D model (only valid for md2/fbx models) *
-
pauseMovieTexture()If an object has a movie texture applied, you can pause it with this call
-
setAnimationSpeed(_speed)Defines the animation speed of an object (only valid for md2/fbx models).
- Parameters:
- {int} _speed
- The speed of the animation in fps. Default is 25fps.
- Requires:
- API level 8
-
setCoordinateSystemID(coordinateSystemID)Set the ID of the coordinateSystem the object is currently attached to (only valid feedback for GLUE channels/obejcts)
- Parameters:
- {int} coordinateSystemID
- the coordinateSystem ID the object is bound to
-
setModel(_modelPath)Set the path to the model file
- Parameters:
- {String} _modelPath
- path to the model resource
-
setMovie(_moviePath)Set the path to the movie file (3g2) to be mapped on the model
- Parameters:
- {String} _moviePath
- path to a movie that shall be mapped on the 3D model
-
setOccluding(enableOcclusion)Set the Objects to be an occlusion Object
- Parameters:
- {boolean} enableOcclusion
- true if Object is supposed to be an occlusion model
-
setPickingEnabled(_pickable)use this method to declare whether an object can be picked or not (clicked)
- Parameters:
- {boolean} _pickable
- true to enable picking of this model, false to disable it
-
setRenderOrderPosition(_renderorderposition)Set the position where the object will be rendered. The z-Buffer will be ignored. The smaller the number, the earlier it will be drawn (further back in the scene)
- Parameters:
- {int} _renderorderposition
- set the z-Buffer position of where the object shall be rendered. The "calculated" z-Buffer will be ignored.
-
{arel.Rotation} setRotation(_rotation)Set the Objects rotation from the point of origin. Rotation values unit depend on the type given.
- Parameters:
- _rotation
- Returns:
- {arel.Rotation} rotationValue Rotation of the 3D Object.
-
setScale(scaleValue)Set the Objects scale values along all axis.
- Parameters:
- {arel.Vector3D} scaleValue
- Scale of the 3D Object along all axis. To scale in "aspect ratio" use the same value for all axis.
-
setScreenAnchor(_screenanchor, _screenanchorflags)Set the screenanchor of the object.
- Parameters:
- {int} _screenanchor
- integer created through bitmask:
ANCHOR_NONE No anchor, i.e. not relative-to-screen ANCHOR_LEFT Anchor to the left edge ANCHOR_RIGHT Anchor to the right edge ANCHOR_BOTTOM Anchor to the bottom edge ANCHOR_TOP Anchor to the top edge ANCHOR_CENTER_H Anchor to the horizontal center ANCHOR_CENTER_V Anchor to the vertical center
ANCHOR_TL Anchor to the Top-Left ANCHOR_TC Anchor to the Top-Center ANCHOR_TR Anchor to the Top-Right ANCHOR_CL Anchor to the Center-Left ANCHOR_CC Anchor to the Center ANCHOR_CR Anchor to the Center-Right ANCHOR_BL Anchor to the Bottom-Left ANCHOR_BC Anchor to the Bottom-Center ANCHOR_BR Anchor to the Bottom-Right - {int} _screenanchorflags
- integer created through bitmask:
FLAG_NONE No flag, all geometric transforms are considered FLAG_IGNORE_ROTATION ignore rotation of the geometry FLAG_IGNORE_ANIMATIONS ignore animations of the geometry FLAG_IGNORE_SCREEN_RESOLUTION same as FLAG_MATCH_DISPLAY FLAG_MATCH_DISPLAY scale model to be same physical size on all displays FLAG_AUTOSCALE Autoscale geometries according to the screen resolution and/or display density.
-
setScreenCoordinates(_onscreen)Set the Objects relative to screen coordinates (Only if Translation and Location is not set)
- Parameters:
- {arel.Vector2D} _onscreen
- Position of the 3D Object on the Screen
-
setTexture(_texturePath)Set the path to the texture file (jpg/png) which is mapped on the model - not required if zipped obj or md2/fbx used or movie is set
- Parameters:
- {String} _texturePath
- path to the model's texture
-
setTranslation(translationValues)Sets the Objects translation from the point of origin (Only if OnScreen is not set). For location-based Channels the point of origin is at the position of the user. For GLUE Channels i is in the center of the pattern.
- Parameters:
- {arel.Vector3D} translationValues
- Position of the 3D Object from the point of origin
-
setTransparency(transparency)Set the transparency of the 3D model.
- Parameters:
- {float} transparency
- The transparency value, where 1 corresponds to an invisible model and 0 corresponds to a fully opaque model).
-
startAnimation(animationName, loop)Start an 3D model's animation (only valid for md2/fbx models)
- Parameters:
- {string} animationName
- Name of the animation to be started
- {boolean} loop
- true if the animation shall be looped, false otherwise
-
startMovieTexture(loop)If an object has a movie texture applied, you can start it with this call
- Parameters:
- {boolean} loop
- true if the animation shall be looped, false otherwise, default: false
-
stopAnimation()Stop a 3D model's animation (only valid for md2/fbx models).
-
stopMovieTexture()If an object has a movie texture applied, you can stop it with this call