Jump to content

Leadwerks Model and Shape


martyj
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

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

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.

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

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...