Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 979 vs 992 for /trunk/Source Code/Scenes/TenisScene/TenisScene.cpp

Diff revisions: vs.
  @@ -76,7 +76,7 @@
76 76 vec3<F32>(-cosf(_sunAngle.x) * sinf(_sunAngle.y), -cosf(_sunAngle.y),
77 77 -sinf(_sunAngle.x) * sinf(_sunAngle.y));
78 78
79 - _sun.lock()->get<PhysicsComponent>()->setPosition(_sunvector);
79 + _sun.lock()->get<TransformComponent>()->setPosition(_sunvector);
80 80
81 81 PushConstants& constants = _currentSky.lock()->get<RenderingComponent>()->pushConstants();
82 82 constants.set("enable_sun", PushConstantType::BOOL, true);
  @@ -99,7 +99,7 @@
99 99 _applySideImpulse = false;
100 100 _sideImpulseFactor = 0;
101 101 WriteLock w_lock(_gameLock);
102 - _ballSGN.lock()->get<PhysicsComponent>()->setPosition(vec3<F32>(
102 + _ballSGN.lock()->get<TransformComponent>()->setPosition(vec3<F32>(
103 103 (Random(0, 10) >= 5) ? 3.0f : -3.0f, 0.2f, _lostTeam1 ? -7.0f : 7.0f));
104 104 _directionTeam1ToTeam2 = !_lostTeam1;
105 105 _lostTeam1 = false;
  @@ -144,12 +144,12 @@
144 144 UpgradableReadLock ur_lock(_gameLock);
145 145 // Store by copy (thread-safe) current ball position (getPosition()) should
146 146 // be threadsafe
147 - vec3<F32> netPosition = _net.lock()->get<PhysicsComponent>()->getPosition();
148 - vec3<F32> ballPosition = _ballSGN.lock()->get<PhysicsComponent>()->getPosition();
149 - vec3<F32> player1Pos = _aiPlayer[0].lock()->get<PhysicsComponent>()->getPosition();
150 - vec3<F32> player2Pos = _aiPlayer[1].lock()->get<PhysicsComponent>()->getPosition();
151 - vec3<F32> player3Pos = _aiPlayer[2].lock()->get<PhysicsComponent>()->getPosition();
152 - vec3<F32> player4Pos = _aiPlayer[3].lock()->get<PhysicsComponent>()->getPosition();
147 + vec3<F32> netPosition = _net.lock()->get<TransformComponent>()->getPosition();
148 + vec3<F32> ballPosition = _ballSGN.lock()->get<TransformComponent>()->getPosition();
149 + vec3<F32> player1Pos = _aiPlayer[0].lock()->get<TransformComponent>()->getPosition();
150 + vec3<F32> player2Pos = _aiPlayer[1].lock()->get<TransformComponent>()->getPosition();
151 + vec3<F32> player3Pos = _aiPlayer[2].lock()->get<TransformComponent>()->getPosition();
152 + vec3<F32> player4Pos = _aiPlayer[3].lock()->get<TransformComponent>()->getPosition();
153 153 vec3<F32> netBBMax = _net.lock()->get<BoundsComponent>()->getBoundingBox().getMax();
154 154 vec3<F32> netBBMin = _net.lock()->get<BoundsComponent>()->getBoundingBox().getMin();
155 155
  @@ -164,9 +164,9 @@
164 164
165 165 // After we finish our computations, apply the new transform
166 166 // setPosition/getPosition should be thread-safe
167 - _ballSGN.lock()->get<PhysicsComponent>()->setPosition(ballPosition);
167 + _ballSGN.lock()->get<TransformComponent>()->setPosition(ballPosition);
168 168 // Add a spin to the ball just for fun ...
169 - _ballSGN.lock()->get<PhysicsComponent>()->rotate(
169 + _ballSGN.lock()->get<TransformComponent>()->rotate(
170 170 vec3<F32>(ballPosition.z, 1, 1));
171 171
172 172 //----------------------COLLISIONS------------------------------//
  @@ -319,7 +319,7 @@
319 319 player[i]->setSelectable(true);
320 320 UnitComponent* unitComp = player[i]->get<UnitComponent>();
321 321
322 - aiPlayer[i] = MemoryManager_NEW AI::AIEntity(player[i]->get<PhysicsComponent>()->getPosition(), nodeName);
322 + aiPlayer[i] = MemoryManager_NEW AI::AIEntity(player[i]->get<TransformComponent>()->getPosition(), nodeName);
323 323 aiPlayer[i]->addSensor(AI::SensorType::VISUAL_SENSOR);
324 324 aiPlayer[i]->setAIProcessor(MemoryManager_NEW AI::TenisSceneAIProcessor(_ballSGN, *_aiManager));
325 325
  @@ -364,7 +364,8 @@
364 364 }
365 365
366 366 bool TenisScene::loadResources(bool continueOnErrors) {
367 - static const U32 normalMask = to_base(SGNComponent::ComponentType::PHYSICS) |
367 + static const U32 normalMask = to_base(SGNComponent::ComponentType::TRANSFORM) |
368 + to_base(SGNComponent::ComponentType::RIGID_BODY) |
368 369 to_base(SGNComponent::ComponentType::BOUNDS) |
369 370 to_base(SGNComponent::ComponentType::RENDERING) |
370 371 to_base(SGNComponent::ComponentType::NAVIGATION) |
  @@ -379,7 +380,7 @@
379 380 _ball->setResolution(16);
380 381 _ball->setRadius(0.3f);
381 382 _ballSGN = _sceneGraph->getRoot().addNode(_ball, normalMask, PhysicsGroup::GROUP_KINEMATIC, "TenisBallSGN");
382 - _ballSGN.lock()->get<PhysicsComponent>()->translate(
383 + _ballSGN.lock()->get<TransformComponent>()->translate(
383 384 vec3<F32>(3.0f, 0.2f, 7.0f));
384 385 _ballSGN.lock()->setSelectable(true);
385 386