Nebula
Loading...
Searching...
No Matches
streamactorpool.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "core/refcounted.h"
12#include "util/stack.h"
14#include "physicsinterface.h"
17#include "flat/physics/material.h"
18#include "flat/physics/constraints.h"
19#include "flat/physics/actor.h"
20#include "ids/idallocator.h"
21
22namespace Physics
23{
24
30
42
50
52{
53 Physics::ConstraintType type;
55};
56
63
65{
67public:
71 virtual ~StreamActorPool();
72
74 void Setup() override;
75
77 ActorId CreateActorInstance(ActorResourceId id, Math::transform const & trans, Physics::ActorType type, uint64_t userData, IndexT scene = 0);
78 ActorId CreateActorInstance(PhysicsResourceId id, Math::transform const& trans, Physics::ActorType type, uint64_t userData, IndexT scene = 0);
82
83 AggregateId CreateAggregate(PhysicsResourceId id, Math::transform const& trans, Physics::ActorType type, uint64_t userData, IndexT scene = 0);
85
86 PhysicsResource::PhysicsResourceUnion GetResourceType(PhysicsResourceId id);
87
88
89private:
90
91
93 ResourceLoader::ResourceInitOutput InitializeResource(const ResourceLoadJob& job, const Ptr<IO::Stream>& stream) override;
95 void Unload(const Resources::ResourceId id) override;
96
97 enum
98 {
99 Info
100 };
105};
106
108
109} // namespace Physics
Definition idallocator.h:106
Simple transform using position, quaternion, and scale.
Definition transform.h:18
Definition streamactorpool.h:65
PhysicsResource::PhysicsResourceUnion GetResourceType(PhysicsResourceId id)
Definition streamactorpool.cc:164
void Unload(const Resources::ResourceId id) override
unload resource
Definition streamactorpool.cc:619
__DeclareClass(StreamActorPool)
void DiscardAggregateInstance(AggregateId id)
ActorId CreateActorInstance(ActorResourceId id, Math::transform const &trans, Physics::ActorType type, uint64_t userData, IndexT scene=0)
Definition streamactorpool.cc:74
@ Info
Definition streamactorpool.h:99
Ids::IdAllocatorSafe< 0xFFFF, AggregateInfo > aggregateAllocator
Definition streamactorpool.h:103
virtual ~StreamActorPool()
destructor
Definition streamactorpool.cc:44
void DiscardActorInstance(ActorId id)
destroys an actor, if the actor was created from a resource it also reduces use count of resource
Definition streamactorpool.cc:118
Ids::IdAllocatorSafe< 0xFFFF, PhysicsResource::PhysicsResourceUnion, Ids::Id32 > resourceAllocator
Definition streamactorpool.h:104
StreamActorPool()
constructor
Definition streamactorpool.cc:36
void Setup() override
setup resource loader, initiates the placeholder and error resources if valid
Definition streamactorpool.cc:53
Ids::IdAllocatorSafe< 0xFFFF, ActorInfo > actorAllocator
Definition streamactorpool.h:101
AggregateId CreateAggregate(PhysicsResourceId id, Math::transform const &trans, Physics::ActorType type, uint64_t userData, IndexT scene=0)
Definition streamactorpool.cc:138
ResourceLoader::ResourceInitOutput InitializeResource(const ResourceLoadJob &job, const Ptr< IO::Stream > &stream) override
perform actual load, override in subclass
Definition streamactorpool.cc:485
Ids::IdAllocatorSafe< 0xFFFF, ConstraintInfo > constraintAllocator
Definition streamactorpool.h:102
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Definition resourceloader.h:60
Nebula's dynamic array class.
Definition array.h:60
A StringAtom.
Definition stringatom.h:22
Diverse functions for manipulating physics actors.
Definition actorcontext.cc:18
StreamActorPool * actorPool
Definition streamactorpool.cc:32
ActorType
Definition physicsinterface.h:35
PhysicsIdType
Definition streamactorpool.h:26
@ ActorIdType
Definition streamactorpool.h:27
@ MeshIdType
Definition streamactorpool.h:28
Definition physicsinterface.h:50
Definition streamactorpool.h:44
SizeT instanceCount
Definition streamactorpool.h:48
BodyInfo body
Definition streamactorpool.h:45
Util::StringAtom name
Definition streamactorpool.h:47
Math::transform transform
Definition streamactorpool.h:46
Definition physicsinterface.h:29
Definition physicsinterface.h:64
Definition streamactorpool.h:58
Util::Array< ActorResourceId > bodies
Definition streamactorpool.h:59
SizeT instanceCount
Definition streamactorpool.h:61
Util::Array< ConstraintResourceId > constraints
Definition streamactorpool.h:60
Definition streamactorpool.h:32
CollisionFeedback feedbackFlag
Definition streamactorpool.h:40
Util::Array< float > densities
Definition streamactorpool.h:35
uint16_t collisionGroup
Definition streamactorpool.h:39
Util::Array< Util::String > colliders
Definition streamactorpool.h:34
Util::Array< physx::PxShape * > shapes
Definition streamactorpool.h:33
Definition streamactorpool.h:52
SizeT InstanceCount
Definition streamactorpool.h:54
Physics::ConstraintType type
Definition streamactorpool.h:53
Definition physicsinterface.h:31
Definition resourceloader.h:164
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48