Jump to content

Joint Usage


photo

Recommended Posts

Hello. I working on mechanism, when player get an object, and it hover in front of camera (PlayerActor). When player is move or rotate view, object still in focus (in center of view).

 

First of all, I used:

 

PlayerActor player;
Object mouseOverObject;

player.addWorldChild(mouseOverObject);

but in this manner I can't use physical behavior.

 

Then I try use system from physics examples: when we add some force to body - this realization not appropriate cause object levitate some time (it's look not like we take object in hand).

 

Then I use Joint (JointFixed look like most appropriate).

 

I have some questions:

1. I use two bodies: body of picked object and body of camera. Then object moved at the camera, when I move camera. But joint not change it's position, when I rotate camera.

2. I try set void setRotation0(mat3 rotation) for update rotation of joint with camera rotation, but quat getRotation() return quat, how it could be converted from quad to mat3?

Link to comment
×
×
  • Create New...