Ball

This function creates a new ball and socket joint.

Syntax

Parameters

Returns

Returns a new joint.

Example

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
camera:Move(0,0,-4)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

local parent = nil
local child = nil

parent = Model:Box()
parent:SetColor(0.0,0.0,1.0)
parent:SetMass(0)
parent:SetGravityMode(false)

child = Model:Box()
child:SetColor(1.0,0.0,0.0)
child:SetMass(1)
child:SetPosition(2,0,0)
child:AddTorque(10,0,0)

local joint = Joint:Ball(0,0,0, child, parent)

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

Time:Update()
world:Update()
world:Render()
context:Sync()

end