Ejemplo n.º 1
0
 @Override
 public boolean placeObjectToVessel(NormalObject normalObject, SEAnimFinishListener l) {
   SEDebug.myAssert(
       normalObject.getObjectInfo().mSlotType == ObjectInfo.SLOT_TYPE_WALL_SHELF,
       "must be WALL_SHELF");
   boolean b =
       this.placeObjectOnMountPoint(
           normalObject,
           -1,
           normalObject.getObjectInfo().mSlotType,
           normalObject.getObjectSlot().mSlotIndex,
           normalObject.getObjectSlot().mMountPointIndex);
   return b;
 }
Ejemplo n.º 2
0
 private boolean placeObjectOnMountPoint(
     NormalObject conflictObject,
     int conflictObjectMountPointIndex,
     int moveObjectSlotType,
     int moveObjectSlotIndex,
     int moveObjectMountPointIndex) {
   SEVector3f desLocation = null;
   if (moveObjectSlotType != ObjectInfo.SLOT_TYPE_WALL_SHELF) {
     int emptyMountPointIndex =
         mWallShelf.getMountPointIndexExceptDest(conflictObject, conflictObjectMountPointIndex);
     if (emptyMountPointIndex == -1) {
       return false;
     }
     desLocation = mWallShelf.getSlotPosition(conflictObject.mName, emptyMountPointIndex);
   } else {
     if (moveObjectSlotIndex == mWallShelf.mIndex) {
       desLocation = mWallShelf.getSlotPosition(conflictObject.mName, moveObjectMountPointIndex);
     } else {
       SEObject parent = getScene().findObject(mWallShelf.mName, moveObjectSlotIndex);
       if ((parent instanceof WallShelf) == false) {
         Log.i(TAG, "## parent is not wallshelf ##");
       }
       conflictObject.changeParent(parent);
       WallShelf parentShelf = (WallShelf) parent;
       desLocation = parentShelf.getSlotPosition(conflictObject.mName, moveObjectMountPointIndex);
     }
   }
   conflictObject.getObjectInfo().mObjectSlot.mSlotIndex = moveObjectSlotIndex;
   conflictObject.getObjectInfo().mObjectSlot.mMountPointIndex = moveObjectMountPointIndex;
   conflictObject.getUserTransParas().mTranslate = desLocation;
   conflictObject.getUserTransParas().mRotate.set(0, 0, 0, 1);
   conflictObject.setUserTransParas();
   return true;
 }