| 86 | } |
| 87 | |
| 88 | void FileSystemActor::onLaunch() |
| 89 | { |
| 90 | assert(!filePath.isNull()); |
| 91 | |
| 92 | if (!_onLaunchHandler.empty()) |
| 93 | _onLaunchHandler(this); |
| 94 | |
| 95 | // override for widgets |
| 96 | Widget * w = widgetManager->getActiveWidgetForFile(getFullPath()); |
| 97 | if (w && w->isWidgetOverrideActor(this)) |
| 98 | { |
| 99 | w->launchWidgetOverride(this); |
| 100 | return; |
| 101 | } |
| 102 | |
| 103 | // Do a quick pass to determine what needs to be created or not |
| 104 | bool isWatchingHighlighted = cam->isWatchedActorHighlighted(this); |
| 105 | bool zoomIntoImage = isFileSystemType(Image) && !isWatchingHighlighted && texMgr->isTextureState(thumbnailID, TextureLoaded); |
| 106 | bool launchImage = (isFileSystemType(Image) && isWatchingHighlighted) && !texMgr->isTextureState(thumbnailID, TextureLoaded); |
| 107 | bool createTemporaryActor = !zoomIntoImage && !launchImage; |
| 108 | bool createRandomAnimPath = createTemporaryActor; |
| 109 | |
| 110 | Actor * obj = NULL; |
| 111 | if (createTemporaryActor) |
| 112 | { |
| 113 | obj = new Actor(); |
| 114 | Vec3 startPosition; |
| 115 | |
| 116 | // Set up the state of the Actor |
| 117 | obj->pushActorType(Temporary); |
| 118 | obj->setDims(getDims()); |
| 119 | obj->setGravity(false); |
| 120 | obj->setCollisions(false); |
| 121 | obj->setAlphaAnim(getAlpha(), 0.2f, 40); |
| 122 | obj->setGlobalPose(getGlobalPose()); |
| 123 | obj->setObjectToMimic(this); |
| 124 | } |
| 125 | |
| 126 | // Special case for launching a pileized actor |
| 127 | Vec3 startPosition; |
| 128 | if (isPileized()) |
| 129 | { |
| 130 | startPosition = pileizedPile->getGlobalPosition(); |
| 131 | }else{ |
| 132 | startPosition = getGlobalPosition(); |
| 133 | } |
| 134 | |
| 135 | // create random animation path from the icon up to the camera eye |
| 136 | if (createRandomAnimPath) |
| 137 | { |
| 138 | // Set an animation that moves the icon into the camera |
| 139 | CreateRandomAnimPath(obj, startPosition, cam->getEye(), 40); |
| 140 | |
| 141 | // Delete the object after the random animation is over. |
| 142 | animManager->removeAnimation(obj); |
| 143 | animManager->addAnimation(AnimationEntry(obj, (FinishedCallBack) DeleteActorAfterAnim)); |
| 144 | } |
| 145 |
nothing calls this directly
no test coverage detected