用户:
迷失冷光查看:7 回复:14 评论:7 创建时间:2021-06-27T09:13:12
首先我们需要一个喵的模型
然后给它加上个标签“喵”
然后我们定义一个函数:
function getEntityBounds(entity){
const lo = entity.position.sub(entity.bounds);
const hi = entity.position.add(entity.bounds);
const bounds = new Box3Bounds3(lo,hi);
return bounds;
}
——注:此函数来自赛车模板
然后遍历所有喵
world.querySelectorAll('.喵').forEach((e)=>{
const bounds = getEntityBounds(e);
world.addZone({
bounds,
force: [0,0.1,0],
})
})
馫龘飝鱻灥麤靐飍朤馫譶龘飝虪齺world.querySelectorAll('.喵').forEach((e)=>{ c喵tbounds=getEntityBounds(e); world.addZone({ bounds, force:[0,0.1,0], }) })
点赞0
评论