Ovis_Entity_Animation_Set()
摘要
设置 Ovis 实体的动画并启用它。
语法
Ovis_Entity_Animation_Set (ent_ptr, name, aggregation_mode, type, force, dead_reckoning)
| 参数 | 类型 | 说明 |
|---|---|---|
ent_ptr |
OvisT_Entity * |
指定实体 |
name |
const char * |
指定名称(可以为 NIL) |
aggregation_mode |
OvisT_Aggregation_Mode |
指定聚合模式 |
type |
OvisT_DIS_Type |
指定 DIS 类型 |
force |
OvisT_DIS_Force |
指定 DIS 阵营 |
dead_reckoning |
OvisT_DIS_Dead_Reckoning |
指定 DIS 航位推算 |
返回类型
OvisT_Compcode
若表示(representation)能够更新则返回 OvisC_Compcode_Success,否则返回 OvisC_Compcode_Failure。
头文件
ovis_entity.h
详情
该函数设置 Ovis 实体的动画。
因发现其他联邦成员(federate)创建的 RTI 对象而生成的实体,其动画无法更改;如果指定了这样的实体,该函数将返回 OvisC_Compcode_Failure。
示例
OvisT_Entity * ent_ptr;
/* Associate the entity with a node instance and show it as a friendly Super Cobra */
OvisT_DIS_Type dis = { 1, 2, 225, 20, 2, 10, 0 };
ent_ptr = Ovis_Entity_From_Objid_Create (op_topo_parent (op_id_sefl ()), OPC_NIL,
OPC_NIL);
Ovis_Entity_Animation_Set (ent_ptr, OPC_NIL,
OvisC_Aggregation_Entity, dis, OvisC_DIS_Force_Friendly,
OvisC_DIS_DR_Static);
Ovis_Entity_Animation_Enable (ent_ptr);
错误
- 实体为 NIL。
参考
- 使用函数 Ovis_Entity_Animation_Get() 可以获取实体在 3D Network Visualizer 中的显示方式。