Jump to content

Lethal Raptor Games

  • Content Count

  • Joined

  • Last visited

Everything posted by Lethal Raptor Games

  1. Time::Update(); ah well - you have to add this. 😳
  2. I swear I must be doing something wrong, I can't get the following code to do anything. The body remains active (orange) yet doesn't move. This is using the latest 4.6 update on the default branch. #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } bool wireframe = false; bool App::Start() { window = Window::Create(); context = Context::Create(window); world = World::Create(); camera = Camera::Create(); camera->SetFOV(70.0f); camera->Move(0, 0, -15); auto player = Model::Cylinder(); auto s = Shape::Cylinder(); player->SetShape(s); player->SetMass(1.0f); return true; } bool App::Loop() { if (window->KeyHit(Key::Escape) == true) { return false; } if (window->KeyHit(Key::F3) == true) { camera->SetDebugPhysicsMode(!camera->GetDebugPhysicsMode()); } if (window->KeyHit(Key::F2) == true) { if (wireframe == true) { camera->SetDrawMode(0); wireframe = false; } else { camera->SetDrawMode(2); wireframe = true; } } world->Update(); world->Render(); context->Sync(); return true; }
  3. Lethal Raptor Games

    Dev Log

    Looking forward to seeing more of Turbo! What is the next step?
  4. It's been fun. I was thinking of making it work with the inbuilt terrain system and adding it to the marketplace.
  5. Thought I'd show off what I've been working on this weekend. I have implemented procedural grass as found here at Outerra. There is still more work to be done on it but so far it looks promising.
  6. As a basic solution, yes. I more referring too how to make the clothing animate with the character. I think the only option is too export all the clothing with the character and hide / show what clothing you want. I'm still trying to figure out if there is another way yet.
  7. How would I attached a clothing model to an animated character? The clothing has been skinned in blender and it has an animation shader applied. I tried loading it and parenting it to the character but I am thinking it might need to be parented to the rig somehow? Anyone have any suggestions?
  8. @Josh would you have any idea about this?
  9. I've been asked by my animator if Leadwerks supports IK bones?  I'm under the impression if you setup IK in blender to animate with, the bones are exported with their transformations saved in the file.  Is this correct?

    1. Show previous comments  1 more
    2. Lethal Raptor Games

      Lethal Raptor Games

      Okay will do.  Thanks

    3. gamecreator


      It supports 3DS Max Biped and CAT rigs, for what that's worth.

    4. slick29


      Stupid question, but supports 3DS Max Biped and CAT rigs how?

  10. You're adding a force in the Z direction. What you want is somthing like this; Float angle = player.rotation.y Float x = math.sin (angle) Float z = math.cos (angle) Addforce (position, vec3 (x, 0, z))
  11. It looks much better now. I see you're adding 200 in the Y direction which seems too much. You can get the facing direction of the player and add a force in that direction.
  12. You can call GetCollisionType () to see if it matches the boxes. 😊
  13. You may have to put some timing checks in place, because for a period of time the foot pivot will be inside the box and will constantly add a force. lastTime = 0 function Script:Collision(entity,position,normal,speed) if(Time:Millis() > lastTime + 1000) { //Only add if the kicks are spaced by 1 second entity:AddPointForce(position,Vec3(0,0,100)) //Add the force to the box lastTime = Time:Millis() } end Something like that.
  14. Looks good! You've got something to play around with now at least.
  15. You won't need the head bone for this. FOOT = 10 CRATE = 11 self.footbone = self.entity:FindChild("nameoffootbone") self.footpivot = Pivot:create(self.footbone) self.footpivot:SetPosition(self.footbone:GetPosition(true),true) local shape = Shape::Sphere() self.footpivot:SetShape(shape) self:footpivot:SetCollisionType(FOOT) Collision:SetResponse(FOOT,CRATE,Collision:Trigger) /////////////////////////////////////////////////////////// function Script:Collision(entity,position,normal,speed) entity:AddPointForce(position,Vec3(0,0,100)) //Add the force to the box end This is basically what I mean. EDIT : I haven't used LUA in ages so syntax will probably be off.
  16. I take it your character is animated? If so the foot bone will be a child of your player entity. Entity::FindChild("nameofbone");
  17. You could; Create pivot. Parent pivot to the foot bone. Create Box shape for the pivot. Enable collisions between the box and pivot as Trigger. In the scripts Collision() function -> Get the box entity and AddPointForce() at the collision position.
  18. What I have at the moment is the terrain triangles surrounding the player are created from a polymesh (in red). If I set the collision between the terrain shape and the player shape to collide it calls the Collison() callback, but if I set it too trigger it falls straight through without triggering it. The box (in green) is also a trigger an it works flawlessly. Does a trigger shape need to be a volume rather than a group of thin polys? A bit of info on what I'm doing; I am applying a force to the player's shape to simulate gravity, when a collision on the terrain is detected it stops the velocity and keeps the entity at that position until moved by the player. To find the position the player should move too, I get the collision normal, create a plane, and find a position on that plane a little further forward (or backward) then use PhysicSetPosition() to move it there. The problem with the collision set to collide is the player drags across the surface and causes jittering. I need to be able to detect the collision without the physics system actually doing anything. I.e. A trigger.
  19. Okay thanks, I'll see how it goes. If it doesn't work well I'll try making a predefined list of rotations for each of the gravity directions.
  20. Thanks. So those problems wouldn't exist with AlignToVector() or Point()? 🤔
  21. How would I transform the following (or any other) vector to a 3D rotation without using a pivot as a buffer? Can the Transform functions be used here or have I already found the easiest way? Calling on any math guys out there... upDirection = Vec3(0.0f, 1.0f, 0.0f); pivotAlignment->AlignToVector(upDirection, 1); Vec3 _rot = pivotAlignment->GetRotation(); //_rot = Vec3(0.0f, 0.0f, 0.0f); physicsParent->PhysicsSetRotation(_rot, 1.0f); I don't want to use a pivot because, well, it just seems ugly.
  22. I solved the jittering of the physics object, it was simple. I was setting the cameras pivot to the heads position each frame instead of parenting it to the head bone (doing that caused the camera to rotate with the bone - which was kinda what I wanted except the bone had weird rotations on top of how it was animated) auto _headPos = frameManager->GetBonePosition(bones.head, true); cameraPivot->SetPosition(_headPos, true); So I just parented the camera's pivot the player entity instead. Problem-o solved.
  23. I'll reduce the poly count and see how that helps then. Is a batch a group of entities that fall within the frustum? You tease me - I'm thinking about moving over to Turbo now but am worried there might not be enough features yet to make the transition seamless. Like I know there is no 2D drawing yet... and some commands are missing...
  • Create New...