nelsoncs Posted August 14, 2014 Share Posted August 14, 2014 Can objects interact with friction in Leadwerks? As an example, If I drop one cube ontop of another, when I rotate the bottom cube, the top one seems to have no actual interaction with the lower one and does not rotate. I f there was friction between them, I would expect the top cube to rotate based on its points of contact with the lower cube. I have tried SetFriction for both objects and various collision types ( probably not exhaustive). Any suggestions on how to accomplish this? Quote Link to comment Share on other sites More sharing options...
cassius Posted August 14, 2014 Share Posted August 14, 2014 There was adjustable friction in le2. Don't know about le 3.2.In le2 an object with no friction would slide as though on ice when colliding. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
gamecreator Posted August 14, 2014 Share Posted August 14, 2014 Maybe try this to see if it helps: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/world/worldsetphysicsdetail-r785 That said, physics still needs a lot of work in Leadwerks so I would advise you to stay away from it for now to save yourself some headaches. Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 14, 2014 Share Posted August 14, 2014 @ cassius there is a entity:SetFriction command in LE3: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetfriction-r142 @nelsoncs your cubes have to have a physics body, their masses set greater than 0 or the engine thinks the mesh is static, and you have to use PhysicsSetRotation/PhysicsSetPosition or the physics get broken function App:Start() self.window = Window:Create() self.context = Context:Create(self.window) self.world = World:Create() self.camera = Camera:Create() self.camera:Move(0,2,-4) self.light = DirectionalLight:Create() self.light:SetRotation(35,35,0) self.ground = Model:Box(10,.1,10) self.ground:SetColor(0,1,0,1) local shape = Shape:Box(0,0,0, 0,0,0, 10,.1,10) self.ground:SetShape(shape) shape:Release() self.model1 = Model:Box() self.model1:SetColor(1,0,0,1) self.model1:SetPosition(0,1,0) self.model1:SetMass(1) local shape = Shape:Box(0,0,0, 0,0,0, 1,1,1) self.model1:SetShape(shape) shape:Release() self.model2 = Model:Box() self.model1:SetColor(1,.5,0,1) self.model2:SetPosition(0,2.0,0) self.model2:SetMass(1) local shape = Shape:Box(0,0,0, 0,0,0, 1,1,1) self.model2:SetShape(shape) shape:Release() rotY = 0 return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end self.model1:PhysicsSetRotation(0,rotY,0,.1) rotY = rotY + 1 if rotY==360 then rotY = 0 end Time:Update() self.world:Update() self.world:Render() self.context:Sync() return true end 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
nelsoncs Posted August 17, 2014 Author Share Posted August 17, 2014 "you have to use PhysicsSetRotation/PhysicsSetPosition" <----- this is absolutely correct, thanks for the info. Without these calls a moving platform has no friction and a very odd collision shape. You can move the platform out from under objects and they hang in mid-air. Quote Link to comment Share on other sites More sharing options...
nelsoncs Posted August 17, 2014 Author Share Posted August 17, 2014 addendum: using "PhysicsSet....." made it possible to have a moving surface with objects on top that showed friction and moved reasonably well with the underlying surface. rotating the underlying surface was very very laggy. adding a .phy shape file to the model breaks everything and one can no longer set the rotation or position. so, my current conclusion is I have to use a different physics library, which I am disinclined to do or to drop the project altogether. this is rather disappointing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.