예제 #1
0
void
sim_class_init(void)
{
  classes = avl_str_new();
  assert(classes && "avl tree not allocated");
  sim_class_t *cls = sim_register_class(NULL, "Object", Object_init,
                                        sizeof(sim_object_t));
  sim_class_add_field(cls, SIM_TYPE_CLASS_PTR,
                      "cls", offsetof(sim_object_t, cls));
  sim_class_add_field(cls, SIM_TYPE_UUID,
                      "uuid", offsetof(sim_object_t, uuid));
  sim_class_add_field(cls, SIM_TYPE_STR,
                      "name", offsetof(sim_object_t, name));

  objects = avl_uuid_new();
}
예제 #2
0
파일: gemeni.c 프로젝트: lorrden/openorbit
  sim_new_engine("Roll 0", capsule, SIM_THRUSTER, SIM_DISARMED, 1.0f,
               (float3){0.82, 0.55, 0.00}, (float3){0.0, 0.0,108.0});
  sim_new_engine("Roll 1", capsule, SIM_THRUSTER, SIM_DISARMED, 1.0f,
               (float3){-0.82, 0.55, 0.00}, (float3){0.0, 0.0,108.0});
  sim_new_engine("Pitch 0", capsule, SIM_THRUSTER, SIM_DISARMED, 1.0f,
               (float3){0.00, 2.20, 0.41}, (float3){0.0, 0.0,-108.0});
  sim_new_engine("Pitch 1", capsule, SIM_THRUSTER, SIM_DISARMED, 1.0f,
               (float3){0.00, 2.20,-0.41}, (float3){0.0, 0.0,108.0});
  sim_new_engine("Yaw 0", capsule, SIM_THRUSTER, SIM_DISARMED, 1.0f,
               (float3){0.41, 2.20, 0.00}, (float3){-108.0, 0.0,0.0});
  sim_new_engine("Yaw 1", capsule, SIM_THRUSTER, SIM_DISARMED, 1.0f,
               (float3){-0.41, 2.20, 0.00}, (float3){108.0, 0.0,0.0});


}

static void
GemeniInit2(sim_class_t *cls, void *sc, void *arg)
{
  SIM_SUPER_INIT(cls, sc, arg);
  GemeniInit(sc);
}

MODULE_INIT(gemeni, "spacecraft", NULL)
{
  log_trace("initialising 'gemeni' module");
  sim_class_t *cls = sim_register_class("Spacecraft", "Gemeni",
                                        GemeniInit2, sizeof(sim_spacecraft_t));
  (void)cls;
}