diff --git a/assets/meshes/goal.f3d b/assets/meshes/goal.f3d index 270e8af..46abfb9 100644 Binary files a/assets/meshes/goal.f3d and b/assets/meshes/goal.f3d differ diff --git a/assets/meshes/goal_b270.blend b/assets/meshes/goal_b270.blend index cdcecae..059c42a 100644 Binary files a/assets/meshes/goal_b270.blend and b/assets/meshes/goal_b270.blend differ diff --git a/assets/meshes/goal_b270.blend1 b/assets/meshes/goal_b270.blend1 new file mode 100644 index 0000000..d7e5090 Binary files /dev/null and b/assets/meshes/goal_b270.blend1 differ diff --git a/assets/meshes/jump180.f3d b/assets/meshes/jump180.f3d index de44362..daa6e47 100644 Binary files a/assets/meshes/jump180.f3d and b/assets/meshes/jump180.f3d differ diff --git a/assets/meshes/jump180_b270.blend b/assets/meshes/jump180_b270.blend index c89ac78..54a0f1a 100644 Binary files a/assets/meshes/jump180_b270.blend and b/assets/meshes/jump180_b270.blend differ diff --git a/assets/meshes/jump180_b270.blend1 b/assets/meshes/jump180_b270.blend1 new file mode 100644 index 0000000..86aad1c Binary files /dev/null and b/assets/meshes/jump180_b270.blend1 differ diff --git a/assets/textures/goal.png b/assets/textures/goal.png index 8e6c235..be66f78 100644 Binary files a/assets/textures/goal.png and b/assets/textures/goal.png differ diff --git a/assets/textures/goal.xcf b/assets/textures/goal.xcf index 68f1366..e8d66f3 100644 Binary files a/assets/textures/goal.xcf and b/assets/textures/goal.xcf differ diff --git a/assets/textures/jump180.png b/assets/textures/jump180.png index 0258717..025f3ce 100644 Binary files a/assets/textures/jump180.png and b/assets/textures/jump180.png differ diff --git a/assets/textures/jump180.xcf b/assets/textures/jump180.xcf new file mode 100644 index 0000000..220fb39 Binary files /dev/null and b/assets/textures/jump180.xcf differ diff --git a/src/JamSpookGame.cpp b/src/JamSpookGame.cpp index 9bc41ab..0dfb081 100644 --- a/src/JamSpookGame.cpp +++ b/src/JamSpookGame.cpp @@ -92,8 +92,9 @@ JamSpookGame::JamSpookGame(): // 16.0f/9.0f, - mCamera = camFactory->createPerspective(vec3(-20.0f, 20.0f, 20.0f), - vec3(0.0f, 0.0f, 0.0f), +// mCamera = camFactory->createPerspective(vec3(-40.0f, 40.0f, 40.0f), + mCamera = camFactory->createPerspective(vec3(-60.0f, 40.0f, 60.0f), + vec3(0.0f, -20.0f, 0.0f), vec3(0.0f, 1.0f, 0.0f), 90.0f/2, static_cast(mWindow->getWindowSize().x)/mWindow->getWindowSize().y, @@ -245,8 +246,8 @@ void JamSpookGame::set() dynamic_pointer_cast(findSystem(IDCache::get("PhysicsSystem"))), renderLayerGame); - jump180Factory->createJump180(vec3(0,-1, 0)); - jump180Factory->createJump180(vec3(0,-2, 1)); + jump180Factory->createJump180(vec3(0, 0, 0), vec3(0, 0, 0)); + jump180Factory->createJump180(vec3(18,-10, 12), vec3(0, 180, 0)); jump180Factory.reset(); @@ -257,7 +258,7 @@ void JamSpookGame::set() dynamic_pointer_cast(findSystem(IDCache::get("PhysicsSystem"))), renderLayerGame); - goalFactory->createGoal(vec3(-8,-4, -2)); + goalFactory->createGoal(vec3(0, -25, -10)); goalFactory.reset(); diff --git a/src/entities/Jump180Factory.cpp b/src/entities/Jump180Factory.cpp index 42bc93d..9540732 100644 --- a/src/entities/Jump180Factory.cpp +++ b/src/entities/Jump180Factory.cpp @@ -10,9 +10,9 @@ namespace JamSpook { Jump180Factory::Jump180Factory(weak_ptr assetSystem, - weak_ptr graphicsSystem, - weak_ptr physicsSystem, - weak_ptr renderLayer): + weak_ptr graphicsSystem, + weak_ptr physicsSystem, + weak_ptr renderLayer): mAssetSystem(assetSystem), mGraphicsSystem(graphicsSystem), mPhysicsSystem(physicsSystem), @@ -22,13 +22,30 @@ Jump180Factory::Jump180Factory(weak_ptr assetSystem, Jump180Factory::~Jump180Factory() {} -shared_ptr Jump180Factory::createJump180(const vec3 position) +shared_ptr Jump180Factory::createJump180(const vec3 position, + const vec3 eulerRotationXYZDegrees) { // Create instance shared_ptr entity = make_shared(); entity->setEntityTag("jump180"); SceneGraph::addEntity(entity); - mat4 transform = translate(mat4(1), position); + + // Create transform +// mat4 rotateToCenter = eulerAngleXYZ(radians(static_cast(-90)), +// radians(static_cast(0)), +// radians(static_cast(0))); + + mat4 rotation = eulerAngleXYZ( + radians(static_cast(eulerRotationXYZDegrees.x)), + radians(static_cast(eulerRotationXYZDegrees.y)), + radians(static_cast(eulerRotationXYZDegrees.z))); + + mat4 translation = translate(mat4(1.0f), position); + + mat4 transform = rotation * translation;// * rotateToCenter; + + +// mat4 transform = translate(mat4(1), position); // Add physics component ColliderFactory* colliderFactory = new ColliderFactory(mPhysicsSystem); @@ -40,7 +57,7 @@ shared_ptr Jump180Factory::createJump180(const vec3 position) getShared(mPhysicsSystem), getShared(mPhysicsSystem), colliderFactory->createBoxCollider(position, - quat(vec3(0,0,0)), + quat_cast(rotation), vec3(10,1,10), // radius 100.0f, // mass entity, diff --git a/src/entities/Jump180Factory.h b/src/entities/Jump180Factory.h index fbf0628..394b3d6 100644 --- a/src/entities/Jump180Factory.h +++ b/src/entities/Jump180Factory.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,9 @@ using glm::mat4; using glm::quat; using glm::translate; using glm::scale; +using glm::rotate; +using glm::eulerAngleXYZ; +using glm::radians; using ecos::utility::getShared; using ecos::core::IDCache; @@ -112,7 +116,8 @@ public: virtual ~Jump180Factory(); /// Compose a jump180 entity - shared_ptr createJump180(const vec3 position); + shared_ptr createJump180(const vec3 position, + const vec3 eulerRotationXYZDegrees); }; } // namespace JamSpook