About Store Forum Documentation Contact



Post Reply 
[Solved] Aligin Item to slot
Author Message
AndrewBGS Offline
Member

Post: #1
[Solved] Aligin Item to slot
Hi there, I'm having this problem when I try to equip the SHIELD to my character.

On the character's editor, If I drag and drop the shield on the slot it looks perfect. In the application however, with the code below, the shield is totally messed up. I know I can fix it by rotating the slot, but this isn't right, so I'd like to know if maybe there's a different approach to equipping shield than to equipping other items. The code I use is this:

slot[left]().matrix(Matrix().setPosDir(point->pos, point->perp, point->dir));

Ah, solved! Just to swap perp with dir:

slot[left]().matrix(Matrix().setPosDir(point->pos, point->dir, point->pos));

And now it looks like in the preview. In case anyone else encounters the same issue.
(This post was last modified: 06-23-2013 01:49 PM by AndrewBGS.)
06-23-2013 01:44 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: [Solved] Aligin Item to slot
Code:
point->pos, point->dir, point->pos
You have pos used twice, I think it should be
Code:
point->pos, point->dir, point->perp

Please note that you have this constructor available:
Matrix(C OrientP &o);
so you can create matrix directly from OrientP, please try:
Code:
slot[left]().matrix(*point);
06-23-2013 04:34 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: [Solved] Aligin Item to slot
Yes, I meant perp at the end, my mistake. I'll try your solution also, thanks.
06-23-2013 07:08 PM
Find all posts by this user Quote this message in a reply
Post Reply