Jump to content

Charrua

Developers
  • Posts

    230
  • Joined

  • Last visited

Blog Comments posted by Charrua

  1. i do like the way the cars behave at low speed with leadwerks physics, but, as speed rises it shakes so much, so for omega i was using something like:

    self.entity:SetOmega(omega.x/(1+2*currentSpeed/maxSpeed),omega.y/(1+currentSpeed/maxSpeed),omega.z/(1+2*currentSpeed/maxSpeed))

    this way, i use the omega practically unaltered at low speed and then as speed rises and goes near maxSpeed, the x,y,z components are modulated

    playing with the 1+2* or 1+1* or 1+5* i get more or less attenuation on desired axes.

    I do not play with your car, stiil, I will for sure, in the video it looks and behaves very well, but so much rigid at low speed (for me )

    the x5 is still in my mind.. will try, thank´s for sharing all this stuff

  2. self.Tires[n]:SetOmega(self.Tires[n]:GetOmega()*Vec3(5,5,5))   ---------  make the car go faster

    very smart!

    --Smoothing:
    
    if turning==0 then
        self.entity:SetOmega(self.entity:GetOmega()*Vec3(-1,-1,-1))
    else self.entity:SetOmega(0,turning*Gas,0) end
    
        self.Axes[0]:SetOmega(self.Axes[0]:GetOmega()*Vec3(-1,-1,-1))
        self.Axes[1]:SetOmega(self.Axes[1]:GetOmega()*Vec3(-1,-1,-1))
        self.Axes[2]:SetOmega(self.Axes[2]:GetOmega()*Vec3(-1,-1,-1))
        self.Axes[3]:SetOmega(self.Axes[3]:GetOmega()*Vec3(-1,-1,-1))
    
        self.Axes[0]:SetVelocity(self.Axes[0]:GetVelocity()*Vec3(1,0.5,1))
        self.Axes[1]:SetVelocity(self.Axes[1]:GetVelocity()*Vec3(1,0.5,1))
        self.Axes[2]:SetVelocity(self.Axes[2]:GetVelocity()*Vec3(1,0.5,1))
        self.Axes[3]:SetVelocity(self.Axes[3]:GetVelocity()*Vec3(1,0.5,1))
    
    
    -- fake wheels update:
        
            self.Wheels[0]:SetMatrix(self.Tires[0]:GetMatrix())
            self.Wheels[1]:SetMatrix(self.Tires[1]:GetMatrix())
            self.Wheels[2]:SetMatrix(self.Tires[2]:GetMatrix())
            self.Wheels[3]:SetMatrix(self.Tires[3]:GetMatrix())
    
            self.Wheels[0]:SetPosition(self.PosWheels[0]+Vec3(0,self.Amortisseurs[0]:GetAngle()/6,0))
            self.Wheels[1]:SetPosition(self.PosWheels[1]+Vec3(0,self.Amortisseurs[1]:GetAngle()/6,0))
            self.Wheels[2]:SetPosition(self.PosWheels[2]+Vec3(0,self.Amortisseurs[2]:GetAngle()/6,0))
            self.Wheels[3]:SetPosition(self.PosWheels[3]+Vec3(0,self.Amortisseurs[3]:GetAngle()/6,0))
    end

    too much tuning on all of this constants... very nice!

    • Like 1
  3. Sphere is placed by math at the center of the 4 wheels, so, as you say, any shape is ok. The camera uses the orientation of the real chassis, for that reason it has this strange behavior. I still use a 100 mass car, an strength is scaled as speed rise.

    The chassis hits the ground and has 0 friction, I guess is better to hide it and let the fake chassis look nice and slow, perhaps I reduce the movement using some average values to reflect or simulate a more realistic one...

     

  4. About krazy tests...

    video captures are so glitchy, i guess is the combination of leadwerks and the video capture sofware.. 

    There are 4 lines of text, the first two are what is the speed aplied to the wheels and so, the estimates speed, based on diameter*PI in m/s and km/s

    The last two lines are based on real distance travelled (taking chassis positions each second and calclating distance, with vec3 distance to point function)

    I placed the chassis underground and it behaves ok, but beaware of not jump!

    The white sphere (is a fake chassis) is placed by hand doing an average of the position of the 4 wheels.

    if you set the property Hidden on the editor, then jumps are ok :)

    but, behavior is not much as realistic as it should, when you stop, the chassis seems to do a pendulus movement.. 

    now, the following two test are with the cassis in the correct place, seen/not seen.

    When chassis is correctly placed, as marcosuik says it tends to touch the floor and seems to try to fly

    I am using strength scaled (increased) by car speed.

    Juan

  5. If you get lost, you may PM me in spanish, but I do prefere to continue the therad in english, so, it keeps being usefull for the rest of the members.

    As you may know from my username, I'm from Uruguay, Montevideo, the southest Capital of South America :)

    Charruas was the ones that habit these lands before european came.

    Juan

     

    • Like 1
  6. look in my previous blog: simple car, in it you have all that you need.

    look at the wheel.lua script and see how do I control the velocity and in steer.lua how do I control steer.

    read it carefully, try to learn how the whole project works.. and you will find what you need. The zip file included on the blog has the entire project which is basen on Lua exclusively so any Leadwerks user might use it.

     

    • Like 1
  7.  

    bisagra = Joint:Hinge( 0, 0, 0, 0, 1, 0, self.puerta, self.entity )

    you are creating the joint at 0,0,0 so it will be at this position (bisagra = Joint:Hinge( 0, 0, 0, 0, 1, 0, self.puerta, self.entity )

    you have to place the hinge in the correct position, to the left of the door. If you decide to create the hinge by code, then, look on the editor whic are the x,y,z world coodinates at the left of the door and use these values on your code.

  8. thank's, i have been doing some trials... without much success trying to get events and objetcts from cpp created lua side... i will read and try what you posted here... 

    and

    but... no one answer... seems to be a black hole on this topic

    hope your blog bring to me some light at the end of the tunnel  :)

    Juan

     

×
×
  • Create New...