Created
December 18, 2010 11:00
-
-
Save tgjones/746405 to your computer and use it in GitHub Desktop.
No doubt we'll need a visual editor at some point, but having this kind of API for the "engine" makes rapid prototyping a breeze.
This file contains hidden or 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
scene.Children.Add(new GameObjectBuilder() | |
.WithMeshSource(b => b.Mesh(new Mesh(Content, "Cube"))) | |
.WithMeshRenderer() | |
.WithBoxCollider(b => b.Size(new Vector3(10, 10, 10))) | |
.WithRigidBody() | |
.Position(new Vector3(100, 50, 100)) | |
.Rotation(Vector3.Right, MathHelper.Pi / 8.0f) | |
.ToGameObject()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment