Code review changes
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <ThirdParty/PhysX/PxPhysics.h>
|
||||
#include <ThirdParty/PhysX/extensions/PxDefaultStreams.h>
|
||||
#endif
|
||||
|
||||
#include <ThirdParty/PhysX/geometry/PxTriangleMesh.h>
|
||||
|
||||
SplineCollider::SplineCollider(const SpawnParams& params)
|
||||
|
||||
@@ -323,7 +323,7 @@ bool PhysicsService::Init()
|
||||
}
|
||||
#endif
|
||||
|
||||
Physics::DefaultScene = new PhysicsScene(String("Default"), settings);
|
||||
Physics::DefaultScene = Physics::FindOrCreateScene(TEXT("Default"));
|
||||
Physics::Scenes.Add(Physics::DefaultScene);
|
||||
|
||||
// Create default resources
|
||||
@@ -508,7 +508,7 @@ void Physics::RemoveJoint(Joint* joint)
|
||||
scene->RemoveJoint(joint);
|
||||
}
|
||||
|
||||
PhysicsScene* Physics::FindOrCreateScene(String name)
|
||||
PhysicsScene* Physics::FindOrCreateScene(const String& name)
|
||||
{
|
||||
auto scene = FindScene(name);
|
||||
|
||||
@@ -516,14 +516,14 @@ PhysicsScene* Physics::FindOrCreateScene(String name)
|
||||
{
|
||||
auto& settings = *PhysicsSettings::Get();
|
||||
|
||||
scene = new PhysicsScene(name, settings);
|
||||
scene = New<PhysicsScene>(name, settings);
|
||||
Scenes.Add(scene);
|
||||
}
|
||||
|
||||
return scene;
|
||||
}
|
||||
|
||||
PhysicsScene* Physics::FindScene(String name)
|
||||
PhysicsScene* Physics::FindScene(const String& name)
|
||||
{
|
||||
for (auto scene : Scenes)
|
||||
{
|
||||
|
||||
@@ -116,12 +116,12 @@ public:
|
||||
/// <summary>
|
||||
/// Finds an existing <see cref="PhysicsScene"/> or creates it if it does not exist.
|
||||
/// </summary>
|
||||
API_FUNCTION() static PhysicsScene* FindOrCreateScene(String name);
|
||||
API_FUNCTION() static PhysicsScene* FindOrCreateScene(const String& name);
|
||||
|
||||
/// <summary>
|
||||
///Finds an existing scene.
|
||||
/// </summary>
|
||||
API_FUNCTION() static PhysicsScene* FindScene(String name);
|
||||
API_FUNCTION() static PhysicsScene* FindScene(const String& name);
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
|
||||
@@ -128,7 +128,7 @@ PhysicsScene::PhysicsScene(const String& name, const PhysicsSettings& settings)
|
||||
#define CHECK_INIT(value, msg) if(!value) { LOG(Error, msg); return; }
|
||||
|
||||
mName = name;
|
||||
mPhysxImpl = new PhysicsScenePhysX();
|
||||
mPhysxImpl = New<PhysicsScenePhysX>();
|
||||
|
||||
// Create scene description
|
||||
PxSceneDesc sceneDesc(CPhysX->getTolerancesScale());
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
class WheeledVehicle;
|
||||
#endif
|
||||
|
||||
|
||||
struct ActionData;
|
||||
class FixedStepper;
|
||||
class PhysicsSettings;
|
||||
|
||||
Reference in New Issue
Block a user