void TerrainGeneratorLoader::loadLayerItem (Iff& iff, TerrainGenerator* terrainGenerator, TerrainGenerator::Layer* layer) { TerrainGenerator::Boundary* boundary = createBoundary (iff); if (boundary) layer->addBoundary (boundary); else { TerrainGenerator::Filter* filter = createFilter (iff, terrainGenerator); if (filter) layer->addFilter (filter); else { TerrainGenerator::Affector* affector = createAffector (iff, terrainGenerator); if (affector) layer->addAffector (affector); else { DEBUG_FATAL (iff.getCurrentName () != TAG_LAYR, ("not at layer in terrain file")); TerrainGenerator::Layer* sublayer = new TerrainGenerator::Layer (); sublayer->load (iff, terrainGenerator); layer->addLayer (sublayer); } //lint !e429 //-- sublayer has not been freed or returned } } }
MultipartWriter::MultipartWriter(std::ostream& ostr, const std::string& boundary): _ostr(ostr), _boundary(boundary), _firstPart(true) { if (_boundary.empty()) _boundary = createBoundary(); }
const Foam::labelListListList& Foam::block::boundaryPatches() const { if (boundaryPatches_.empty()) { createBoundary(); } return boundaryPatches_; }
MultipartWriter::MultipartWriter(std::ostream& ostr): _ostr(ostr), _boundary(createBoundary()), _firstPart(true) { }
void FirstPersonCamera::Update(double dt, vector<InteractableOBJs>&InteractablesList, vector<Building>&BuildingsList, Player &somePlayer) { Vector3 boundary(1000, 1000, 1000); speed = 30; mouseSpeed = 12; static const float CAMERA_SPEED = 50.f; //if (Application::IsKeyPressed('R')) //{ // Reset(); //} //view.y < 0.9396 && view.y > -09396 //Mouse - Shania //int Angle = 50; //horizontalAngle += mouseSpeed * dt * float(1680 / 2 - Application::mouseX); //if (verticalAngle + mouseSpeed * dt * float(1080 / 2 - Application::mouseY) < Angle && verticalAngle + mouseSpeed * dt * float(1080 / 2 - Application::mouseY) > -Angle) //{ // verticalAngle += mouseSpeed * dt * float(1080 / 2 - Application::mouseY); //} //Vector3 view(cos(Math::DegreeToRadian(verticalAngle)) * sin(Math::DegreeToRadian(horizontalAngle)), // sin(Math::DegreeToRadian(verticalAngle)), // cos(Math::DegreeToRadian(verticalAngle)) * cos(Math::DegreeToRadian(horizontalAngle))); //Vector3 right(sin(Math::DegreeToRadian(horizontalAngle - 90)), 0, cos(Math::DegreeToRadian(horizontalAngle - 90))); //up = right.Cross(view); //target = position + view.Normalized(); // Mouse - DonoDon Vector3 view = (target - position).Normalized(); float yaw = 0; float pitch = 0; yaw = (float)(mouseSpeed * dt * (1680 / 2 - Application::mouseX)); pitch = (float)(mouseSpeed * dt * (1080 / 2 - Application::mouseY)); // Mouse Mtx44 rotationYaw; rotationYaw.SetToRotation(yaw, 0, 1, 0); view = (target - position); Vector3 right = view.Cross(up); view = rotationYaw * view; target = view + position; up = rotationYaw * up; Mtx44 rotationPitch; view = (target - position); right = view.Cross(up); right.y = 0; up = right.Cross(view).Normalized(); rotationPitch.SetToRotation(pitch, right.x, right.y, right.z); view = rotationPitch * view; target = view + position; view = (target - position).Normalized(); Position camPos; // Position to check collision with if (Application::IsKeyPressed('W')) { camPos.Set(somePlayer.pos.x + view.Normalized().x, somePlayer.pos.y + view.Normalized().y, somePlayer.pos.z + view.Normalized().z); if (createBoundary(InteractablesList, BuildingsList, somePlayer, camPos)) { position.x = position.x + view.Normalized().x; // position = position + view position.z = position.z + view.Normalized().z; // position = position + view target.x = target.x + view.Normalized().x; // target = target + view target.z = target.z + view.Normalized().z; // target = target + view somePlayer.pos.x += view.Normalized().x; somePlayer.pos.z += view.Normalized().z; } } if (Application::IsKeyPressed('S')) { //camPos.Set(position.x - view.x, position.Normalized().y - view.y, position.z - view.z); camPos.Set(somePlayer.pos.x - view.Normalized().x, somePlayer.pos.y - view.Normalized().y, somePlayer.pos.z - view.Normalized().z); if (createBoundary(InteractablesList, BuildingsList, somePlayer, camPos)) { position.x = position.x - (target - position).Normalized().x; position.z = position.z - (target - position).Normalized().z; target.x = target.x - (target - position).Normalized().x; target.z = target.z - (target - position).Normalized().z; somePlayer.pos.x -= view.Normalized().x; somePlayer.pos.z -= view.Normalized().z; } } if (Application::IsKeyPressed('A')) { //camPos.Set(position.x - right.Normalized().x, position.Normalized().y - right.Normalized().y, position.z - right.Normalized().z); camPos.Set(somePlayer.pos.x - right.Normalized().x, somePlayer.pos.y - right.Normalized().y, somePlayer.pos.z - right.Normalized().z); if (createBoundary(InteractablesList, BuildingsList, somePlayer, camPos)) { position -= right.Normalized(); target -= right.Normalized(); somePlayer.pos.x -= right.Normalized().x; somePlayer.pos.z -= right.Normalized().z; } } if (Application::IsKeyPressed('D')) { //camPos.Set(position.x + right.Normalized().x, position.Normalized().y + right.Normalized().y, position.z + right.Normalized().z); camPos.Set(somePlayer.pos.x + right.Normalized().x, somePlayer.pos.y + right.Normalized().y, somePlayer.pos.z + right.Normalized().z); if (createBoundary(InteractablesList, BuildingsList, somePlayer, camPos)) { position += right.Normalized(); target += right.Normalized(); somePlayer.pos.x += right.Normalized().x; somePlayer.pos.z += right.Normalized().z; } } }