|
Engine²
Open-source game engine written in C++.
|
#include "Engine.hpp"#include "Event.hpp"#include "Object.hpp"#include "Physics.hpp"#include "event/CollisionEvent.hpp"#include "resource/Time.hpp"#include <iostream>Classes | |
| struct | CounterComponent |
Functions | |
| void | CreateFloor (Engine::Core &core) |
| Create a static floor plane using Object::CreatePlane helper. | |
| void | CreateFallingCube (Engine::Core &core, float x, float y, float z, float mass) |
| Create a dynamic cube that will fall using Object::CreateCube helper. | |
| void | CreateBouncyBall (Engine::Core &core, float x, float y, float z) |
| Create a bouncy ball with high restitution using Object::CreateSphere helper. | |
| void | CreateMovingPlatform (Engine::Core &core) |
| Create a kinematic platform that can be moved programmatically. | |
| void | OnCollisionAdded (const Physics::Event::CollisionAddedEvent &event) |
| void | RegisterCollisionLoggerSystem (Engine::Core &core) |
| void | PrintSimulationStep (uint32_t step, Engine::Core &core) |
| Display simulation statistics. | |
| void | RunningPhysicsSimulationSystem (Engine::Core &core) |
| Runs the physics simulation system and prints info every 10 steps. | |
| void | CreatePhysicsWorldSystem (Engine::Core &core) |
| Create the physics world with several entities. | |
| void | CleanupDemonstrationSystem (Engine::Core &core) |
| Cleanup all created entities in the physics demonstration. | |
| int | main (void) |
| void CleanupDemonstrationSystem | ( | Engine::Core & | core | ) |
Cleanup all created entities in the physics demonstration.
| void CreateBouncyBall | ( | Engine::Core & | core, |
| float | x, | ||
| float | y, | ||
| float | z ) |
Create a bouncy ball with high restitution using Object::CreateSphere helper.
Use the helper function to create a sphere entity with mesh and transform. Add Sphere-like collider (using small cube for now as approximation), then Very bouncy properties
| void CreateFallingCube | ( | Engine::Core & | core, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | mass ) |
Create a dynamic cube that will fall using Object::CreateCube helper.
Use the helper function to create a cube entity with mesh and transform. Add RigidBody component with dynamic motion type and specified mass. A ConvexHullShape is created automatically from the mesh vertices!
| void CreateFloor | ( | Engine::Core & | core | ) |
Create a static floor plane using Object::CreatePlane helper.
Use the helper function to create a plane entity with mesh and transform. Add Large flat box collider (20x1x20 meters) component for collision and Static rigid body (immovable) component.
| void CreateMovingPlatform | ( | Engine::Core & | core | ) |
Create a kinematic platform that can be moved programmatically.
Use the helper function to create a cube entity (flattened for platform shape)
| void CreatePhysicsWorldSystem | ( | Engine::Core & | core | ) |
Create the physics world with several entities.
| int main | ( | void | ) |
| void OnCollisionAdded | ( | const Physics::Event::CollisionAddedEvent & | event | ) |
| void PrintSimulationStep | ( | uint32_t | step, |
| Engine::Core & | core ) |
Display simulation statistics.
| void RegisterCollisionLoggerSystem | ( | Engine::Core & | core | ) |
| void RunningPhysicsSimulationSystem | ( | Engine::Core & | core | ) |
Runs the physics simulation system and prints info every 10 steps.