Jump to content

Arkane

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Arkane

  1. So I will let this part away. I know many games have this issue that is considered as "not a big deal" for model clipping a little bit through "structures". I was just wondering if it was easily dealing with. But if it's not, no matter I will concentrate my effort on my third person camera collision (other post http://www.leadwerks.com/werkspace/topic/10702-third-person-camera-collision/). Thanks Rick for your help !
  2. Thanks Cassius and Rick for your help. Is there a way to remove the default shape of the character controller and affect a new one with SetShape ?
  3. Thanks for your reply Josh. I just want to adjust the shape to because I saw that my model when it collides with a wall a small part of the cylinder go through wall. Like that : http://imgur.com/puev0s4 I think that's caused by not adjusted physics shape.
  4. Hi, I'm trying to resize the physics shape of a cylinder which is my player. I've tried a simple code : Entity* player; Model* playerModel; //Create the player player = Pivot::Create(); player->SetPhysicsMode(Entity::CharacterPhysics); // Set player physics player->SetPosition(Vec3(0, 1, 0)); player->SetMass(1); //Create player mesh playerModel = Model::Cylinder(64); playerModel->SetParent(player); playerModel->SetPosition(Vec3(0, 4, 0)); playerModel->SetScale(1, 2, 1); playerModel->SetColor(0.0, 1.0, 0.0); Shape* playerShape = Shape::Cylinder(0, 0, 0, 0, 0, 0, 2, 1, 1); playerModel->SetShape(playerShape); playerShape->Release(); What I'm doing wrong ? Thanks
  5. I saw in camera.h that there is localfrustumpoints and frustumpoints. What is the difference ? What if the order of each point in those arrays ? Can I use them to get the near camera plane and the far camera plane of the view frustrum ? Maybe is it easier to use Camera::GetRange() and Camera::GetFOV () then calculate the four points of the near camera plane ?
  6. I've found a good tutorial about TP camera collision/occlusion. It's for Unity but I think we can make the same in leadwerks. http://www.3dbuzz.com/training/view/3rd-person-character-system/enhanced-character-system/11-occlusion-and-collision-overview There is more videos about third person camera here : http://www.3dbuzz.com/training/view/3rd-person-character-system/enhanced-character-system Can someone tell me if it is possible to port it to leadwerks ? Thanks!
  7. So I found a workaround to handle my camera and not see through walls when I'm in a house for example. I've changed the pick radius and it works. After I will try to improve my camera rotation around the player. Based on Aggrors tutorial : //Update camera position Vec3 playerPosition = player->GetPosition(); Vec3 cameraPosition = fpsPivot->GetPosition(); float cameraHeight = crouching ? crouchHeight : playerHeight; cameraPosition.y = Math::Curve(playerPosition.y + cameraHeight, cameraPosition.y, cameraSmoothing); cameraPosition = Vec3(playerPosition.x, cameraPosition.y, playerPosition.z); fpsPivot->SetPosition(cameraPosition); //Position and rotation of FPS camera camera->SetPosition(fpsPivot->GetPosition()); //Postion and rotation of TPS camera tpsPivot->SetPosition(fpsPivot->GetPosition()); tpsPivot->Move(0, 1, maxCameraOffset); //Checking if Space key is pressed if (window->KeyHit(Key::Space)) { isFpsCam = !isFpsCam; } // Checking camera mode if (isFpsCam) { camera->SetPosition(fpsPivot->GetPosition()); camera->SetRotation(fpsPivot->GetRotation()); } else { camera->SetRotation(fpsPivot->GetRotation()); camera->SetPosition(tpsPivot->GetPosition()); } //Raycast to check TPS Camera obstacle PickInfo pick; if (world->Pick(fpsPivot->GetPosition(), tpsPivot->GetPosition(), pick, 0.5, true) && !isFpsCam) { camera->SetPosition(pick.position); } You can adjust pick radius a bit to have a better behaviour.
  8. Thank your for your answers. I will try to implement similar thing in my TPS camera code (when I'll be back home after work). I'll let you know if it works ;-).
  9. Hi, I'm testing Thid Person Camera. I have searched for tutorial on the forum . My camera is based on Aggror tutorial but I don't know how to handle camera collision to avoid seeing through walls. I know there are differents solutions to handle that (camera sphere, raycast, ...) : http://www.gamasutra.com/blogs/EricUndersander/20131001/201382/Accurate_Collision_Zoom_for_Cameras.php or http://books.google.fr/books?id=az_Oi9mSSiIC&pg=PA681&lpg=PA681&dq=third+person+camera+collision+sphere&source=bl&ots=CDTY7nJpfL&sig=sDnRf4DgJkJg39vSmNwI8vJlQ2U&hl=fr&sa=X&ei=gxAOVMOrAY2Xar_tgNAF&ved=0CCoQ6AEwATgK#v=onepage&q=third%20person%20camera%20collision%20sphere&f=false What's the best method ? Can someone help me posting code to show me how to handle that problem ? Thanks !
×
×
  • Create New...