martyj Posted November 8, 2015 Share Posted November 8, 2015 I have a model Model::Cylinder. Is this just the drawing? To add physics I would need to add a shape? Shape::Cylinder(x, y, z, pitch, yaw, roll, width, height, depth) Is the x, y, z relative to the center of the shape? How do the x,y,z positions relate to Model::SetPosition? From what I can see, they differ by a factor of 100? Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 8, 2015 Share Posted November 8, 2015 An example of your problem would help, but the offsets (x,y,z) should be relative to the center. And if they are off by a factor of 100, then I would assume its the difference between using centimeters and meters. Personally I am not a big fan of the cm use in the editor when all the LE commands use meters for units. 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...
martyj Posted November 8, 2015 Author Share Posted November 8, 2015 That's what I have been assuming. I just can't seem to place this shape accordingly and my model is halfway through the ground. Changing the Y value doesn't seem to change anything. Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 8, 2015 Share Posted November 8, 2015 an example showing your problem would help since the API example works ok: http://www.leadwerks.com/werkspace/page/api-reference/_/shape/shapecylinder-r519 As the example shows you do not need to offset/rotate/size the shape to take into account the position/rotation/scale of the model cylinder. The SetShape() command will set the shape to the model's position/rotation/size. So just use the default parameters (0,0,0, 0,0,0, 1,1,1) when creating the shape if you want it to conform directly to its corresponding model. Change those parameters when you want the shape different from the model. Also I suggest that you use 'camera:SetDebugPhysicsMode(true)' when troubleshooting physics issues. 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...
martyj Posted November 8, 2015 Author Share Posted November 8, 2015 SetDebugPhysicsMode(true) would defiantly help. Thanks. 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.