Skip to content

Commit

Permalink
demo shift
Browse files Browse the repository at this point in the history
  • Loading branch information
jerzakm committed Mar 1, 2024
1 parent 7d4a8dc commit 177bb95
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const initSpriteFlyers = async (renderer: WebGLRenderer, scene: Scene, co
const maxCenterDistance = spread;
const rndPosition: any = () => {
const x = Math.random() * spread - spread / 2;
const y = Math.random() * spread - spread / 2;
const y = Math.random() * spread - spread;

if (Math.sqrt(x ** 2 + y ** 2) < minCenterDistance) {
return rndPosition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const initSpriteHounds = async (renderer: WebGLRenderer, scene: Scene, co
const maxCenterDistance = spread;
const rndPosition: any = () => {
const x = Math.random() * spread - spread / 2;
const y = Math.random() * spread - spread / 2;
const y = Math.random() * spread - spread;

if (Math.sqrt(x ** 2 + y ** 2) < minCenterDistance) {
return rndPosition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ export const initPeopleSprite = (renderer: WebGLRenderer, scene: Scene, count: n
window.addEventListener('keyup', handleKeyUp);

function setupRandomAgents() {
const spread = 500;
const spread = 300;
const minCenterDistance = 1;
const maxCenterDistance = spread;
const rndPosition: any = () => {
const x = Math.random() * spread - spread / 2;
const y = Math.random() * spread - spread / 2;
const y = Math.random() * spread - spread;

/** min distance from 0,0. Recursive reroll if too close */

Expand Down
2 changes: 1 addition & 1 deletion packages/instanced-sprite-mesh/src/animationRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const makeDataTexture = (size = 512) => {
size,
size,
RGBAFormat,
HalfFloatType
FloatType
);

// dataTexture.type = FloatType;
Expand Down

0 comments on commit 177bb95

Please sign in to comment.