所使用的圖素。
out參數,座標。
out參數,面向。
out參數,頭頂方向。
out參數,偏移量。
const firstPersonViewMovingFunction = (entity, moveEvent, pos, v, up, offset) => {
let position = entity.getParameter().position;
let vDir = moveEvent.getV();
let upDir = moveEvent.getUp();
//設定座標
pos.x = position.x;
pos.y = position.y;
pos.z = position.z;
//設定面向
v.x = vDir.x;
v.y = vDir.y;
v.z = vDir.z;
//設定頭頂方向
up.x = upDir.x;
up.y = upDir.y;
up.z = upDir.z;
//設定偏移量
offset.x = -0.5;
offset.y = 2;
offset.z = 2;
}
Generated using TypeDoc
第一人稱處理函式