本文整理汇总了TypeScript中THREE.Vector3.applyAxisAngle方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Vector3.applyAxisAngle方法的具体用法?TypeScript Vector3.applyAxisAngle怎么用?TypeScript Vector3.applyAxisAngle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THREE.Vector3
的用法示例。
在下文中一共展示了Vector3.applyAxisAngle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: update
update(world: World, control: Control) {
var beta = control.motionTracker.getBeta();
this._acceleration.copy(this._speed).divideScalar(30).clampLength(0.1, 3);
this._acceleration.applyAxisAngle(yAxis, horizontalRotation(beta));
this._speed.add(this._acceleration);
this._speed.clampLength(0, 80);
var newPos = new Vector3().addVectors(this._position, this._speed);
this._playerTracker.updateSection(newPos);
var collision = this._playerTracker.getCollision();
if (collision) {
newPos = collision;
this._speed.multiplyScalar(0.3);
newPos = this._playerTracker.getAdjusted(newPos);
this._position.copy(newPos);
} else {
newPos = this._playerTracker.getAdjusted(newPos);
this._acceleration.subVectors(newPos, this._position).sub(this._speed).clampLength(0, 5);
this._speed.add(this._acceleration);
this._position.add(this._speed);
}
this._direction.setFromUnitVectors(
new Vector3(0, 0, 1),
this._speed.clone().setY(0).setLength(1));
}
示例2: genMap
genMap() {
this._stars = [];
var numStars = 8;
var radius = 9 * this._step * numStars;
var center = new Vector3(radius, 0, 0);
var pointer = new Vector3(-radius, 0, 0);
for(var i = 0; i < numStars; i++) {
pointer.applyAxisAngle(new Vector3(0, 1, 0), Math.PI * 2 / (numStars + 1));
var star = Stars.genRandom(new Vector3());
if (i === 0) {
var pos = center.clone().add(pointer);
} else {
var pos = this._genStarPoint(center.clone().add(pointer), star, radius);
}
star.setPosition(pos);
this._stars.push(star);
}
this._genPoints(new Vector3(), new Vector3(0, 0, -this._step));
}