Jump to content

Josh

Staff
  • Posts

    23,263
  • Joined

  • Last visited

Posts posted by Josh

  1. Your call to SetRotation() is resetting the entity physics each frame, and it's also called in UpdateWorld() instead of UpdatePhysics(), where it should be (if at all): I changed the command to PhysicsSetRotation() which will do the same thing by applying torque to the object.

    local window = Window:GetCurrent()

     

    local onGround = false

     

    function Script:Start()

    x = self.entity.position.x

    y = self.entity.position.y

    z = self.entity.position.z

    end

     

    function Script:UpdatePhysics()

     

    window = Window:GetCurrent()

     

    if window:KeyDown(Key.D) and not cRight then

    self.entity:SetVelocity(Vec3(10, self.entity:GetVelocity().y, 0))

    elseif window:KeyDown(Key.A) and not cLeft then

    self.entity:SetVelocity(Vec3(-10, self.entity:GetVelocity().y, 0))

    end

     

    if window:KeyDown(Key.W) and onGround then

    self.entity:AddForce(0,500,0,true)

    end

     

    --self.entity:SetRotation(0, 0, 0)

    self.entity:PhysicsSetRotation(0, 0, 0)

    self.entity.position.z = -6.0

     

    onGround = false

    end

     

    function Script:Collision( entity, position, normal, speed )

     

    --print(normal.y)

     

    if normal.y > 0.0 then

    onGround = true

    end

     

    end

     

    You will always have problems if you try to make a rigid body behave like a character controller, because a character controller is fundamentally unrealistic...it always points straight up and down and can't rotate around the XZ axes. Even if you use a force to try to change the orientation, that force will have other unintended effects.

     

    The character controller is specifically designed for this type of movement and should really be used here. There are previous projects that used it in this way.

  2. Nice looking model. He'd be great for a main character. If you have a lot of those running around onscreen, you will want a low-res version. If you have a lot of point lights models like that could quickly raise the render polycount up to half a million, so be careful with those.

     

    Fortunately, the engine uses GPU skinning, so the animated vertex count isn't much of an issue.

  3. All members have access to it. The Leadwerks 2 items are only for people with "Developer" accounts, because there's a lot of stuff that's incompatible with Leadwerks 3.

     

    We're working to integrate Steam Workshop into Leadwerks, at which point that will provide a better way to share files, and you'll be able to publish your content directly to Steam.

    • Upvote 1
  4. The other reason for this is that I want to implement something more optimal than just switching objects. I want to be able to go into the model editor and tag different surfaces and bones to only render and animate at a certain LOD level. That way you just keep one entity, and all your logic stays the same for it, and it contains all the LOD information for optimal performance. This is a lot better than swapping entities like we did in Leadwerks 2, and it makes life a lot easier for the programmer.

    • Upvote 2
  5. You'll need the standard edition, but yes, the physics module is an abstract class that can be replaced with your own set of classes. As long as the required functions are there, the rest of the engine won't know the difference.

  6. We don't bother with it at this time.

    • For most objects, saving a couple thousand polygons makes absolutely no difference in rendering speed, because the vertex pipeline is not the bottleneck.
    • It increases the demands on the art pipeline.
    • Tessellation can be used to automate much of this on the GPU.

     

    Now when I start adding features that improve large outdoor scenes, it will make sense then because of the scale of the scene. But in most cases, LOD is a somewhat antiquated design idea based around how the hardware used to work. One exception is animated characters, which can still benefit from this mainly due to having a lower number of bones to update during animation.

  7. Nvidia released a driver a couple years ago that caused this problem. There was a simple shader fix for it, I think it was in 2.5. You could probably just copy the bloom or HDR shader into your project...it was one of those, I forget which.

     

    Search for "snow" and you'll find the thread we talked about this in. Or just use the latest 2.x version, which fixed this issue.

×
×
  • Create New...