com.craftar
Class CraftARContent3dmodel
- java.lang.Object
-
- com.craftar.CraftARContentBase
-
- com.craftar.CraftARContent
-
- com.craftar.CraftARContent3dmodel
public class CraftARContent3dmodel extends CraftARContent
A 3d model content for aCraftARItemAR
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.craftar.CraftARContent
CraftARContent.ContentStatus, CraftARContent.ContentTouchEvent, CraftARContent.ContentWrapMode, CraftARContent.LoadContentInBackground
-
Nested classes/interfaces inherited from class com.craftar.CraftARContentBase
CraftARContentBase.ContentType, CraftARContentBase.ContentTypeName
-
-
Field Summary
Fields Modifier and Type Field and Description protected java.lang.String
mContentUri
-
Fields inherited from class com.craftar.CraftARContent
isAppInBg, mAlpha, mClickListener, mContentID, mHyperlinkUrl, mId, mNativeContentPtr, mRotationMatrix, mScale, mStatus, mTouchEventListener, mTranslation, mType, mUUID, mWrapMode
-
-
Constructor Summary
Constructors Constructor and Description CraftARContent3dmodel(JSONObject object)
Create a CraftARTracking3Dmodel using a JSON object with the 3D model from the scene description.CraftARContent3dmodel(java.lang.String contentPath)
Create aCraftARContent3dmodel
by specifying it's local path.CraftARContent3dmodel(java.lang.String contentPath, java.util.HashMap<java.lang.String,java.lang.String> textures)
Create aCraftARContent3dmodel
by specifying it's local path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected void
contentLoadFinalized(boolean success)
The content resources finished loading.protected void
drawWithItemPose(float[] translation, float[] rotation, int drawMode)
Draws the content according to it's parent ARItem pose.protected void
finalize()
void
setDownloadPercentHandler(CraftARContentDownloadProgressHandler handler)
Set a Download progress handlervoid
update()
Internal updateprotected void
updateContentAttributes()
Receives a notification that the content attributes (scale, pose, translation) have been modified.-
Methods inherited from class com.craftar.CraftARContent
cancelContentLoad, getAlpha, getContentType, getRotationMatrix, getScale, getStatus, getTranslation, getUUID, getWrapMode, onAppFinish, onAppPause, onAppResume, onDestroyedForOrientationChange, setAlpha, setContentClickListener, setContentTouchEventListener, setContentVersion, setRotationMatrix, setScale, setTranslation, setWrapMode
-
Methods inherited from class com.craftar.CraftARContentBase
clearContentResources, contentTypeFromJSON, trackingLost, trackingStarted
-
-
-
-
Constructor Detail
-
CraftARContent3dmodel
public CraftARContent3dmodel(java.lang.String contentPath)
Create aCraftARContent3dmodel
by specifying it's local path. Textures for the model will be looked up automatically and should be placed in the correct path relative to the model's path.- Parameters:
contentPath
- 3D model local path
-
CraftARContent3dmodel
public CraftARContent3dmodel(java.lang.String contentPath, java.util.HashMap<java.lang.String,java.lang.String> textures)
Create aCraftARContent3dmodel
by specifying it's local path. Textures for the model will be looked up automatically and should be placed in the correct path relative to the model's path.- Parameters:
contentPath
- 3D model local pathtextures
- Dictionary containing keys for the texture paths inside the model file and values for the actual locations of the model's textures
-
CraftARContent3dmodel
public CraftARContent3dmodel(JSONObject object) throws CraftARSDKException
Create a CraftARTracking3Dmodel using a JSON object with the 3D model from the scene description.- Parameters:
object
- JSON object containing the 3D model file urls and transformations applied to the content.- Throws:
CraftARSDKException
-
-
Method Detail
-
setDownloadPercentHandler
public void setDownloadPercentHandler(CraftARContentDownloadProgressHandler handler)
Set a Download progress handler- Parameters:
handler
- Handler class that will receive the download progress events.
-
updateContentAttributes
protected void updateContentAttributes()
Receives a notification that the content attributes (scale, pose, translation) have been modified. You can modify the attributes of anyCraftARContent
at runtime using the methodssetTranslation
,setRotationMatrix
,and setScale
.- Specified by:
updateContentAttributes
in classCraftARContent
-
contentLoadFinalized
protected void contentLoadFinalized(boolean success)
The content resources finished loading.- Specified by:
contentLoadFinalized
in classCraftARContent
- Parameters:
success
- True if the content was loaded successfully, false otherwise.
-
drawWithItemPose
protected void drawWithItemPose(float[] translation, float[] rotation, int drawMode)
Draws the content according to it's parent ARItem pose.- Specified by:
drawWithItemPose
in classCraftARContent
-
update
public void update()
Description copied from class:CraftARContent
Internal update- Overrides:
update
in classCraftARContent
-
finalize
protected void finalize()
- Overrides:
finalize
in classCraftARContent
-
-