Ejemplo n.º 1
0
/*----------------------------------------------------------------------
 |
 | GetCameraMotionByIndex3ds
 |
 |  db: database to be searched
 |  index: index of camera in name list
 |  kfcam: Ptr to the addr of kfcamera3ds structure, if (*kfcam) 
 |         is null, then memory will be allocated for the new
 |         structure, otherwise, the existing structure will be 
 |         filled in with the new values.  If no match is found, then
 |         kfcam remains unchanged.
 | 
 +----------------------------------------------------------------------*/
void GetCameraMotionByIndex3ds(database3ds *db, 
                   ulong3ds index,
                   kfcamera3ds **kfcam)
{
  chunk3ds *pCameraChunk, *pTargetChunk;
  namelist3ds *list = NULL;
  char3ds *name;
  
  if(db == NULL) 
    SET_ERROR_RETURN(ERR_INVALID_ARG);

  GetCameraNodeNameList3ds(db, &list);

  if(index < list->count){

    name = list->list[index].name;
    kfFindNamedAndTaggedChunk(db, name, CAMERA_NODE_TAG, &pCameraChunk);

    if (pCameraChunk){
      kfFindNamedAndTaggedChunk(db, name, TARGET_NODE_TAG, &pTargetChunk);
      GetCameraMotion3ds(pCameraChunk, pTargetChunk, kfcam);
    }
  }
  /*--- release list when done using name */
  ReleaseNameList3ds(&list);
}
Ejemplo n.º 2
0
/*----------------------------------------------------------------------
 |
 | GetCameraMotionByName3ds
 |
 |  db: database to be searched
 |  name: name of camera
 |  kfcam: Ptr to the addr of kfcamera3ds structure, if (*kfcam) 
 |         is null, then memory will be allocated for the new
 |         structure, otherwise, the existing structure will be 
 |         filled in with the new values.  If no match is found, then
 |         kfcam remains unchanged.
 | 
 +----------------------------------------------------------------------*/
void GetCameraMotionByName3ds(database3ds *db, 
                  const char3ds *name, 
                  kfcamera3ds **kfcam)
{
  chunk3ds *pCameraChunk, *pTargetChunk;

  if ((db == NULL) || (name == NULL)) SET_ERROR_RETURN(ERR_INVALID_ARG);
  if (db->topchunk == NULL) SET_ERROR_RETURN(ERR_INVALID_DATABASE);
  if ((db->topchunk->tag != M3DMAGIC) && (db->topchunk->tag != CMAGIC))
     SET_ERROR_RETURN(ERR_WRONG_DATABASE);
  
  kfFindNamedAndTaggedChunk(db, name, CAMERA_NODE_TAG, &pCameraChunk);

  if (pCameraChunk)
      kfFindNamedAndTaggedChunk(db, name, TARGET_NODE_TAG, &pTargetChunk);

  if (pCameraChunk)
    GetCameraMotion3ds(pCameraChunk, pTargetChunk, kfcam);

}
Ejemplo n.º 3
0
/*----------------------------------------------------------------------
 |
 | GetOmnilightMotionByName3ds
 |
 |  db: database to be searched
 |  name: name of Omnilight
 |  kfomni: Ptr to the addr of kfomni3ds structure, if (*kfomni) 
 |         is null, then memory will be allocated for the new
 |         structure, otherwise, the existing structure will be 
 |         filled in with the new values.  If no match is found, then
 |         kfomni remains unchanged.
 | 
 +----------------------------------------------------------------------*/
void GetOmnilightMotionByName3ds(database3ds *db, 
                  char3ds *name, 
                  kfomni3ds **kfomni)
{
    chunk3ds *pChunk;
  
    if(db == NULL || name == NULL)
      SET_ERROR_RETURN(ERR_INVALID_ARG);

    kfFindNamedAndTaggedChunk(db, name, LIGHT_NODE_TAG, &pChunk);

  if (pChunk)
    GetOmnilightMotion3ds(pChunk, kfomni);
}
Ejemplo n.º 4
0
/*----------------------------------------------------------------------
 |
 | GetOmnilightMotionByIndex3ds
 |
 |  db: database to be searched
 |  index: index of Omnilight in name list
 |  kfomni: Ptr to the addr of kfomni3ds structure, if (*kfomni) 
 |         is null, then memory will be allocated for the new
 |         structure, otherwise, the existing structure will be 
 |         filled in with the new values.  If no match is found, then
 |         kfomni remains unchanged.
 | 
 +----------------------------------------------------------------------*/
void GetOmnilightMotionByIndex3ds(database3ds *db, 
                  ulong3ds index,
                  kfomni3ds **kfomni)
{
    chunk3ds *pOmniChunk;
    namelist3ds *list = NULL;
    char3ds *name;
  
    if (db == NULL)
      SET_ERROR_RETURN(ERR_INVALID_ARG); 

    GetOmnilightNodeNameList3ds(db, &list);

    if (index < list->count){
      name = list->list[index].name;
      kfFindNamedAndTaggedChunk(db, name, LIGHT_NODE_TAG, &pOmniChunk);

      if (pOmniChunk)
    GetOmnilightMotion3ds(pOmniChunk, kfomni);
    }  
    /*--- release list when done using name */
    ReleaseNameList3ds(&list);
  }