Jump to content

Joint pin question


GorzenDev
 Share

Recommended Posts

first i like to say happy new year to all and i wish you a safe and productive year.

 

 

i have a question about the pin argument of creating a joint.

 

after playing around with joints it looks like the pin argument is in global space.

 

how would i go about setting a joint's pin orientation based on some local rotation?

 

for example 2 cubes binded by a hinge joint with a pin value of Vec3(1,0,0) X axis

looks alright when both cubes are aligned with 0 rotation.

 

but whenever i bind 2 cubes togheter with some rotation in mind the result is always global axis based?

 

-------------------------------------

Edit:

 

currently i have a workaround

which involves aligning both cubes to a global axis then bind them with the joint:hinge

then rotate it all back to there origional state.

the joint then rotates as if local to the parented cube.

 

but i assume there must be a better way.?

please help.

Link to comment
Share on other sites

Use the transform commands to figure out the global axis from the local axis you want:

http://www.leadwerks.com/werkspace/page/api-reference/_/transform/

 

You probably want this command:

http://www.leadwerks.com/werkspace/page/api-reference/_/transform/transformnormal-r545

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

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