Jump to content

balls


cassius
 Share

Recommended Posts

Perhaps you can record the velocity when it impacts on the ground and calculate that into a force that is being added to the ball to send it back in to the air.

 

so perhaps something like:

  • record impact velocity
  • divide the velocity by gravity
  • add the calculated value as a force to the ball

Link to comment
Share on other sites

Use the following lua script for you ball:

 

require("scripts/class")
local class=CreateClass(...)

function class:CreateObject(model)
local object=self.super:CreateObject(model)

model:SetElasticity(3.0)
end

 

The documentation says that only values from 0.0 to 1.0 can be passed to SetElasticity, but anything below

1.0 will not make the ball bounce nicely.

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...