Jump to content

How is the position of Joint::Kinematic(pos.x, pos.y, pos.z, entity) actually used?


TheConceptBoy
 Share

Recommended Posts

Good day, everyone. I'm a tad perplexed. I'm attaching a kinematic joing to a model but I don't want the joint to be attached to the smack center of the model because when I use 

 

SetTargetPosition(pick_sphere->GetPosition(true),1);

Then the target simply gets moved by it's center. I can kind of get that, since the function says you're moving the target of the joint, it would use the targets center point. The question I have then is, What's the point of setting the position for the joint creation with:

Joint::Kinematic(pos.x, pos.y, pos.z, entity)

What is the purpose of it? There isn't a Join->SetPosition so you can't move the joint?

The point here is to move the target to a position NOT by it's center, but by whatever point you're grabbing  the objects by.

Link to comment
Share on other sites

1 minute ago, Lethal Raptor Games said:

https://www.leadwerks.com/community/topic/18966-kinematic-position/?tab=comments#comment-118400

I think the joint is only a constraint, rather than an entity that can be moved.

yeah, I'm trying to get the constraint to NOT be in the middle of the object but at the location where the PickInfoData.position reports the collision taken place

Link to comment
Share on other sites

What I mean is what do the, posx, posy, posz do. They seem to have no effect on the entity that it drags.

  • static Joint* Kinematic(float posx, float posy, float posz, Entity* entity)

 

if I pick a box by it's corner, I want to drag it by the corner. but the kinematic body seems to move the box to the position by it's center.

Link to comment
Share on other sites

As Josh said in the link, it's the offset from the child entity but it cant be changed once created.  Probably best to use a kinematic joint on a pivot.  Then parent the picked entity to that pivot.  Then set the picked entities global position to that of the pivots + an offset.

Link to comment
Share on other sites

9 minutes ago, Lethal Raptor Games said:

As Josh said in the link, it's the offset from the child entity but it cant be changed once created.  Probably best to use a kinematic joint on a pivot.  Then parent the picked entity to that pivot.  Then set the picked entities global position to that of the pivots + an offset.

But that's the thing, I don't think the offset works. It always defaults to the center. even if I set the position of the new join to be at the position of the pick.position, it snaps the box by it's center.

 

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