EPFL_GO111 发表于 2010-5-8 10:28:50

基于距离来选择路径?

本帖最后由 EPFL_GO111 于 2010-5-8 10:32 编辑

now i have an idea that if the leader object in the route 1 has the distance less than 10 meters (for example), i would choose the route 2 to avoid it.. however, if the leader object in the route 1 has the distance greater than 10 meters, i would choose the route 1 to continue my journey.

Can Extendsim detect the distance? or how can i realize this function by using other ways?

thank you for sharing your ideas. thx

如题,我想实现如下效果:如果我前面的小球(在路径1)距离我小于10米,我就会选择路径2去避免与他相碰,但是,如果我前面的小球(在路径1)距离我大于10米,我还是会选择路径1去继续我的旅程。

请问Extendsim可以探测距离吗?还是要用其它方法去实现?谢谢指导!!

iesim 发表于 2010-5-8 14:50:36

你可以记录前面小球开始行走时间和速度,放在全局数组中,然后当前小球可以查询每个小球距离当前小球的距离,然后做出决策,并不复杂.

EPFL_GO111 发表于 2010-5-8 20:37:04

2# iesim

iesim,你给了我很重要的提示,谢谢
页: [1]
查看完整版本: 基于距离来选择路径?