-
Notifications
You must be signed in to change notification settings - Fork 0
/
_ideas.txt
64 lines (50 loc) · 1.27 KB
/
_ideas.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Entity.Draw( Mesh )
Entity.Draw( BoneView )
Entity.Draw( VisualIK )
Entity is Just an ID.
Sort By Layer, EntID, Order, Shader
Draw{
Geo = new Geo();
Material = new Material();
layer = 0;
order = 0;
}
----------------------
What if there are Multiple Drawing Components?
Does a Component Need to Register itself as Renderable along with ECS Component?
Entity.MeshDraw
Entity.BoneView
Entity.VisualIK
----------------------
Entity can just be an Array of Bitsets
// Game Entity Info is a Component
class Ent{
id = 0;
name = "";
active = true;
}
class Transform{
pos = new Vec3();
scl = new Vec3();
rot = new Quat();
}
class System{
static run( ecs ){
let q = ecs.query( [ ] )
}
}
Ecs.regCom( Transform );
Ecs.regSys( System );
let eID = Ecs.newEnt();
let transform = Ecs.addCom( eID, "Transform" );
let compID = Ecs.pushCom( eID, new Ent( eID, "" ) );
Ecs.rmCom( eID, compTypeID or CompName );
class EntityWrapper{
constructor( ecs, ...comp ){
this.eID = ecs.newEnt();
for( c of comp ){
if( typeof c == "string" ) this[c] = ecs.addCom( eID, c );
else if( c is Object ) this[c.name] = ecs.pushCom( eID, c );
}
}
}