中国虚拟军事网(VME)- 专注于武装突袭等优秀虚拟军事游戏

 找回密码
 加入VME

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 213|回复: 0

[原创] VBS上setVelocityTransformation的用法

  [复制链接]
发表于 2021-2-23 00:03:55 | 显示全部楼层 |阅读模式
最近想做个打印视频,setVelocityTransformation这个命令很有用,BI scripts 写的像一坨翔。
偶然发现VBS2网站,果然清爽了很多。

Description:       
Places an object at an interpolated position between two other objects, and sets its vectors in proportion to the relative position.
The final position / vector is determined by the interval specified in the command. This assumes an imaginary path between the two reference objects, where, at the beginning of the path (interval: 0), the position and vector are identical to the first reference object, at the end of the path (interval: 1), the position and vector are identical to the second reference object, and at 0.5 they are halfway in-between.

Syntax:        object setVelocityTransformation [pos1, pos2, vel1, vel2, dir1, dir2, up1, up2, interval]

Parameters:       
object: Object - Object to position.
pos1: PositionASL - ASL position of first reference object.
pos2: PositionASL - ASL position of second reference object.
vel1: Vector3D - velocity of first reference object.
vel2: Vector3D - velocity of second reference object.
dir1: Vector3D - vectorDir of first reference object.
dir2: Vector3D - vectorDir of second reference object.
up1: Vector3D - vectorUp of first reference object.
up2: Vector3D - vectorUp of second reference object.
interval: Number - Relative position between the two reference objects, where the manipulated object is placed at (0-1).

示例代码很清晰

  1. Demo mission, placing 4 arrows between two helicopters, at 0.2 intervals: setVelocityTransformation.zip
  2. // create some marker arrows
  3. _markers = [];
  4. for "_i" from 0 to 3 do {
  5.   _marker = "vbs2_visual_arrowside" createVehicle (player modelToWorld [0,10,0]);
  6.   _markers = _markers + [_marker];
  7. };

  8. // repeatedly place those 4 markers between two helicopters (a1 & a2)
  9. while {true} do {
  10.   for "_i" from 0 to 3 do {
  11.     _time = (_i+1)*.2; // arrows are at 0.2, 0.4, 0.6 & 0.8 intervals
  12.     _arr = [getPosASL a1, getPosASL a2, velocity a1, velocity a2, vectorDir a1, vectorDir a2, vectorUp a1, vectorUp a2, _time];
  13.     (_markers select _i) setVelocityTransformation _arr;
  14.   };
  15. };
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?加入VME

x
您需要登录后才可以回帖 登录 | 加入VME

本版积分规则

中国虚拟军事网  

GMT+8, 2021-10-17 02:50

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表