Jump to content

whiterabbit

Members
  • Posts

    40
  • Joined

  • Last visited

Posts posted by whiterabbit

  1. Yep, I'm already going to be doing those things in different situations so it's not really a simple option. Gravity is disabled on the world and the ball applies a force to itself to simulate gravity so I can change the direction of gravity (not sure if you can change the gravity direction for the entire world?). I'll try and work around it for now.

  2. It seems that those are older functions from LE 2. At the moment I do not believe such functions exist (at least for lua). I had a similar issue so I made a little script for my ball to make it bounce. It looked like this -

     

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

    self.entity:AddForce(0,.25*speed,0) -- Add Global force to make the ball bounce upwards.

    self.entity:AddForce(0,.25*speed,0,false) -- Add Local force to make the ball have a random bounce

    end

     

    Thanks, I thought that might be the case. I just didn't want to have to do it myself.

  3. I have a model of a sphere with a collision mesh imported into Leadwerks and I wanted to control how 'bouncy' it was. Did a google search and came across the functions SetElasticity and SetSoftness (seems like they were called SetBodyElasticity and SetBodySoftness in older versions).

     

    The current docs don't mention these functions, or at least not on Entity, and when I try to call them they obviously don't exist. Does anyone know if they've been renamed, not available to Lua, removed for some reason?

     

    Just a few things I found:

    http://www.leadwerks.com/werkspace/topic/2546-balls/ (This has a Lua script that calls SetElasticity which makes me think it did exist at some point)

    http://www.leadwerks.com/werkspace/page/Documentation/le2/_/command-reference/bodies/setbodyelasticity-r58 (Old docs)

    http://www.leadwerks.com/werkspace/topic/4683-problem-with-collision-callback/ (C++ but calls SetElasticity)

  4. I just tried using Math:Lerp for the first time and get the error:

    attempt to call method 'Lerp' (a nil value)

    This is how I am calling it, I have also tried Math.Lerp and just Lerp, they don't work either.

    local R = Math:Lerp(self.DayAmbient.x,self.NightAmbient.x,Intense)

     

    As as a test I did I

    for k,v in pairs(Math) do print(k,v) end

    and I couldn't see Lerp anywhere in the output wacko.png

     

    I understand how Lerp works and can write the function myself to get around this, I just didn't know if the documentation is wrong or I am having some kind of bug or what.

×
×
  • Create New...