added missing files to git
This commit is contained in:
parent
0f6005dd4d
commit
846eff8b11
BIN
.vs/Projekt/v16/ipch/AutoPCH/1189473e7ce6c82c/SHADER_LOADER.ipch
Normal file
BIN
.vs/Projekt/v16/ipch/AutoPCH/1189473e7ce6c82c/SHADER_LOADER.ipch
Normal file
Binary file not shown.
BIN
.vs/Projekt/v16/ipch/AutoPCH/3a1d210f80e38653/RENDER_UTILS.ipch
Normal file
BIN
.vs/Projekt/v16/ipch/AutoPCH/3a1d210f80e38653/RENDER_UTILS.ipch
Normal file
Binary file not shown.
BIN
.vs/Projekt/v16/ipch/AutoPCH/86e70fe71dad0af1/PHYSICS.ipch
Normal file
BIN
.vs/Projekt/v16/ipch/AutoPCH/86e70fe71dad0af1/PHYSICS.ipch
Normal file
Binary file not shown.
BIN
Debug/Physics.obj
Normal file
BIN
Debug/Physics.obj
Normal file
Binary file not shown.
18
cw 6/models/plane.obj
Normal file
18
cw 6/models/plane.obj
Normal 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
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
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
48
cw 6/src/SOIL/Physics.cpp
Normal 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
24
cw 6/src/SOIL/Physics.h
Normal 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
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
BIN
cw 6/textures/terrain.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
cw 6/textures/txt-subm-1.jpg
Normal file
BIN
cw 6/textures/txt-subm-1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 315 KiB |
Loading…
Reference in New Issue
Block a user