Files

23 lines
761 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# KlonlanmaLal.js — offsetFor() (satır 457)
[← KlonlanmaLal.js](index.md) · [← Master](../../wiki.md)
```javascript
function offsetFor(owner, index, count, radius, tick, ownerMoving) {
var slot = ownerMoving ? followSlot(index) : formationSlot(index, count);
var jitter = ownerMoving ? Math.sin((tick + index * 23) * 0.07) * 0.12 : 0;
var yawRad = owner.getYaw() * Math.PI / 180;
var localX = (slot.x + jitter) * radius;
var localZ = slot.z * radius;
var rightX = Math.cos(yawRad);
var rightZ = Math.sin(yawRad);
var backX = Math.sin(yawRad);
var backZ = -Math.cos(yawRad);
return {
x: localX * rightX + localZ * backX,
z: localX * rightZ + localZ * backZ
};
}
```