|
10 | 10 | #include "physics/actorcontext.h" |
11 | 11 | #include "resources/resourceserver.h" |
12 | 12 | #include "components/physicsfeature.h" |
13 | | -#include "graphicsfeature/graphicsfeatureunit.h" |
14 | 13 | #include "basegamefeature/components/basegamefeature.h" |
15 | 14 | #include "basegamefeature/components/position.h" |
16 | 15 | #include "basegamefeature/components/orientation.h" |
17 | 16 | #include "basegamefeature/components/scale.h" |
18 | 17 | #include "basegamefeature/components/velocity.h" |
19 | | -#include "graphicsfeature/components/model.h" |
20 | 18 |
|
21 | 19 | namespace PhysicsFeature |
22 | 20 | { |
@@ -52,26 +50,13 @@ PhysicsManager::InitPhysicsActor(Game::World* world, Game::Entity entity, Physic |
52 | 50 | return; |
53 | 51 | } |
54 | 52 |
|
55 | | - auto res = actor->resource; |
56 | | - if (res == "mdl:") |
57 | | - { |
58 | | - n_assert(world->HasComponent<GraphicsFeature::Model>(entity)); |
59 | | - Util::String modelRes = world->GetComponent<GraphicsFeature::Model>(entity).resource.Value(); |
60 | | - Util::String fileName = modelRes.ExtractFileName(); |
61 | | - fileName.StripFileExtension(); |
62 | | - res = Util::String::Sprintf( |
63 | | - "phys:%s/%s.actor", modelRes.ExtractLastDirName().AsCharPtr(), fileName.AsCharPtr() |
64 | | - ); |
65 | | - actor->resource = res; |
66 | | - } |
67 | | - |
68 | 53 | Math::transform worldTransform = Math::transform( |
69 | 54 | world->GetComponent<Game::Position>(entity), |
70 | 55 | world->GetComponent<Game::Orientation>(entity), |
71 | 56 | world->GetComponent<Game::Scale>(entity) |
72 | 57 | ); |
73 | 58 |
|
74 | | - Resources::ResourceId resId = Resources::CreateResource(res, "PHYS", nullptr, nullptr, true); |
| 59 | + Resources::ResourceId resId = Resources::CreateResource(actor->resource, "PHYS", nullptr, nullptr, true); |
75 | 60 | Physics::ActorId actorid = |
76 | 61 | Physics::CreateActorInstance(resId, worldTransform, (Physics::ActorType)actor->actorType, Ids::Id64(entity)); |
77 | 62 | actor->actorId = actorid.id; |
|
0 commit comments