2 registered members (AndrewAMD, juanex),
1,247
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: What are you working on?
[Re: Germanunkol]
#408218
09/27/12 15:41
09/27/12 15:41
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
@Superku: Is this used by Crytek too o.O. If yes, can someone explain why it requires DX11?
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: What are you working on?
[Re: MasterQ32]
#408240
09/27/12 21:42
09/27/12 21:42
|
Joined: Sep 2007
Posts: 101 Luxembourg
krial057
Member
|
Member
Joined: Sep 2007
Posts: 101
Luxembourg
|
Playing around with a component based design pattern in 3dgs. An entity can have multiple components(scripts are also components). This is an example of a script component attached to an entity:
CPTransform transformation; void PlayerStart()
{
transformation = CPGetComponent("transform"); printf("player initialized");
}
void PlayerUpdate()
{
transformation->rotation->pan+=1*time_step;
CPTransformTranslate(transformation, vector(1*time_step, 0, 0));
}
At the moment you have to attach those components per script:
int main()
{
level_load(NULL);
CPcurrentEntity = ent_create(CUBE_MDL, vector(10, 15, 20), NULL);
CPSetComponent("transform", CPTransformCreate());
CPSetComponent("player", CPScriptCreate("Player"));
return 0;
}
But this could also be done with an interface like in Unity, That's all you need to make it work. Would you use it? If yes I will continue working on this and publish it(probably with a small editor to attach components)
Last edited by krial057; 09/27/12 21:45.
|
|
|
|