added missing files to git

This commit is contained in:
koziej97 2022-02-10 16:38:33 +01:00
parent 0f6005dd4d
commit 846eff8b11
12 changed files with 40599 additions and 0 deletions

BIN
Debug/Physics.obj Normal file

Binary file not shown.

18
cw 6/models/plane.obj Normal file
View File

@ -0,0 +1,18 @@
v 0 -100 -100
v 0 -100 100
v 0 100 -100
v 0 100 100
vt 0 0
vt 20 0
vt 0 20
vt 20 20
vn 0 1 0
s off
f 1/3/1 3/1/1 4/2/1
f 1/3/1 4/2/1 2/4/1
f 1/3/1 4/2/1 3/1/1
f 1/3/1 2/4/1 4/2/1

10190
cw 6/models/seafloor.obj Normal file

File diff suppressed because it is too large Load Diff

30319
cw 6/models/submarine.obj Normal file

File diff suppressed because it is too large Load Diff

48
cw 6/src/SOIL/Physics.cpp Normal file
View File

@ -0,0 +1,48 @@
#include "Physics.h"
#define PX_RELEASE(x) if(x) { x->release(); x = NULL; }
Physics::Physics(float gravity)
{
foundation = PxCreateFoundation(PX_PHYSICS_VERSION, allocator, errorCallback);
physics = PxCreatePhysics(PX_PHYSICS_VERSION, *foundation, PxTolerancesScale(), true);
PxSceneDesc sceneDesc(physics->getTolerancesScale());
sceneDesc.gravity = PxVec3(0.0f, -gravity, 0.0f);
dispatcher = PxDefaultCpuDispatcherCreate(2);
sceneDesc.cpuDispatcher = dispatcher;
sceneDesc.filterShader = PxDefaultSimulationFilterShader;
scene = physics->createScene(sceneDesc);
}
Physics::Physics(float gravity,
PxSimulationFilterShader simulationFilterShader,
PxSimulationEventCallback* simulationEventCallback)
{
foundation = PxCreateFoundation(PX_PHYSICS_VERSION, allocator, errorCallback);
physics = PxCreatePhysics(PX_PHYSICS_VERSION, *foundation, PxTolerancesScale(), true);
PxSceneDesc sceneDesc(physics->getTolerancesScale());
sceneDesc.gravity = PxVec3(0.0f, -gravity, 0.0f);
dispatcher = PxDefaultCpuDispatcherCreate(2);
sceneDesc.cpuDispatcher = dispatcher;
sceneDesc.filterShader = simulationFilterShader;
sceneDesc.kineKineFilteringMode = PxPairFilteringMode::eKEEP; // So kin-kin contacts with be reported
sceneDesc.staticKineFilteringMode = PxPairFilteringMode::eKEEP; // So static-kin constacts will be reported
sceneDesc.simulationEventCallback = simulationEventCallback;
scene = physics->createScene(sceneDesc);
}
Physics::~Physics()
{
PX_RELEASE(scene);
PX_RELEASE(dispatcher);
PX_RELEASE(physics);
PX_RELEASE(foundation);
}
void Physics::step(float dt)
{
scene->simulate(dt);
scene->fetchResults(true);
}

24
cw 6/src/SOIL/Physics.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#include "PxPhysicsAPI.h"
using namespace physx;
class Physics
{
public:
Physics(float gravity);
Physics(float gravity,
PxSimulationFilterShader simulationFilterShader,
PxSimulationEventCallback* simulationEventCallback);
virtual ~Physics();
PxPhysics* physics = nullptr;
PxScene* scene = nullptr;
void step(float dt);
private:
PxDefaultAllocator allocator;
PxDefaultErrorCallback errorCallback;
PxFoundation* foundation = nullptr;
PxDefaultCpuDispatcher* dispatcher = nullptr;
};

BIN
cw 6/textures/a.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

BIN
cw 6/textures/terrain.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB