Cogs.Core
Extensions
Physics
Source
GhostSystem.h
1
#pragma once
2
3
#include "Systems/ComponentSystem.h"
4
5
#include "GhostComponent.h"
6
#include "RigidBodySystem.h"
7
8
#include <btBulletDynamicsCommon.h>
9
#include "BulletCollision/CollisionDispatch/btGhostObject.h"
10
11
#include "Services/TaskManager.h"
12
13
namespace
Cogs
14
{
15
namespace
Core
16
{
17
class
PhysicsManager;
18
19
struct
GhostData
20
{
21
std::unique_ptr<btPairCachingGhostObject> collisionObject;
22
btCollisionShape * collisionShape;
23
//std::unique_ptr<btMotionState> motionState;
24
std::unique_ptr<SharedRigidBodyData> shared;
25
glm::vec3 scale;
26
//glm::vec3 lastPosition;
27
//bool kinematic;
28
};
29
30
class
GhostSystem
:
public
ComponentSystemWithDataPool
<GhostComponent, GhostData>
31
{
32
public
:
33
GhostSystem
(
Memory::Allocator
* allocator,
Cogs::SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
34
35
void
update
(
Context
*
context
)
final
;
36
37
void
destroyComponent
(
ComponentHandle
component)
final
;
38
39
double
currentTime = 0;
40
TaskId
task = NoTask;
41
};
42
}
43
}
Cogs::Core::ComponentSystemBase::context
Context * context
Pointer to the Context instance the system lives in.
Definition:
ComponentSystem.h:136
Cogs::Core::ComponentSystemBase::update
void update()
Updates the system state to that of the current frame.
Definition:
ComponentSystem.h:65
Cogs::Core::ComponentSystemWithDataPool
Component system with parallel data per component stored in a pool similar to how the components them...
Definition:
ComponentSystem.h:365
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::GhostSystem
Definition:
GhostSystem.h:31
Cogs::Core::GhostSystem::destroyComponent
void destroyComponent(ComponentHandle component) final
Definition:
GhostSystem.cpp:92
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::ComponentModel::ComponentHandle
Handle to a Component instance.
Definition:
Component.h:67
Cogs::Core::GhostData
Definition:
GhostSystem.h:20
Cogs::Core::TaskId
Task id struct used to identify unique Task instances.
Definition:
TaskManager.h:20
Generated by
1.9.6