Date post: | 04-Jul-2015 |
Category: |
Technology |
Upload: | waveengineteam |
View: | 7,063 times |
Download: | 0 times |
WaveEngine Team
@waveengineteam
http://waveengine.net
WaveEngine Components
Component Based Game Engine
Component types
Components
Drawables
Behaviors
Components 3D
Components Behavior Drawable
• Transform3D• Model• SkinnedModel• MaterialsMap• ParticleSystem3D• Joint3D
• Collider3D• Animation3D• Spinner• RigidBody3D
• ModelRenderer• SkinedModelRenderer• ParticleSystemRenderer3d
Entity
To draw a primitive cube
Transform3D
MaterialsMap
ModelRenderer
Model
To draw a primitive cube
Entity cube = new Entity(“mycube")
.AddComponent(new Transform3D())
.AddComponent(new MaterialsMap())
.AddComponent(Model.CreateCube())
.AddComponent(new ModelRenderer());
EntityManager.Add(cube);
Transfom3D
.AddComponent(new Transform3D()
{
Position = new Vector3(0, 10, 0), // Default: (0,0,0)
Rotation = new Vector3(0, (float)Math.PI, 0), //Default: (0,0,0)
Scale = new Vector3(3, 3, 3), // Default: (1,1,1)
})
MaterialsMap
• None
• BasicMaterial
• DualTextureMaterial
• EnviromentMapMaterial
• NormalMapping Material
• SkyboxMaterial
• ToonShadingMaterial
• RimLightMaterial
MaterialsMap - BasicMaterial
Entity cube = new Entity(“mycube")
.AddComponent(new Transform3D())
.AddComponent(new MaterialsMap(
new BasicMaterial("Context/mytexture.wpk"))
)
.AddComponent(Model.CreateCube())
.AddComponent(new ModelRenderer());
EntityManager.Add(cube);
MaterialsMap - BasicMaterial
Entity cube = new Entity(“mycube")
.AddComponent(new Transform3D())
.AddComponent(new MaterialsMap(
new NormalMappingMaterial(“difuse.wpk", "normal.wpk"))
)
.AddComponent(Model.CreateCube())
.AddComponent(new ModelRenderer());
EntityManager.Add(cube);
Model - Primitives
• Primitives• Cube
• Cone
• Cylinder
• Pyramid
• Sphere
• Torus
• Capsule
• Plane
• Teapot
Model – From file
• Load from File .DAE, .FBX, .Obj, .3DS y .X
Model – From file
Entity car = new Entity(“myCar")
.AddComponent(new Transform3D())
.AddComponent(new MaterialsMap()
.AddComponent(new Model(“Content/Car.wpk”))
.AddComponent(new ModelRenderer());
EntityManager.Add(cube);
Animated Model – From file
• Load from File .DAE, .FBX y .X
Animated Model – From file
Entity player = new Entity(“myplayer")
.AddComponent(new Transform3D())
.AddComponent(new MaterialsMap()
.AddComponent(new SkinnedModel("Content/model.wpk"))
.AddComponent(new Animation3D("Content/animation.wpk"))
.AddComponent(new SkinnedModelRenderer());
EntityManager.Add(cube);
Collision detection
Collider3D
• BoxCollider• SphereCollider• CapsuleCollider• MeshCollider
Collision detectionEntity cube = new Entity(“mycube")
.AddComponent(new Transform3D())
.AddComponent(new BoxCollider())
.AddComponent(new MaterialsMap())
.AddComponent(Model.CreateCube())
.AddComponent(new ModelRenderer());
EntityManager.Add(cube);
BoxCollider collider = cube.FindComponent<BoxCollider>();
collider.Intersects(...);
3D Particle System
3D Particle System
Entity smokeParticles = new Entity(“myParticles")
.AddComponent(new Transform3D())
.AddComponent(new ParticleSystem3D() { //Parameters })
.AddComponent(new MaterialsMap(
new BasicMaterial("Content/particleTexture.wpk“, DefaultLayers.Alpha)))
.AddComponent(new ParticleSystemRenderer3D());
EntityManager.Add(smokeParticles);
3D Particle System
.AddComponent(new ParticleSystem3D()
{ //Parameters
NumParticles = 100,
EmitRate = 1500,
MinLife = TimeSpan.FromSeconds(1f), MaxLife = TimeSpan.FromSeconds(3f),
LocalVelocity = new Vector3(0f, 0f,0f),
RandomVelocity = new Vector3(3f, 2.5f,0f),
MinSize = 15, MaxSize = 40,
MinRotateSpeed = 0.03f, MaxRotateSpeed = -0.03f,
EndDeltaScale = 0f,
EmitterSize = new Vector2(30),
Gravity = new Vector2(0, 0.03f),
EmitterShape = ParticleSystem2D.Shape.FillCircle,
Emit = false,
})
3D Physic components
• Wave engine integrates the Bepu physic engine.
• Offers a component based interface.
3D Physic components
Entity cube = new Entity("myCube")
.AddComponent(new Transform3D())
.AddComponent(new BoxCollider())
.AddComponent(new RigidBody3D() { //Parameters})
.AddComponent(new MaterialsMap())
.AddComponent(Model.CreateCube())
.AddComponent(new ModelRenderer());
EntityManager.Add(cube);
3D Physic components.AddComponent(new RigidBody3D()
{ //Parameters
EnableContinuousContact = true, // Default : false
Mass = 4f, // Default: 1f
IsKinematic = true, // Default: false
KineticFriction = 4f, // Default: 0.3f
StaticFriction = 4f, // Default: 0.6f
LinearVelocity = new Vector3(1, 0, 0), // Default (0,0,0)
AngularVelocity = Vector3.Zero, // Default (0,0,0)
Rotation = new Vector3(0, (float)Math.PI, 0), // Default (0,0,0)
Restitution = 4f, // Default: 0
})
3D Physic components
Joint3D
• BallSocketJoint• FixedJoint• HingeJoint• LineSliderJoint• MotorizedGrabSpring3D• PlaneSliderJoint• PrismaticJoint• SwivelHingeJoint• UniversalJoint
Cameras
Cameras
• FixedCamera• ViewCamera• FreeCamera• ThirdPersonCamera• PathCamera
Cameras
FreeCamera myCamera = new FreeCamera("mainCamera",
new Vector3(0, 5, 5),
Vector3.Zero);
EntityManager.Add(myCamera);
Lights
3D lights
• PointLight• DirectionalLight
Lights
DirectionalLight skylight = new DirectionalLight("SkyLight",
new Vector3(1));
EntityManager.Add(skylight);
Thank you
WaveEngine Team
@waveengineteam
http://waveengine.net