<commit_before>#include "Assignment.h"
#include "PhysicsController.h"
#include "Sphere.h"
#include "PhysicsCamera.h"
#include "Box.h"
#include "Cylinder.h"
#include "Steerable3DController.h"
#include "Ground.h"
#include "Content.h"
#include <btBulletDynamicsCommon.h>
#include <gtc/quaternion.hpp>
#include <gtx/quaternion.hpp>
#include <gtx/euler_angles.hpp>
#include <gtx/norm.hpp>
#include "VectorDrawer.h"
#include "Utils.h"
#include "FountainEffect.h"
#include "SnowEffect.h"

using namespace BGE;

Assignment::Assignment(void)
{
	physicsFactory = NULL;
	dynamicsWorld = NULL;
	broadphase = NULL;
	dispatcher = NULL;
	solver = NULL;
	fullscreen = false;

}

Assignment::~Assignment(void)
{
}

bool Assignment::Initialise() 
{	
	fireRate= 5.0f;
	riftEnabled = false;

	// Set up the collision configuration and dispatcher
    collisionConfiguration = new btDefaultCollisionConfiguration();
    dispatcher = new btCollisionDispatcher(collisionConfiguration);
	soundSystem->PlaySoundW("sound2",glm::vec3(0,0,0));

    // The world.
	btVector3 worldMin(-1000,-1000,-1000);
	btVector3 worldMax(1000,1000,1000);
	broadphase = new btAxisSweep3(worldMin,worldMax);
	solver = new btSequentialImpulseConstraintSolver();
	dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);
    dynamicsWorld->setGravity(btVector3(0,-9,0));

		for(int i = 0; i < 10; i++)
		{
			for(int j = 0; j < 10; j++)
			{
				shared_ptr<FountainEffect> fountain = make_shared<FountainEffect>(500);
				fountain->diffuse = glm::vec3(1,0,0);
				fountain->position.x = 100 - (15 * i);
				fountain->position.z = 485 + (500 * j);
				fountain->position.y =100;
				fountain->diffuse= glm::vec3(0.0f,0.0f,1.0f);
				Djets.push_back(fountain);
				Attach(fountain);
			}
		}

	physicsFactory = make_shared<PhysicsFactory>(dynamicsWorld);

	physicsFactory->CreateGroundPhysics();
	physicsFactory->CreateCameraPhysics();

	shared_ptr<PhysicsController> wallL = physicsFactory->CreateContainerWall(100, 300, 5000, glm::vec3(100,0,2500), glm::quat());
	shared_ptr<PhysicsController> wallR = physicsFactory->CreateContainerWall(100, 300, 5000, glm::vec3(-100,0,2500), glm::quat());
	shared_ptr<PhysicsController> roof  = physicsFactory->CreateContainerWall(50, 20, 5000, glm::vec3(0,150,2500), glm::quat());

	for(int i = 0; i < 10;i++)
	{
		if( i % 3 == 0)
		{
			shared_ptr<PhysicsController> obstacle  = physicsFactory->CreateContainerWall(100, 20, 20, glm::vec3(0,40,((i * 500) + 485)), glm::quat());
			shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(((i) + 20),40,((i * 500) + 485)), glm::quat());
		}
		else if( i % 3 ==1)
		{
			shared_ptr<PhysicsController> obstacle  = physicsFactory->CreateContainerWall(100, 20, 20, glm::vec3(0,20,(i * 500) + 485), glm::quat());
			shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(((i)),40,((i * 500) + 485)), glm::quat());
		}
		else
		{
			shared_ptr<PhysicsController> obstacle  = physicsFactory->CreateContainerWall(100, 20, 20, glm::vec3(0,60,(i * 500) + 485), glm::quat());
			shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(((i) - 20),40,((i * 500) + 485)), glm::quat());
		}
	}

	shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(-20,40,5000), glm::quat());
	USSEnterprise = physicsFactory->CreateFromModel("USSEnterprise",glm::vec3(0,50,0),glm::quat(),2,glm::vec3(5,2.5,5));

	mass = 1.0f;
	dforce = 1000;
	t =0.0f;
	camera->orientation = USSEnterprise->orientation;
	body = physicsFactory->CreateRagDoll(1,1,4,glm::vec3(50,0,465));
	body->position = glm::vec3(USSEnterprise->PhysicsController::position.x,USSEnterprise->PhysicsController::position.y - 3,USSEnterprise->PhysicsController::position.z);
	if (!Game::Initialise()) {
		return false;
	}
	USSEnterprise->Attach(camera);
  
	return true;
}

void BGE::Assignment::Update(float timeDelta)
{
	float newtons = 10.0f;
	float epsilon = glm::epsilon<float>();
	float theta;
	glm::vec3 axis;
	glm::vec3 toShip2;

	camera->GetController()->look = USSEnterprise->PhysicsController::look;
	camera->look = USSEnterprise->look;
	camera->GetController()->up = USSEnterprise->PhysicsController::up;
	camera->GetController()->right = USSEnterprise->PhysicsController::right;
<commit_msg>Final Sweep<commit_after>#include "Assignment.h"
#include "PhysicsController.h"
#include "Sphere.h"
#include "PhysicsCamera.h"
#include "Box.h"
#include "Cylinder.h"
#include "Steerable3DController.h"
#include "Ground.h"
#include "Content.h"
#include <btBulletDynamicsCommon.h>
#include <gtc/quaternion.hpp>
#include <gtx/quaternion.hpp>
#include <gtx/euler_angles.hpp>
#include <gtx/norm.hpp>
#include "VectorDrawer.h"
#include "Utils.h"
#include "FountainEffect.h"
#include "SnowEffect.h"

using namespace BGE;

Assignment::Assignment(void)
{
	physicsFactory = NULL;
	dynamicsWorld = NULL;
	broadphase = NULL;
	dispatcher = NULL;
	solver = NULL;
	fullscreen = false;

}

Assignment::~Assignment(void)
{
}

bool Assignment::Initialise() 
{	
	fireRate= 5.0f;
	riftEnabled = false;

	// Set up the collision configuration and dispatcher
    collisionConfiguration = new btDefaultCollisionConfiguration();
    dispatcher = new btCollisionDispatcher(collisionConfiguration);
	soundSystem->PlaySoundW("sound2",glm::vec3(0,0,0));

    // The world.
	btVector3 worldMin(-1000,-1000,-1000);
	btVector3 worldMax(1000,1000,1000);
	broadphase = new btAxisSweep3(worldMin,worldMax);
	solver = new btSequentialImpulseConstraintSolver();
	dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);
    dynamicsWorld->setGravity(btVector3(0,-9,0));

		for(int i = 0; i < 10; i++)
		{
			for(int j = 0; j < 10; j++)
			{
				shared_ptr<FountainEffect> fountain = make_shared<FountainEffect>(500);
				fountain->diffuse = glm::vec3(1,0,0);
				fountain->position.x = 100 - (15 * i);
				fountain->position.z = 485 + (500 * j);
				fountain->position.y =100;
				fountain->diffuse= glm::vec3(0.0f,0.0f,1.0f);
				Djets.push_back(fountain);
				Attach(fountain);
			}
		}

	physicsFactory = make_shared<PhysicsFactory>(dynamicsWorld);

	physicsFactory->CreateGroundPhysics();
	physicsFactory->CreateCameraPhysics();

	shared_ptr<PhysicsController> wallL = physicsFactory->CreateContainerWall(100, 300, 5000, glm::vec3(100,0,2500), glm::quat());
	shared_ptr<PhysicsController> wallR = physicsFactory->CreateContainerWall(100, 300, 5000, glm::vec3(-100,0,2500), glm::quat());
	shared_ptr<PhysicsController> roof  = physicsFactory->CreateContainerWall(50, 20, 5000, glm::vec3(0,150,2500), glm::quat());

	for(int i = 0; i < 10;i++)
	{
		if( i % 3 == 0)
		{
			shared_ptr<PhysicsController> obstacle  = physicsFactory->CreateContainerWall(100, 20, 20, glm::vec3(0,40,((i * 500) + 485)), glm::quat());
			shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(((i) + 20),40,((i * 500) + 485)), glm::quat());
		}
		else if( i % 3 ==1)
		{
			shared_ptr<PhysicsController> obstacle  = physicsFactory->CreateContainerWall(100, 20, 20, glm::vec3(0,20,(i * 500) + 485), glm::quat());
			shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(((i)),40,((i * 500) + 485)), glm::quat());
		}
		else
		{
			shared_ptr<PhysicsController> obstacle  = physicsFactory->CreateContainerWall(100, 20, 20, glm::vec3(0,60,(i * 500) + 485), glm::quat());
			shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(((i) - 20),40,((i * 500) + 485)), glm::quat());
		}
	}

	shared_ptr<PhysicsController> obstacleUP  = physicsFactory->CreateContainerWall(20, 250, 20, glm::vec3(-20,40,5000), glm::quat());
	USSEnterprise = physicsFactory->CreateFromModel("USSEnterprise",glm::vec3(0,50,0),glm::quat(),2,glm::vec3(5,2.5,5));

	shared_ptr<SnowEffect> snow = make_shared<SnowEffect>();
	Attach(snow);

	mass = 1.0f;
	dforce = 1000;
	t =0.0f;

	body = physicsFactory->CreateRagDoll(1,1,4,glm::vec3(50,0,465));
	body->position = glm::vec3(USSEnterprise->PhysicsController::position.x,USSEnterprise->PhysicsController::position.y - 3,USSEnterprise->PhysicsController::position.z);
	if (!Game::Initialise()) {
		return false;
	}
	USSEnterprise->Attach(camera);
  
	return true;
}

void BGE::Assignment::Update(float timeDelta)
{
	float newtons = 10.0f;
	float epsilon = glm::epsilon<float>();
	float theta;
	glm::vec3 axis;
	glm::vec3 toShip2;


	camera->GetController()->up = USSEnterprise->PhysicsController::up;
	camera->GetController()->right = USSEnterprise->PhysicsController::right;

{'fraction_non_alphanumeric': 0.16813753581661892, 'fraction_numerical': 0.06670487106017192, 'mean_word_length': 6.042776432606941, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 114, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4499996', 'n_tokens_mistral': 3748, 'n_tokens_neox': 3197, 'n_words': 535}