Removed Physics module
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq / Rémi Bèges
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef COLLISIONSHAPE_HPP
|
||||
#define COLLISIONSHAPE_HPP
|
||||
|
||||
#include <Newton/Newton.h>
|
||||
#include "PhysicsWorld.hpp"
|
||||
//#include <Nazara/Physics/PhysicsWorld.hpp>
|
||||
|
||||
class NzCollisionShape
|
||||
{
|
||||
public:
|
||||
NzCollisionShape(NzPhysicsWorld* world);
|
||||
~NzCollisionShape();
|
||||
|
||||
void Create(const NzVector3f& cubeSize);
|
||||
//void Create(const NzSpheref& sphere);
|
||||
//void Create(const NzConef& cone);
|
||||
//void Create(const NzMesh& customMesh);
|
||||
void Release();
|
||||
|
||||
bool IsValid();
|
||||
|
||||
NewtonCollision* newtonCollisionShape;
|
||||
|
||||
protected:
|
||||
private:
|
||||
NzPhysicsWorld* m_world;
|
||||
bool m_isCreated;
|
||||
};
|
||||
|
||||
#endif // COLLISIONSHAPE_HPP
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
Nazara Engine
|
||||
|
||||
Copyright (C) 2012 AUTHORS (EMAIL)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_PHYSICS_HPP
|
||||
#define NAZARA_CONFIG_PHYSICS_HPP
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||
#define NAZARA_PHYSICS_MEMORYLEAKTRACKER 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_PHYSICS_SAFE 1
|
||||
|
||||
#endif // NAZARA_CONFIG_PHYSICS_HPP
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright (C) 2012 AUTHORS
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Physics/Config.hpp>
|
||||
#if NAZARA_PHYSICS_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
#define new new(__FILE__, __LINE__)
|
||||
#endif
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (C) 2012 AUTHORS
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_PHYSICS_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq / Rémi Bèges
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_PHYSICS_HPP
|
||||
#define NAZARA_PHYSICS_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
class NAZARA_API NzPhysics
|
||||
{
|
||||
public:
|
||||
NzPhysics();
|
||||
~NzPhysics();
|
||||
|
||||
bool Initialize();
|
||||
void Uninitialize();
|
||||
|
||||
static bool IsInitialized();
|
||||
|
||||
private:
|
||||
static bool s_initialized;
|
||||
};
|
||||
|
||||
#endif // NAZARA_PHYSICS_HPP
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq / Rémi Bèges
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef PHYSICSENTITY_HPP
|
||||
#define PHYSICSENTITY_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Newton/Newton.h>
|
||||
#include <Nazara/Math/Matrix4.hpp>
|
||||
//#include <Nazara/Physics/CollisionShape.hpp>
|
||||
#include "CollisionShape.hpp"
|
||||
|
||||
class NzPhysicsWorld;
|
||||
|
||||
class NzPhysicsEntity
|
||||
{
|
||||
public:
|
||||
NzPhysicsEntity(NzPhysicsWorld* world, const NzCollisionShape& shape, const NzVector3f& position, float mass);
|
||||
virtual void Init();
|
||||
virtual ~NzPhysicsEntity();
|
||||
protected:
|
||||
NzPhysicsWorld* m_world;
|
||||
NewtonBody* m_body;
|
||||
float m_mass;
|
||||
NzMatrix4f m_entityMatrix;
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // PHYSICSENTITY_HPP
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq / Rémi Bèges
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef PHYSICSSOLVER_HPP
|
||||
#define PHYSICSSOLVER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
enum nzSolverMode
|
||||
{
|
||||
nzExact,
|
||||
nzAdaptative,
|
||||
nzLinear
|
||||
};
|
||||
|
||||
class NzPhysicsWorld;
|
||||
|
||||
class NzPhysicsSolver
|
||||
{
|
||||
public:
|
||||
NzPhysicsSolver(nzSolverMode mode = nzLinear, unsigned int numberOfPassesLinearMode = 10);
|
||||
void Configure(nzSolverMode mode, unsigned int numberOfPassesLinearMode);
|
||||
void Set(NzPhysicsWorld* world);
|
||||
~NzPhysicsSolver();
|
||||
protected:
|
||||
private:
|
||||
nzSolverMode m_mode;
|
||||
unsigned int m_numberOfPassesLinearMode;
|
||||
};
|
||||
|
||||
#endif // PHYSICSSOLVER_HPP
|
||||
@@ -1,51 +0,0 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq / Rémi Bèges
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef PHYSICSWORLD_HPP
|
||||
#define PHYSICSWORLD_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Newton/Newton.h>
|
||||
#include <Nazara/Math/Vector3.hpp>
|
||||
#include <Nazara/Math/Cube.hpp>
|
||||
#include "PhysicsSolver.hpp"
|
||||
//#include <Nazara/Physics/PhysicsSolver.hpp>
|
||||
|
||||
//TODO : ajouter Axis Aligned Bounding Box
|
||||
|
||||
class NzPhysicsWorld
|
||||
{
|
||||
enum nzFrictionModel
|
||||
{
|
||||
nzExact,
|
||||
nzAdaptative
|
||||
};
|
||||
|
||||
public:
|
||||
NzPhysicsWorld();
|
||||
~NzPhysicsWorld();
|
||||
|
||||
void SetSize(const NzCubef& size);
|
||||
const NzCubef& GetSize() const;
|
||||
|
||||
void SetPhysicsSolver(const NzPhysicsSolver& solver);
|
||||
const NzPhysicsSolver& GetPhysicsSolver() const;
|
||||
|
||||
void SetFrictionModel(nzFrictionModel model);
|
||||
const nzFrictionModel& GetFrictionModel() const;
|
||||
|
||||
void UpdatePhysics(float timestep);
|
||||
|
||||
NewtonWorld* newtonWorld;
|
||||
|
||||
protected:
|
||||
private:
|
||||
NzPhysicsSolver m_solver;
|
||||
nzFrictionModel m_frictionModel;
|
||||
NzCubef m_size;
|
||||
};
|
||||
|
||||
#endif // PHYSICSWORLD_HPP
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq / Rémi Bèges
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef STATICBODY_HPP
|
||||
#define STATICBODY_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
//#include <Nazara/Physics/PhysicsEntity.hpp>
|
||||
#include "PhysicsEntity.hpp"
|
||||
|
||||
class NzStaticBody : public NzPhysicsEntity
|
||||
{
|
||||
public:
|
||||
NzStaticBody(NzPhysicsWorld* world, const NzCollisionShape& shape, const NzVector3f& position, float mass);
|
||||
~NzStaticBody();
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
#endif // STATICBODY_HPP
|
||||
Reference in New Issue
Block a user