Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 330 vs 331 for /trunk/Source Code/Graphs/Components/PhysicsComponent.cpp

Diff revisions: vs.
  @@ -14,13 +14,13 @@
14 14 _physicsAsset(nullptr),
15 15 _transform(nullptr)
16 16 {
17 - _transform = New Transform();
17 + _transform = MemoryManager_NEW Transform();
18 18 reset();
19 19 }
20 20
21 21 PhysicsComponent::~PhysicsComponent()
22 22 {
23 - MemoryManager::SAFE_DELETE( _transform );
23 + MemoryManager::DELETE( _transform );
24 24 }
25 25
26 26 void PhysicsComponent::reset() {
  @@ -35,23 +35,24 @@
35 35
36 36 void PhysicsComponent::useDefaultTransform(const bool state) {
37 37 if (state && !_transform) {
38 - _transform = New Transform();
38 + _transform = MemoryManager_NEW Transform();
39 39 reset();
40 40 } else if (!state && _transform) {
41 - MemoryManager::SAFE_DELETE(_transform);
41 + MemoryManager::DELETE(_transform);
42 42 reset();
43 43 }
44 44 }
45 45
46 46 void PhysicsComponent::physicsAsset(PhysicsAsset* const asset) {
47 - DIVIDE_ASSERT(_physicsAsset == nullptr, "PhysicsComponent error: Double set physics asset detected! remove the previous one first!");
47 + DIVIDE_ASSERT(_physicsAsset == nullptr,
48 + "PhysicsComponent error: Double set physics asset detected! remove the previous one first!");
48 49 _physicsAsset = asset;
49 50 if ( _physicsAsset ) {
50 51 _physicsAsset->setParent( this );
51 52 }
52 53 }
53 54
54 - void PhysicsComponent::cookCollisionMesh(const stringImpl& sceneName){
55 + void PhysicsComponent::cookCollisionMesh(const stringImpl& sceneName) {
55 56 STUBBED("ToDo: add terrain height field and water cooking support! -Ionut")
56 57 for (SceneGraphNode::NodeChildren::value_type& it : _parentSGN->getChildren()) {
57 58 it.second->getComponent<PhysicsComponent>()->cookCollisionMesh( sceneName );
  @@ -305,8 +306,12 @@
305 306 if (interpolationFactor < 0.95) {
306 307 _worldMatrix.identity();
307 308 _worldMatrix.setScale(lerp(_prevTransformValues._scale, _transform->getScale(), (F32)interpolationFactor));
308 - _worldMatrix *= Divide::getMatrix(slerp(_prevTransformValues._orientation, _transform->getOrientation(), (F32)interpolationFactor));
309 - _worldMatrix.setTranslation(lerp(_prevTransformValues._translation, _transform->getPosition(), (F32)interpolationFactor));
309 + _worldMatrix *= Divide::getMatrix(slerp(_prevTransformValues._orientation,
310 + _transform->getOrientation(),
311 + (F32)interpolationFactor));
312 + _worldMatrix.setTranslation(lerp(_prevTransformValues._translation,
313 + _transform->getPosition(),
314 + (F32)interpolationFactor));
310 315 } else {
311 316 _worldMatrix.set(_transform->getMatrix());
312 317 }