Jump to content

tjheldna

Members
  • Posts

    938
  • Joined

  • Last visited

Posts posted by tjheldna

  1. If you rename a texture file the .meta file name is changed, however the source file (.png etc) name is not changed.

     

    If you want to edit the texture properties by double clicking on it, it can't be found and the only way for it to work again is to rename the source (.png etc) it manually.

     

    Sorry it's a quick report before I forget it, I can provide more detail if needed later.

     

    Cheers

  2. If you look in the editor click the materials button on the LHS, then you can select brushes faces in the editor. Then under the Objects tab on the RHS there are a series of number buttons for your smoothing groups.

    • Upvote 1
  3. If you load up a prefab you and go File->Save The only save extension option is a .map. CTRL-S dosen't resave as a .pfb with the same name also.

     

    The only way to resave a prefab is to right click on your root entity in the scene graph and save as prefab again, which is a little confusing seeming you opened a .pfb file.

     

    Cheers.

  4. I was working on exactly the same thing last night creating a 3rd person camera. I had the same jittering that you describe when rotating. I was doing some testing and coming from that it seems that if you set the cameras rotation to the players rotation you get some nasty jittering. There is definitely something wrong going on here I think.

     

    Here is what I came up with that gave me good results.

     

    I have an interface manager that manages everything GUI

     

    This takes place every game loop to give me the mouses offset.

    Vec3 mousePosition = context->window->GetMousePosition();
    if (mousePosition != mousePreviousPosition)
    {
    mouseDelta = mousePreviousPosition - mousePosition;
    }
    else
    {
    mouseDelta = 0.0F;
    }
    if ((cursor) && cursor->IsVisible())
    {
    cursor->SetPosition(mousePosition.x, mousePosition.y);
    cursor->Render();
    }
    else
    {
    context->window->SetMousePosition(context->GetWidth() / 2, context->GetHeight() / 2);
    mousePreviousPosition = context->window->GetMousePosition();
    }
    

     

     

    In the player controller's update, and the yaw value is used in the characters SetInput() function for rotation.

     

    float cameraTopAngle = 45;
     float cameraBottomAngle = -45;
     yaw += TheInterface->GetMouseDelta().x / mouseSensitivity;
     pitch += TheInterface->GetMouseDelta().y / mouseSensitivity;
     //Adjust and set the camera rotation
     if (pitch > cameraTopAngle)
     pitch = cameraTopAngle;
     else if (pitch < cameraBottomAngle)
     pitch = cameraBottomAngle;
    

     

     

    My camera object Update

     

     

    if (GetCameraTarget())
    {
    //GameObject *objectTarget = (GameObject*)TheGameWorld->FindObjectByAddress(Object::GetAddress(GetCameraTarget()));
    if (!TheMainWindow)
    {
    Vec3 lastPosition;
    BaseObject* object = (BaseObject*)GetCameraTarget()->GetUserData();
    if (object->GetBaseType() == kObjectCharacter)
    {
    GameCharacter *character = static_cast<GameCharacter*>(object);
    if(character)
    {
     //Figure out new position
     //lastPosition = entity->GetPosition();
    
     //Calculate the furthest TPS pivot position
     tpsPivot->SetPosition(GetCameraTarget()->GetPosition());
     tpsPivot->Move(0.0F, GetHeight(), -GetCamDistance(), false);
    
     //Use a pick to determine where the camera should be
     PickInfo pick;
     Vec3 pickPos = GetCameraTarget()->GetPosition();
     pickPos.y += GetHeight();
     character->entity->SetPickMode(0);
     if (TheGameWorld->world->Pick(pickPos, tpsPivot->GetPosition(), pick, 0.0F, true))
     {
     //Store distance
     float distance = tpsPivot->GetPosition().DistanceToPoint(pick.position);
     std::cout << distance << std::endl;
     tpsPivot->SetPosition(pick.position);
     }
     character->entity->SetPickMode(Entity::SpherePick);
     tpsPivot->SetRotation(GetCameraTarget()->GetRotation());
    
     Vec3 rot = tpsPivot->GetRotation();
     rot.y = -character->GetYaw();
     rot.x = -character->GetPitch();
     //Apply position
     lastPosition.x = Math::Curve(tpsPivot->GetPosition().x, entity->GetPosition().x, (GetSmoothness()) / Time::GetSpeed());
     lastPosition.y = Math::Curve(tpsPivot->GetPosition().y, entity->GetPosition().y, (GetSmoothness()) / Time::GetSpeed());
     lastPosition.z = Math::Curve(tpsPivot->GetPosition().z, entity->GetPosition().z, (GetSmoothness()) / Time::GetSpeed());
     entity->SetRotation(rot);
     entity->SetPosition(lastPosition);
    }
    }
    }
    }
    

     

    The important thing to note is that the delta of the mouse movement is fed into the pitch and yaw variables which is accessed by the camera to set it's rotation opposed to camera->SetRotation(character->GetRotation()) (Although I would have thought the set rotation method should work). Obviously there are declarations which I haven't included above. I coded it in the early hours of last night and haven't looked at it since but hope it helps.

  5. I don't know but it could be usefull to be able to visualize/modify prefab in Assets brower,

    or it is better to keep prefab like that because it is just some "shortcut" in fact to grouped engine objects ?

     

    You can open a .pfb file like a world edit it and save it(I didn't know this till recently, but it's always been there).

  6. Ok I just did a quick test myself. You are right Michael, over time with SetVelocity() the entity does slow down indeed.

     

    I had Friction = 0, Mass = 1, Gravity Mode = 0.

     

    Is it possible its a bug? Maybe it behaved the way I expedted the last time I used the function in an earlier build?

     

    Anyway Calling SetVelocity() every update does work.

  7. SetVelocity() every Update?

     

    Just a thought also, maybe there is a child node of your object with physics set unknowingly? or something else weird like that. I don't even know if would matter or not. I'm positive SetVelociy() does it.

  8. I did this a while back for a projectile and I'm pretty sure it works like you need, it might help ya...

     

    This is called when the entity is created

     

    Shape *shape = Shape::Box(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.3F,0.3F, 0.3F);
    entity->SetShape(shape);
    shape->Release();
    entity->SetPhysicsMode(Entity::RigidBodyPhysics);
    entity->SetMass(1);
    entity->SetCollisionType(Collision::Trigger);
    entity->SetGravityMode(0);
    entity->AddForce(GetProjectileVelocity());
    

  9. Are you using AddForce or SetVelocity? From my experience SetVelocity should keep you moving in that direction. I think as well you can have mass on it and it will still go in the direction you set and gravity doesn't effect it.

     

    Correct me if I'm wrong.....

  10. When using SetCollisionResponse() the third value seems to reflect the type of response. From what I gather 0=none and 1=collide with physical reaction

     

    That would be good to have controll over, however what you need to do is, anything that needs no physic collision response is in Set it to trigger and in the oncollision have a switch statement to work out what initiated the collision. I use GetUserData() to store an object and it's type.

     

    Something like this....

     

    void TriggerCollision(Entity *entity0, Entity *entity1, float *position, float *normal, float *speed)
    {
    BaseObject* object = (BaseObject*)entity0->GetUserData();
    if(object->GetBaseType() == kObjectTrigger)
    {
    Trigger *trigger = static_cast<Trigger*>(object);
    if((trigger) && !trigger->IsDisabled())
    {
    //Find what the hit target is
    BaseObject* hitObject = (BaseObject*)entity1->GetUserData();
    if(hitObject)
    {
    switch(trigger->GetType())
    {
    
     case kObjectDeathZoneTrigger:
     {
     trigger->Activate(trigger, hitObject);
     break;
     }
    
    
    etc.....
    

  11. Modo has some real nice re-topology tools, however it's not free.

     

    As for UVW unwrapping I use this 80%+ of the time. http://www.pullin-shapes.co.uk/page8.htm

     

    I export out to .obj then unwrap the import it back in it's quick as to use.

     

     

    When in it select the "Select edges" and "Ignore backfacing" then go around your model using "c" to cut or "w" to "weld"

     

     

    When you bring it back into your modeling program you may want to edit the positioning and scale to make better use of your texture map.

    • Upvote 1
  12. I would get some mind mapping software and use that to plot out the flow of the game. I also use Articy: Draft SE as its designed exatly for this task. http://store.steampowered.com/app/230780/.

     

    It's not the normal program I would buy, however I did anyway.

     

    It's exactly what I was looking for! Ordering all the ideas in my head; planning and I am finding that new ideas are flowing just from being able to visualise things. I only wish I knew about it earlier!

     

    Thanks Einlander!

  13. This is an optimisation to opening prefabs as I see it, you may not agree with me so do with this as you want. I'm just starting to get more picky now, as It's getting increasingly harder to find bugs =).

     

    When you open up a prefab using File->Load, the prefab in the world is where ever it was when you created it. i.e

    • I save the model in the original scene at x = 30.0, y = 1.0, z = 23.0

    • If you open up the prefab file you created, the models will be positioned at that location above.

    • I guess I would expect it all centered when I go to edit it at 0.0, 0.0, 0.0.

     

    Cheers!

×
×
  • Create New...