-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded libraries, added javelin, re-enabled ecsy, generated new ben…
…chmarks (#19) * Upgraded to latest release of libraries * Added Javelin ecs * Re-enabled ecsy benchmarks * Updated benchmark results (not running under debugger) * Fixed major error in component add/remove for miniplex and javelin targets * Removed results.txt artifact
- Loading branch information
Showing
9 changed files
with
500 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
export { default as GeoticLibrary } from './lib-geotic'; | ||
export { default as PerformEcsLibrary } from './lib-perform-ecs'; | ||
export { default as ApeEcsLibrary } from './lib-ape-ecs'; | ||
// export { default as EcsyLibrary } from './lib-ecsy'; | ||
export { default as NanoEcsLibrary } from './lib-nano-ecs'; | ||
export { default as TinyEcsLibrary } from './lib-tiny-ecs'; | ||
export { default as miniplexLibrary } from './lib-miniplex'; | ||
export { default as YaglEcsLibrary } from './lib-yagl-ecs'; | ||
export { default as UecsEcsLibrary } from './lib-uecs'; | ||
export { default as BitecsEcsLibrary } from './lib-bitecs'; | ||
export { default as GoodluckLibrary } from './lib-goodluck'; | ||
export { default as PicoesLibrary } from './lib-picoes'; | ||
export { default as WolfEcsLibrary } from './lib-wolf-ecs'; | ||
export { default as PiecsLibrary } from './lib-piecs'; | ||
export { default as HarmonyEcsLibrary } from './lib-harmony-ecs'; | ||
export { default as miniplexLibrary } from './lib-miniplex.js'; | ||
export { default as JavelinEcsLibrary } from './lib-javelin-ecs.js'; | ||
export { default as GeoticLibrary } from './lib-geotic.js'; | ||
export { default as PerformEcsLibrary } from './lib-perform-ecs.js'; | ||
export { default as NanoEcsLibrary } from './lib-nano-ecs.js'; | ||
export { default as TinyEcsLibrary } from './lib-tiny-ecs.js'; | ||
export { default as YaglEcsLibrary } from './lib-yagl-ecs.js'; | ||
export { default as UecsEcsLibrary } from './lib-uecs.js'; | ||
export { default as BitecsEcsLibrary } from './lib-bitecs.js'; | ||
export { default as GoodluckLibrary } from './lib-goodluck.js'; | ||
export { default as PicoesLibrary } from './lib-picoes.js'; | ||
export { default as WolfEcsLibrary } from './lib-wolf-ecs.js'; | ||
export { default as PiecsLibrary } from './lib-piecs.js'; | ||
export { default as HarmonyEcsLibrary } from './lib-harmony-ecs.js'; | ||
export { default as EcsyLibrary } from './lib-ecsy.js'; | ||
export { default as ApeEcsLibrary } from './lib-ape-ecs.js'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import pkg from '@javelin/ecs'; | ||
const { createWorld, createQuery, toComponent, number } = pkg; | ||
|
||
let updateCount = 0; | ||
|
||
const movementSystem = (world) => { | ||
let movingEntities = createQuery(Position, Velocity); | ||
|
||
/* Return the system */ | ||
return (world) => { | ||
/* Now apply the velocity to the position. */ | ||
for (const [entities, [positions, velocities]] of movingEntities) { | ||
for (let i = 0; i < entities.length; i++) { | ||
positions[i].x += velocities[i].x; | ||
positions[i].y += velocities[i].y; | ||
positions[i].z += velocities[i].z; | ||
|
||
updateCount++; | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
const Velocity = { | ||
x: number, | ||
y: number, | ||
z: number | ||
} | ||
const Position = { | ||
x: number, | ||
y: number, | ||
z: number | ||
} | ||
|
||
export default { | ||
name: 'javelin-ecs', | ||
suites: ['Add/Remove', 'Destroy', 'Velocity'], | ||
setup() { | ||
this.world = createWorld(); | ||
this.movementSystem = movementSystem(this.world); | ||
this.world.addSystem(this.movementSystem); | ||
}, | ||
createEntity() { | ||
return this.world.create(); | ||
}, | ||
addPositionComponent(entity) { | ||
this.world.attach(entity, toComponent({ x: 0, y: 0, z: 0 }, Position)); | ||
}, | ||
addVelocityComponent(entity) { | ||
this.world.attach(entity, toComponent({ x: 1, y: 2, z: 3 }, Velocity)); | ||
}, | ||
removePositionComponent(entity) { | ||
this.world.detach(entity, Position); | ||
}, | ||
removeVelocityComponent(entity) { | ||
this.world.detach(entity, Velocity); | ||
}, | ||
destroyEntity(entity) { | ||
this.world.destroy(entity); | ||
}, | ||
cleanup() { | ||
updateCount = 0; | ||
this.world = null; | ||
this.movementSystem = null; | ||
}, | ||
updateMovementSystem() { | ||
this.world.step(); | ||
}, | ||
getMovementSystemUpdateCount() { | ||
return updateCount; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.