// Shaker
// Moves an entity

#include "racer.oxs"

handle hEntity;

void OnInit(handle h)
{
  //echo("OnInit");
  hEntity=h;
  //echo(h);
}

void OnFrame()
// Called every frame update
{
  //if(hEntity==0)return;
  
  Vector3 transform;
  
  float t;
  t=GetSimTime();
  t=t*0.003;
  transform.y=sin(t)+4.0;
  transform.x=-93;
  transform.z=-270;

  EntitySetPosition(hEntity,transform);

  float yaw=t*0.1,pitch=t*0.1;
  EntitySetRotation(hEntity,yaw,pitch,0);
  
  //echo("OnFrame");
  //echo(hEntity);
  //echo(t);
}

/* Design

#include "world/entity.oxs"

Entity entity;    // In .h?

void OnFrame()
{
  Vector3 v;
  v.y=sin(GetSimTime());
  entity.SetPosition(v);
}
*/
