/*
 * Copyright (C) 2019 Open Source Robotics Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/

syntax = "proto3";
package gz.msgs;
option java_package = "com.gz.msgs";
option java_outer_classname = "ActorProtos";

/// \ingroup gz.msgs
/// \interface Actor
/// \brief Message for an actor

import "gz/msgs/entity.proto";
import "gz/msgs/header.proto";
import "gz/msgs/pose.proto";

message Actor
{
  message Animation
  {
    /// \brief Unique name for animation
    string name           = 1;

    /// \brief Path to animation file. Accepted formats: COLLADA, BVH
    string filename       = 2;

    /// \brief Scale for the animation skeleton
    float scale           = 3;

    /// \brief Set to true so the animation is interpolated on X
    bool interpolate_x = 4;
  }

  message Waypoint
  {
    /// \brief Time in seconds, counted from the beginning of the script
    float time = 1;

    /// \brief Pose to be reached at the given time
    Pose pose  = 2;
  }

  message Trajectory
  {
    /// \brief Unique id for a trajectory
    uint32 id           = 1;

    /// \brief Type of an animation
    string type         = 2;

    /// \brief Tension of the trajectory spline
    float tension       = 3;

    /// \brief Points in the trajectory
    repeated Waypoint waypoints  = 4;
  }

  /// \brief Optional header data
  Header header         =  1;

  /// \brief A unique name for the actor
  Entity entity           =  2;

  /// \brief Pose of the actor
  Pose pose             =  3;

  /// \brief Skin file which defines a visual
  /// and the underlying skeleton which moves it
  string skin_filename  =  4;

  /// \brief Scale the skin's size
  float skin_scale      =  5;

  /// \brief Animations for the skeleton in the skin
  repeated Animation animations  =  6;

  /// \brief Set this to true for the script to be repeated in a loop
  bool script_loop               =  7;

  /// \brief Time (in secs) to wait before starting the script
  float script_delay_start       = 8;

  /// \brief Set to true if the animation should start
  /// as soon as the simulation starts playing
  bool script_auto_start         = 9;

  /// \brief A series of keyframes to be followed
  repeated Trajectory trajectories = 10;

  /// \brief Unique id of actor's parent
  Entity parent  = 11;
}
